From patchwork Tue Dec 6 10:19:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladislav Odintsov X-Patchwork-Id: 1712644 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.133; helo=smtp2.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=lHSR3Io/; dkim-atps=neutral Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (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 4NRGdr1cT3z23yt for ; Tue, 6 Dec 2022 21:20:48 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 992A340917; Tue, 6 Dec 2022 10:20:45 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 992A340917 Authentication-Results: smtp2.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=lHSR3Io/ 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 xdBOtBzMHdWw; Tue, 6 Dec 2022 10:20:44 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp2.osuosl.org (Postfix) with ESMTPS id E95FF40904; Tue, 6 Dec 2022 10:20:42 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org E95FF40904 Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 31CB4C0089; Tue, 6 Dec 2022 10:20:40 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id F389CC002D for ; Tue, 6 Dec 2022 10:20:38 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id BFA4B81E16 for ; Tue, 6 Dec 2022 10:20:38 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org BFA4B81E16 Authentication-Results: smtp1.osuosl.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=lHSR3Io/ 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 IHNGj26Z7n1A for ; Tue, 6 Dec 2022 10:20:38 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org A39B881E0F Received: from mail-lj1-x22e.google.com (mail-lj1-x22e.google.com [IPv6:2a00:1450:4864:20::22e]) by smtp1.osuosl.org (Postfix) with ESMTPS id A39B881E0F for ; Tue, 6 Dec 2022 10:20:37 +0000 (UTC) Received: by mail-lj1-x22e.google.com with SMTP id n1so16687175ljg.3 for ; Tue, 06 Dec 2022 02:20:37 -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=wEk+y1SQsVB3lo4t7Zk4gQSQWzdir0T0vVb/b9ZhhnE=; b=lHSR3Io/O730vWUdTHXfzvjMkm8Ohgz9a8ivDdLszd7KDI+f2kFyleek9vHR6N5YnJ udq/KcISzGqvECnF1NOTlldYMuPo6qsuq/z6NoEGiDMbF9qcONuqQ8Cf2JEJvxBaJ7fp HIhfyXIJdinm0O76KzSicLJd/jaus+UjW4zAme3jnZK6fLxNsuZlk0RXAL2RNdQXFN+I TxzgrFn7ZN0ZSXpbjUK2o1I8p28mSfz1AElgxd2yQdzVUhmUmkvwzspdXhnouObatBwF clBayKwj5x3yZr9yX2V9fHSLdpqgLt4JZMZtDGtObfbQ6QFIFncqM1lP+YW0ZzhomJ6a 0yxw== 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=wEk+y1SQsVB3lo4t7Zk4gQSQWzdir0T0vVb/b9ZhhnE=; b=ivqrKJyLPIV7VeWinAYOR7eYb5cuF9wQTYWCDsnkeQDwb23zBEqbKwjqmmWIdjhmoM jhaVUQrucbfucBifQQAzCagFgJAqNh+/oZHLcm8S2xr13TADA0a2pyG/StN9shoUaavf /3UiyPmVWoQ58DnkJqpQF1rUaqB7/ksKYzqG2Af7pL4toWYL/0B3ZXLZt7RrLvF8QuiW S6O+p+wg1CdbKgPq6e/45z0VvPOM1vN9dyUDSfwgXTzLz5YG7xJfETHMN+TCceZC+BTU fKxiImk+Tah5wtpC3CoaOnh5E3DhrC0GJk2yPPmvsaR6dz8s2H/OixfCiHjQ97Non1NZ YKBQ== X-Gm-Message-State: ANoB5pmLkzIbrIKsSSTXptGLz7SAFDsgz5qXLngiqqeobyNm7VwjETbB EdZEe9Sn1gMEeVzfTInnnASB1sFaddMkKvfE X-Google-Smtp-Source: AA0mqf4sDgbH2TQdRRNY/EVriapC5MzAsQHNXW7E7fBjRO8kug4ZDIVWd6WuVlz/gzw4rgoPnEzoOw== X-Received: by 2002:a05:651c:4d0:b0:27a:b1d:5662 with SMTP id e16-20020a05651c04d000b0027a0b1d5662mr1216912lji.356.1670322035051; Tue, 06 Dec 2022 02:20:35 -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 m1-20020a056512114100b004b515f9d117sm2409614lfg.271.2022.12.06.02.20.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Dec 2022 02:20:34 -0800 (PST) From: Vladislav Odintsov To: dev@openvswitch.org Date: Tue, 6 Dec 2022 13:19:59 +0300 Message-Id: <20221206102001.3058710-3-odivlad@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20221206102001.3058710-1-odivlad@gmail.com> References: <20221206102001.3058710-1-odivlad@gmail.com> MIME-Version: 1.0 Cc: Dumitru Ceara , Vladislav Odintsov , dragen15051@gmail.com Subject: [ovs-dev] [PATCH ovn v2 2/4] 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 d3bc08761..9e2369fef 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; }