From patchwork Tue Sep 7 22:45:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Pfaff X-Patchwork-Id: 1525575 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: 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=) 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 RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4H40jg3nd9z9t10 for ; Wed, 8 Sep 2021 08:45:59 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 83B24406FF; Tue, 7 Sep 2021 22:45:57 +0000 (UTC) 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 PIpz-m8me60J; Tue, 7 Sep 2021 22:45:56 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp2.osuosl.org (Postfix) with ESMTPS id 19A78406DC; Tue, 7 Sep 2021 22:45:53 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 8EF48C001D; Tue, 7 Sep 2021 22:45:49 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 19C57C002C for ; Tue, 7 Sep 2021 22:45:48 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 5686080C3F for ; Tue, 7 Sep 2021 22:45:43 +0000 (UTC) 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 IX7uMoeOm3s0 for ; Tue, 7 Sep 2021 22:45:42 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by smtp1.osuosl.org (Postfix) with ESMTPS id E88DF80CB0 for ; Tue, 7 Sep 2021 22:45:41 +0000 (UTC) Received: (Authenticated sender: blp@ovn.org) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 707FA1BF203; Tue, 7 Sep 2021 22:45:39 +0000 (UTC) From: Ben Pfaff To: dev@openvswitch.org Date: Tue, 7 Sep 2021 15:45:16 -0700 Message-Id: <20210907224516.489604-11-blp@ovn.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210907224516.489604-1-blp@ovn.org> References: <20210907224516.489604-1-blp@ovn.org> MIME-Version: 1.0 Cc: Ben Pfaff Subject: [ovs-dev] [PATCH ovn v2 10/10] ovn-northd-ddlog: Avoid unnecessary joins for SwitchPortARPForwards. 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" SwitchPortARPForwards already has all the necessary data in it and joining with SwitchPort just wastes time. Signed-off-by: Ben Pfaff --- northd/ovn_northd.dl | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/northd/ovn_northd.dl b/northd/ovn_northd.dl index 573c2b392..201c08a24 100644 --- a/northd/ovn_northd.dl +++ b/northd/ovn_northd.dl @@ -4612,8 +4612,7 @@ Flow(.logical_datapath = sw._uuid, .io_port = None, .controller_meter = None) :- var mc_flood_l2 = json_escape(mC_FLOOD_L2().0), - sp in &SwitchPort(.sw = sw, .peer = Some{rp@&RouterPort{.enabled = true}}), - &SwitchPortARPForwards(.port = sp, .reachable_ips_v4 = ips_v4), + &SwitchPortARPForwards(.port = sp@&SwitchPort{.sw = sw}, .reachable_ips_v4 = ips_v4), var ipv4 = FlatMap(ips_v4). Flow(.logical_datapath = sw._uuid, .stage = s_SWITCH_IN_L2_LKUP(), @@ -4629,8 +4628,7 @@ Flow(.logical_datapath = sw._uuid, .io_port = None, .controller_meter = None) :- var mc_flood_l2 = json_escape(mC_FLOOD_L2().0), - sp in &SwitchPort(.sw = sw, .peer = Some{rp@&RouterPort{.enabled = true}}), - &SwitchPortARPForwards(.port = sp, .reachable_ips_v6 = ips_v6), + &SwitchPortARPForwards(.port = sp@&SwitchPort{.sw = sw}, .reachable_ips_v6 = ips_v6), var ipv6 = FlatMap(ips_v6). Flow(.logical_datapath = sw._uuid, @@ -4642,8 +4640,7 @@ Flow(.logical_datapath = sw._uuid, .io_port = None, .controller_meter = None) :- var actions = i"outport = ${json_escape(mC_FLOOD().0)}; output;", - sp in &SwitchPort(.sw = sw, .peer = Some{rp@&RouterPort{.enabled = true}}), - &SwitchPortARPForwards(.port = sp, .unreachable_ips_v4 = ips_v4), + &SwitchPortARPForwards(.port = sp@&SwitchPort{.sw = sw}, .unreachable_ips_v4 = ips_v4), var ipv4 = FlatMap(ips_v4). Flow(.logical_datapath = sw._uuid, .stage = s_SWITCH_IN_L2_LKUP(), @@ -4654,8 +4651,7 @@ Flow(.logical_datapath = sw._uuid, .io_port = None, .controller_meter = None) :- var actions = i"outport = ${json_escape(mC_FLOOD().0)}; output;", - sp in &SwitchPort(.sw = sw, .peer = Some{rp@&RouterPort{.enabled = true}}), - &SwitchPortARPForwards(.port = sp, .unreachable_ips_v6 = ips_v6), + &SwitchPortARPForwards(.port = sp@&SwitchPort{.sw = sw}, .unreachable_ips_v6 = ips_v6), var ipv6 = FlatMap(ips_v6). for (SwitchPortNewDynamicAddress(.port = &SwitchPort{.lsp = lsp, .json_name = json_name, .sw = sw},