diff mbox series

[ovs-dev,v2,02/14] ovn-northd: move pre-acl and acl processing in to a separate function

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

Commit Message

Anton Ivanov Sept. 18, 2020, 3:07 p.m. UTC
From: Anton Ivanov <anton.ivanov@cambridgegreys.com>

Move pre-acl and acl processing in build_lswitch_flows() into a
separate helper function

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

Patch

diff --git a/northd/ovn-northd.c b/northd/ovn-northd.c
index 355d539da..a6212f902 100644
--- a/northd/ovn-northd.c
+++ b/northd/ovn-northd.c
@@ -6736,6 +6736,13 @@  build_drop_arp_nd_flows_for_unbound_router_ports(struct ovn_port *op,
     ds_destroy(&match);
 }
 
+/* Build pre-ACL and ACL tables for both ingress and egress.
+ * Ingress tables 3 through 10.  Egress tables 0 through 7. */
+static void
+build_lswitch_flows_pre_acl_and_acl(struct ovn_datapath *od,
+                    struct hmap *lflows, struct hmap *port_groups,
+                    struct shash *meter_groups, struct hmap *lbs);
+
 /*
 * Do not remove this comment - it is here as a marker to
 * make diffs readable.
@@ -6758,18 +6765,8 @@  build_lswitch_flows(struct hmap *datapaths, struct hmap *ports,
      * Ingress tables 3 through 10.  Egress tables 0 through 7. */
     struct ovn_datapath *od;
     HMAP_FOR_EACH (od, key_node, datapaths) {
-        if (!od->nbs) {
-            continue;
-        }
-
-        build_pre_acls(od, lflows);
-        build_pre_lb(od, lflows, meter_groups, lbs);
-        build_pre_stateful(od, lflows);
-        build_acl_hints(od, lflows);
-        build_acls(od, lflows, port_groups);
-        build_qos(od, lflows);
-        build_lb(od, lflows);
-        build_stateful(od, lflows, lbs);
+        build_lswitch_flows_pre_acl_and_acl(od, lflows,
+                    port_groups, meter_groups, lbs);
     }
 
     /* Build logical flows for the forwarding groups */
@@ -7447,6 +7444,23 @@  build_lswitch_flows(struct hmap *datapaths, struct hmap *ports,
     ds_destroy(&actions);
 }
 
+static void
+build_lswitch_flows_pre_acl_and_acl(struct ovn_datapath *od,
+                    struct hmap *lflows, struct hmap *port_groups,
+                    struct shash *meter_groups, struct hmap *lbs)
+{
+    if (od->nbs) {
+        build_pre_acls(od, lflows);
+        build_pre_lb(od, lflows, meter_groups, lbs);
+        build_pre_stateful(od, lflows);
+        build_acl_hints(od, lflows);
+        build_acls(od, lflows, port_groups);
+        build_qos(od, lflows);
+        build_lb(od, lflows);
+        build_stateful(od, lflows, lbs);
+    }
+}
+
 /* Returns a string of the IP address of the router port 'op' that
  * overlaps with 'ip_s".  If one is not found, returns NULL.
  *