diff mbox series

[ovs-dev,v5,03/14] ovn-northd: move logical flows for forwardig groups to a function

Message ID 20200911163023.28894-4-anton.ivanov@cambridgegreys.com
State Superseded
Headers show
Series [ovs-dev,v5,01/14] ovn-northd: add marker for ovn-northd changes | expand

Commit Message

Anton Ivanov Sept. 11, 2020, 4:30 p.m. UTC
From: Anton Ivanov <anton.ivanov@cambridgegreys.com>

Signed-off-by: Anton Ivanov <anton.ivanov@cambridgegreys.com>
---
 northd/ovn-northd.c | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/northd/ovn-northd.c b/northd/ovn-northd.c
index 3bf7087f0..08eea008e 100644
--- a/northd/ovn-northd.c
+++ b/northd/ovn-northd.c
@@ -6608,6 +6608,11 @@  build_lswitch_flows_pre_acl_and_acl_od(struct ovn_datapath *od,
                     struct hmap *lflows, struct hmap *port_groups,
                     struct shash *meter_groups, struct hmap *lbs);
 
+/* Build logical flows for the forwarding groups */
+static void
+build_lswitch_forwarding_group_lflows_od(
+                    struct ovn_datapath *od, struct hmap *lflows);
+
 /*
 * Do not remove this comment - it is here as a marker to
 * make diffs readable.
@@ -6632,12 +6637,8 @@  build_lswitch_flows(struct hmap *datapaths, struct hmap *ports,
                     port_groups, meter_groups, lbs);
     }
 
-    /* Build logical flows for the forwarding groups */
     HMAP_FOR_EACH (od, key_node, datapaths) {
-        if (!od->nbs || !od->nbs->n_forwarding_groups) {
-            continue;
-        }
-        build_fwd_group_lflows(od, lflows);
+        build_lswitch_forwarding_group_lflows_od(od, lflows);
     }
 
     /* Logical switch ingress table 0: Admission control framework (priority
@@ -7322,6 +7323,14 @@  build_lswitch_flows_pre_acl_and_acl_od(struct ovn_datapath *od,
     }
 }
 
+static void
+build_lswitch_forwarding_group_lflows_od(
+                    struct ovn_datapath *od, struct hmap *lflows)
+{
+    if (!(!od->nbs || !od->nbs->n_forwarding_groups)) {
+        build_fwd_group_lflows(od, lflows);
+    }
+}
 /* Returns a string of the IP address of the router port 'op' that
  * overlaps with 'ip_s".  If one is not found, returns NULL.
  *