From patchwork Fri Dec 2 17:31:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladislav Odintsov X-Patchwork-Id: 1711532 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.138; helo=smtp1.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=MCBJEnQM; dkim-atps=neutral Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4NP0PX5N9Cz23n4 for ; Sat, 3 Dec 2022 04:32:16 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 09BDB8222F; Fri, 2 Dec 2022 17:32:14 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 09BDB8222F Authentication-Results: smtp1.osuosl.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=MCBJEnQM X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FaW2OAKrCzm2; Fri, 2 Dec 2022 17:32:12 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp1.osuosl.org (Postfix) with ESMTPS id F077482215; Fri, 2 Dec 2022 17:32:10 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org F077482215 Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id B1504C0035; Fri, 2 Dec 2022 17:32:10 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 1D2CAC0033 for ; Fri, 2 Dec 2022 17:32:09 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 0C78941C4D for ; Fri, 2 Dec 2022 17:32:08 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 0C78941C4D Authentication-Results: smtp4.osuosl.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=MCBJEnQM X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6N0JXIIIxhXI for ; Fri, 2 Dec 2022 17:32:07 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 11CB941BB1 Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) by smtp4.osuosl.org (Postfix) with ESMTPS id 11CB941BB1 for ; Fri, 2 Dec 2022 17:32:06 +0000 (UTC) Received: by mail-ed1-x529.google.com with SMTP id d14so2427371edj.11 for ; Fri, 02 Dec 2022 09:32:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Mfwl/P0EZ4lQ2LMc58omLKvT3OLSEI6o7EIeGaWkFXo=; b=MCBJEnQMGYVdIkGzNbyunGC2QFWfjIKYSierkkkTMXyacKFdRDa1s9ikv2asiKNNhA 64tblI7Zg5XfM5MPW8ITImCDirYpqcIrrLXvwmAPYDFbpkWM7are8YLkdJi7mFxYDPH4 ApQy8Iw6JcCqfeKfQbtz/9iA8ksLPuQtUwuLKJVEyL+W6dTECi0HxCEe6fOyJGeK60PZ R64+WWmaF/Etzswwtmy3MjSLPaw+AQgEsLrzmYBFzW7+AXQUYRsMxY8d0iUlClx0kdAZ iHlE5Q4Uf+6q3qASZkhwGIWE0xJT25MgKg6gEa+htZhca1QED8IghtjTtU2hBY1lq+Vz pktA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Mfwl/P0EZ4lQ2LMc58omLKvT3OLSEI6o7EIeGaWkFXo=; b=XsGL3U3aes8Q+ft9n7iPu45tgZTQatfPLv+hRDrSw/Q/wOntxLAZaYu/dgCigW4/BP LNo+hBFpj4RtboU1x/k3A1EKmg6/va9o3hLFALiHR8dx7Eh0gBKxBNCxppu62GH20wDn YQLpa+NPDFXqmBhYkfehK/ALLQJtZ5C6DR55Dv5DQgKaz7W3vOcyLlLBX4ca8zhR12SX DuQsPZqxNxqbetMZjPzNa87lQbg1WWfIYPO1dGI4IRHjuP0SdvkgQAgAkZg/vnNjF2t1 tsJ/12GlxiwG43elc8vvbJ7F1a2fn050ETNIVBatbf4FkWP5x9GiOSldG7tO/0VWF0Cr 2RZw== X-Gm-Message-State: ANoB5pnrLHP3PK7w32+5bJUV1HIwtyFdE5HKsBj4mf7QfwHX5AaDghvm VzK4gzby9VRcmNcDvBSBapLvcwqhwTwJbsrF X-Google-Smtp-Source: AA0mqf7uajlby2v8cfrXmOne5F/QrXqvxNilGZhYj2sO7fMLOpVBdrtK6u8xQLBb6clrBA72CVZtHA== X-Received: by 2002:a05:6402:248e:b0:461:e2ab:912d with SMTP id q14-20020a056402248e00b00461e2ab912dmr49488059eda.93.1670002324858; Fri, 02 Dec 2022 09:32:04 -0800 (PST) Received: from ip-10-70-112-12.vpc-1e810be1.internal (c2-178-216-98-9.elastic.cloud.croc.ru. [178.216.98.9]) by smtp.gmail.com with ESMTPSA id c9-20020a170906762900b007be3aa82543sm3235776ejn.35.2022.12.02.09.32.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Dec 2022 09:32:04 -0800 (PST) From: Vladislav Odintsov To: dev@openvswitch.org Date: Fri, 2 Dec 2022 20:31:43 +0300 Message-Id: <20221202173147.3032702-4-odivlad@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20221202173147.3032702-1-odivlad@gmail.com> References: <20221202173147.3032702-1-odivlad@gmail.com> MIME-Version: 1.0 Cc: Vladislav Odintsov , dragen15051@gmail.com Subject: [ovs-dev] [PATCH ovn 3/7] ic: lookup southbound port_binding only if needed X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" Signed-off-by: Vladislav Odintsov Acked-by: Dumitru Ceara --- ic/ovn-ic.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ic/ovn-ic.c b/ic/ovn-ic.c index b3790e965..3e02b4c98 100644 --- a/ic/ovn-ic.c +++ b/ic/ovn-ic.c @@ -757,6 +757,7 @@ port_binding_run(struct ic_context *ctx, } icsbrec_port_binding_index_destroy_row(isb_pb_key); + const struct sbrec_port_binding *sb_pb; const struct icnbrec_transit_switch *ts; ICNBREC_TRANSIT_SWITCH_FOR_EACH (ts, ctx->ovninb_idl) { const struct nbrec_logical_switch *ls = find_ts_in_nb(ctx, ts->name); @@ -788,9 +789,9 @@ port_binding_run(struct ic_context *ctx, for (int i = 0; i < ls->n_ports; i++) { lsp = ls->ports[i]; - const struct sbrec_port_binding *sb_pb = find_lsp_in_sb(ctx, lsp); if (!strcmp(lsp->type, "router")) { /* The port is local. */ + sb_pb = find_lsp_in_sb(ctx, lsp); if (!sb_pb) { continue; } @@ -807,6 +808,7 @@ port_binding_run(struct ic_context *ctx, if (!isb_pb) { nbrec_logical_switch_update_ports_delvalue(ls, lsp); } else { + sb_pb = find_lsp_in_sb(ctx, lsp); if (!sb_pb) { continue; }