[ovs-dev] [PATCH ovn v3] ovn-northd.c: Don't use DPG for MC_UNKNOWN related lflows.

Han Zhou hzhou at ovn.org
Mon May 10 21:59:38 UTC 2021


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 <numans at ovn.org>
Cc: Leonid Ryzhyk <lryzhyk at vmware.com>
Co-authored-by: Dumitru Ceara <dceara at redhat.com>
Signed-off-by: Han Zhou <hzhou at ovn.org>
---
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(),
-- 
2.30.2



More information about the dev mailing list