From patchwork Thu Feb 8 21:49:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Numan Siddique X-Patchwork-Id: 1896771 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=patchwork.ozlabs.org) 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 (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TW9cb5BWxz23hb for ; Fri, 9 Feb 2024 08:49:35 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 8CAAF41C6F; Thu, 8 Feb 2024 21:49:33 +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 ELFoejcs0c4m; Thu, 8 Feb 2024 21:49:32 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=2605:bc80:3010:104::8cd3:938; helo=lists.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 5018141BDC Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp2.osuosl.org (Postfix) with ESMTPS id 5018141BDC; Thu, 8 Feb 2024 21:49:32 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 2227DC0072; Thu, 8 Feb 2024 21:49:32 +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 4C370C0072 for ; Thu, 8 Feb 2024 21:49:30 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 2E40F41BDC for ; Thu, 8 Feb 2024 21:49:30 +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 yIB4n1ohVx6M for ; Thu, 8 Feb 2024 21:49:29 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=217.70.183.196; helo=relay4-d.mail.gandi.net; envelope-from=numans@ovn.org; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp2.osuosl.org 0DDF841BC3 Authentication-Results: smtp2.osuosl.org; dmarc=none (p=none dis=none) header.from=ovn.org DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 0DDF841BC3 Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) by smtp2.osuosl.org (Postfix) with ESMTPS id 0DDF841BC3 for ; Thu, 8 Feb 2024 21:49:28 +0000 (UTC) Received: by mail.gandi.net (Postfix) with ESMTPSA id 2776BE0002; Thu, 8 Feb 2024 21:49:24 +0000 (UTC) From: numans@ovn.org To: dev@openvswitch.org Date: Thu, 8 Feb 2024 16:49:20 -0500 Message-ID: <20240208214920.12747-1-numans@ovn.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240208214904.12696-1-numans@ovn.org> References: <20240208214904.12696-1-numans@ovn.org> MIME-Version: 1.0 X-GND-Sasl: numans@ovn.org Subject: [ovs-dev] [PATCH ovn v1 1/4] northd: Don't add lr_out_delivery default drop flow for each lrp. 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: Numan Siddique The default drop flow in lr_out_delivery stage is generated for every router port of a logical router. This results in the lflow_table_add_lflow() to be called multiple times for the same match and actions and the ovn_lflow to have multiple dp_refcnts. Fix this by generating this lflow only once for each router. Fixes: 27a92cc272aa ("northd: make default drops explicit") Signed-off-by: Numan Siddique Acked-by: Han Zhou Acked-by: Dumitru Ceara --- northd/northd.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/northd/northd.c b/northd/northd.c index a174a4dcd1..a5d5e67117 100644 --- a/northd/northd.c +++ b/northd/northd.c @@ -13470,9 +13470,6 @@ build_egress_delivery_flows_for_lrouter_port( ds_put_format(match, "outport == %s", op->json_key); ovn_lflow_add(lflows, op->od, S_ROUTER_OUT_DELIVERY, 100, ds_cstr(match), "output;", lflow_ref); - - ovn_lflow_add_default_drop(lflows, op->od, S_ROUTER_OUT_DELIVERY, - lflow_ref); } static void @@ -14838,9 +14835,9 @@ lrouter_check_nat_entry(const struct ovn_datapath *od, } /* NAT, Defrag and load balancing. */ -static void build_lr_nat_defrag_and_lb_default_flows(struct ovn_datapath *od, - struct lflow_table *lflows, - struct lflow_ref *lflow_ref) +static void build_lr_nat_defrag_and_lb_default_flows( + struct ovn_datapath *od, struct lflow_table *lflows, + struct lflow_ref *lflow_ref) { ovs_assert(od->nbr); @@ -14866,6 +14863,12 @@ static void build_lr_nat_defrag_and_lb_default_flows(struct ovn_datapath *od, * packet would go through conntrack - which is not required. */ ovn_lflow_add(lflows, od, S_ROUTER_OUT_SNAT, 120, "nd_ns", "next;", lflow_ref); + + /* Default drop rule in lr_out_delivery stage. See + * build_egress_delivery_flows_for_lrouter_port() which adds a rule + * for each router port. */ + ovn_lflow_add_default_drop(lflows, od, S_ROUTER_OUT_DELIVERY, + lflow_ref); } static void