From patchwork Thu Dec 15 17:02:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladislav Odintsov X-Patchwork-Id: 1716213 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=2605:bc80:3010::136; helo=smtp3.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=oxV8kWrz; dkim-atps=neutral Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) (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 4NXz7L1322z240X for ; Fri, 16 Dec 2022 04:02:38 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 229AD6106B; Thu, 15 Dec 2022 17:02:36 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 229AD6106B Authentication-Results: smtp3.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=oxV8kWrz X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Fu3eCVWa-bx9; Thu, 15 Dec 2022 17:02:35 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp3.osuosl.org (Postfix) with ESMTPS id 0FEE6607AA; Thu, 15 Dec 2022 17:02:34 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 0FEE6607AA Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id C9B10C007C; Thu, 15 Dec 2022 17:02:33 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) by lists.linuxfoundation.org (Postfix) with ESMTP id EE3AFC007D for ; Thu, 15 Dec 2022 17:02:32 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id BA4F540FC2 for ; Thu, 15 Dec 2022 17:02:32 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org BA4F540FC2 Authentication-Results: smtp2.osuosl.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=oxV8kWrz X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jLzR0GOSSEY6 for ; Thu, 15 Dec 2022 17:02:32 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org D359540FCA Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by smtp2.osuosl.org (Postfix) with ESMTPS id D359540FCA for ; Thu, 15 Dec 2022 17:02:31 +0000 (UTC) Received: by mail-wr1-x42f.google.com with SMTP id y16so3777076wrm.2 for ; Thu, 15 Dec 2022 09:02:31 -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=zV+wG6doW892j71/zgHKdlvFmsrNPl/7AP7CeeU+Gng=; b=oxV8kWrzNBJiMnniHcpXUiSo8LLYmCaBnNXsyDOmDvjAowJebSHGCj0qi6srEfiuC/ XYs/Aqco2/msipBbVw3JmAsk+EF5GNS5fn3RTtX4eDVqtD2x4/PwyHMOD8USWue05CSd xIl/te3mshMjTsaVLpHlNhDGr9DYhpqVSWobXKMVP3pnm0vteIWKDH7FIXFS3/sCKmAX Sqy5YD2IXdNEXCJFG8KKjRn8QuCcKarGLYbcAn9tgG8MsgZRj36rX0AtRhAZxuJrAUZu Of5Jcz+8lmCbQjXmsvRky7SIx6PbxtfvFwQDdbsN/EB4T1fkbWyi4NxIT87NtT0PPNSh Uuww== 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=zV+wG6doW892j71/zgHKdlvFmsrNPl/7AP7CeeU+Gng=; b=Qi8fzrCFO19JrIawT050hU2d1Y+Wrj6wIlwptRs3TqOxIc/CMj8mjO085el7vQ86Yf TtMJfsH0ht8l+CZKpQ8QFJsTr2Xyis0p/KqR0aalor2OAFJTE+AWqHflQUuUk9sIm2/A imKsq7WHx/YzRH10wqkglnk7P7Hcj7P2ej8vH+265yZDFcdJhibLJs8RaS8ROZU06efy REfA124/SvOh4wTIGnR5SOTVzgp+ROmt3h80mWkqfR8tLdbjaepCLACun/lhx32NGJiB puoPHoimiWMOcLehkC3GJzD9zzrNGivsHgwT3JVMM/ZcCnUrnGJ/gturfTuWeBlFXEvG WQZA== X-Gm-Message-State: ANoB5pnIa0c0EcSR0QdZ5fRL6p+f2fgWAtRtj7ujWkloANoBMRMCQeLL BHKc6DvVpmUOIaLRVVxruIHW8kaecxlx+Zr6 X-Google-Smtp-Source: AA0mqf4Lr4+K9vFi54jDm/leJHpKChtElVxuOQalbYMB8jKv+jMZoq3yo/apkGN02KxYxGwJUbOZLg== X-Received: by 2002:a05:6000:550:b0:242:880:20ce with SMTP id b16-20020a056000055000b00242088020cemr19520937wrf.47.1671123749822; Thu, 15 Dec 2022 09:02:29 -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 q6-20020adff506000000b0022e57e66824sm7429148wro.99.2022.12.15.09.02.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Dec 2022 09:02:29 -0800 (PST) From: Vladislav Odintsov To: dev@openvswitch.org Date: Thu, 15 Dec 2022 20:02:16 +0300 Message-Id: <20221215170219.3072151-3-odivlad@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20221215170219.3072151-1-odivlad@gmail.com> References: <20221215170219.3072151-1-odivlad@gmail.com> MIME-Version: 1.0 Cc: Dumitru Ceara , Vladislav Odintsov Subject: [ovs-dev] [PATCH ovn v3 2/5] 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 2bc96d36c..0d5e5f5d9 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; }