From patchwork Thu Aug 12 15:53:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Pfaff X-Patchwork-Id: 1516365 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=2605:bc80:3010::136; helo=smtp3.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) 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 RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Glrq31MChz9sX1 for ; Fri, 13 Aug 2021 01:54:38 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 90E7F61430; Thu, 12 Aug 2021 15:54:34 +0000 (UTC) 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 0Ps3Xtmyukho; Thu, 12 Aug 2021 15:54:30 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp3.osuosl.org (Postfix) with ESMTPS id BF4536002E; Thu, 12 Aug 2021 15:54:28 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 0B6C3C002F; Thu, 12 Aug 2021 15:54:25 +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 6E0DCC0022 for ; Thu, 12 Aug 2021 15:54:23 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id C060F401CE for ; Thu, 12 Aug 2021 15:54:22 +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 G4vMIQR0OC59 for ; Thu, 12 Aug 2021 15:54:21 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from relay11.mail.gandi.net (relay11.mail.gandi.net [217.70.178.231]) by smtp2.osuosl.org (Postfix) with ESMTPS id A98AA40758 for ; Thu, 12 Aug 2021 15:54:20 +0000 (UTC) Received: (Authenticated sender: blp@ovn.org) by relay11.mail.gandi.net (Postfix) with ESMTPSA id EE434100009; Thu, 12 Aug 2021 15:54:17 +0000 (UTC) From: Ben Pfaff To: dev@openvswitch.org Date: Thu, 12 Aug 2021 08:53:56 -0700 Message-Id: <20210812155358.3141517-6-blp@ovn.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210812155358.3141517-1-blp@ovn.org> References: <20210812155358.3141517-1-blp@ovn.org> MIME-Version: 1.0 Cc: Ben Pfaff , Ben Pfaff Subject: [ovs-dev] [PATCH 5/7] ovn-northd-ddlog: Get rid of duplicate flows caused by stage_hint. 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" From: Ben Pfaff It was possible for these rules to generate multiple Flow records that differed only in their stage_hint. This caused a lot of duplication for the load balancer benchmark. With the benchmark at https://mail.openvswitch.org/pipermail/ovs-dev/2021-July/385333.html, this reduces memory consumption from 53 GB to 17 GB and elapsed time from 14 minutes to 5 minutes. Signed-off-by: Ben Pfaff Signed-off-by: Ben Pfaff --- northd/ovn_northd.dl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/northd/ovn_northd.dl b/northd/ovn_northd.dl index dd69126ff..38b97aa6b 100644 --- a/northd/ovn_northd.dl +++ b/northd/ovn_northd.dl @@ -3163,7 +3163,7 @@ Flow(.logical_datapath = sw._uuid, .actions = actions.intern(), .io_port = None, .controller_meter = meter, - .stage_hint = stage_hint(lb._uuid)) :- + .stage_hint = 0) :- sw in &Switch(), LBVIPWithStatus[lbvip@&LBVIPWithStatus{.lb = lb}], sw.load_balancer.contains(lb._uuid), @@ -4587,7 +4587,7 @@ Flow(.logical_datapath = sw._uuid, .priority = 90, .__match = i"${fLAGBIT_NOT_VXLAN()} && arp.op == 1 && arp.tpa == ${ipv4}", .actions = i"outport = ${flood}; output;", - .stage_hint = stage_hint(sp.lsp._uuid), + .stage_hint = 0, .io_port = None, .controller_meter = None) :- sp in &SwitchPort(.sw = sw, .peer = Some{rp}), @@ -6666,7 +6666,7 @@ for (RouterLBVIP( .priority = prio, .__match = __match.intern(), .actions = __actions, - .stage_hint = stage_hint(lb._uuid), + .stage_hint = 0, .io_port = None, .controller_meter = None); @@ -6712,7 +6712,7 @@ for (RouterLBVIP( .priority = prio, .__match = est_match.intern(), .actions = actions, - .stage_hint = stage_hint(lb._uuid), + .stage_hint = 0, .io_port = None, .controller_meter = None); @@ -6797,7 +6797,7 @@ Flow(.logical_datapath = r._uuid, .actions = actions.intern(), .io_port = None, .controller_meter = meter, - .stage_hint = stage_hint(lb._uuid)) :- + .stage_hint = 0) :- r in &Router(), r.l3dgw_ports.len() > 0 or r.is_gateway, LBVIPWithStatus[lbvip@&LBVIPWithStatus{.lb = lb}],