From patchwork Mon May 10 21:59:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Han Zhou X-Patchwork-Id: 1476745 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::138; helo=smtp1.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) (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 4FfFN15BXvz9sWl for ; Tue, 11 May 2021 08:00:01 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 656F283A7E; Mon, 10 May 2021 21:59:59 +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 HW3SheHSt8wi; Mon, 10 May 2021 21:59:58 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp1.osuosl.org (Postfix) with ESMTP id 9A6FC83A44; Mon, 10 May 2021 21:59:57 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 743FBC000E; Mon, 10 May 2021 21:59:57 +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 065F1C0001 for ; Mon, 10 May 2021 21:59:56 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id E92B483A44 for ; Mon, 10 May 2021 21:59:55 +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 pSn6otMYY1Ti for ; Mon, 10 May 2021 21:59:55 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) by smtp1.osuosl.org (Postfix) with ESMTPS id 9362283A3C for ; Mon, 10 May 2021 21:59:54 +0000 (UTC) X-Originating-IP: 98.42.113.153 Received: from localhost.net (unknown [98.42.113.153]) (Authenticated sender: hzhou@ovn.org) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id CDBA140003; Mon, 10 May 2021 21:59:49 +0000 (UTC) From: Han Zhou To: dev@openvswitch.org Date: Mon, 10 May 2021 14:59:38 -0700 Message-Id: <20210510215938.369355-1-hzhou@ovn.org> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Cc: Leonid Ryzhyk , Dumitru Ceara Subject: [ovs-dev] [PATCH ovn v3] ovn-northd.c: Don't use DPG for MC_UNKNOWN related lflows. 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" In commit b468c2c1 it avoided using DPG for multicast related lflows, but commit dd94f126 update the MC_UNKNOWN related lflows with DPG used again by mistake. This patch fixes it to avoid problems when a lflow using MC_UNKNOWN is monitored by a ovn-controller before the related mc-group is monitored, which could cause ovn-controller problem due to an incomplete dependency handling in I-P. This change can be removed (and applying DPG for all the other mc-group related lflows) when the I-P dependency handling problem is fixed. This change also fixes the ovn-northd-ddlog part, which missed using UniqueFlow() for MC_UNKNOWN from the initial ddlog commit 0e77b3bcbf. Fixes: dd94f1266c ("northd: MAC learning: Add logical flows for fdb.") Fixes: 0e77b3bcbf ("ovn-northd-ddlog: New implementation of ovn-northd based on ddlog.") Cc: Numan Siddique Cc: Leonid Ryzhyk Co-authored-by: Dumitru Ceara Signed-off-by: Han Zhou Signed-off-by: Dumitru Ceara Acked-by: Numan Siddique --- v1 -> v2: Addresses Dumitru's comment about commit msg with corrected "Fixes" tag and reworded the message. v2 -> v3: Added ddlog fix and added Dumitru as co-author. Updated the commit message. northd/ovn-northd.c | 6 +++--- northd/ovn_northd.dl | 27 ++++++++++++++++----------- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/northd/ovn-northd.c b/northd/ovn-northd.c index 1d4c5b67b..cccb9f3ed 100644 --- a/northd/ovn-northd.c +++ b/northd/ovn-northd.c @@ -6767,9 +6767,9 @@ build_lswitch_flows(struct hmap *datapaths, struct hmap *lflows) "outport = get_fdb(eth.dst); next;"); if (od->has_unknown) { - ovn_lflow_add(lflows, od, S_SWITCH_IN_L2_UNKNOWN, 50, - "outport == \"none\"", - "outport = \""MC_UNKNOWN"\"; output;"); + ovn_lflow_add_unique(lflows, od, S_SWITCH_IN_L2_UNKNOWN, 50, + "outport == \"none\"", + "outport = \""MC_UNKNOWN "\"; output;"); } else { ovn_lflow_add(lflows, od, S_SWITCH_IN_L2_UNKNOWN, 50, "outport == \"none\"", "drop;"); diff --git a/northd/ovn_northd.dl b/northd/ovn_northd.dl index ffd09c35f..147b0fcb6 100644 --- a/northd/ovn_northd.dl +++ b/northd/ovn_northd.dl @@ -4218,17 +4218,22 @@ for (sw in &Switch(.ls = nb::Logical_Switch{._uuid = ls_uuid})) { .actions = "outport = get_fdb(eth.dst); next;", .external_ids = map_empty()); - Flow(.logical_datapath = ls_uuid, - .stage = s_SWITCH_IN_L2_UNKNOWN(), - .priority = 50, - .__match = "outport == \"none\"", - .actions = if (sw.has_unknown_ports) { - var mc_unknown = json_string_escape(mC_UNKNOWN().0); - "outport = ${mc_unknown}; output;" - } else { - "drop;" - }, - .external_ids = map_empty()); + if (sw.has_unknown_ports) { + var mc_unknown = json_string_escape(mC_UNKNOWN().0) in + UniqueFlow[Flow{.logical_datapath = ls_uuid, + .stage = s_SWITCH_IN_L2_UNKNOWN(), + .priority = 50, + .__match = "outport == \"none\"", + .actions = "outport = ${mc_unknown}; output;", + .external_ids = map_empty()}] + } else { + Flow(.logical_datapath = ls_uuid, + .stage = s_SWITCH_IN_L2_UNKNOWN(), + .priority = 50, + .__match = "outport == \"none\"", + .actions = "drop;", + .external_ids = map_empty()) + }; Flow(.logical_datapath = ls_uuid, .stage = s_SWITCH_IN_L2_UNKNOWN(),