diff mbox series

[ovs-dev,RFC,v4,14/24] Pull tables 3-10 ingress and 0-7 egress into a separate function

Message ID 20200902145950.25875-14-anton.ivanov@cambridgegreys.com
State Superseded
Headers show
Series [ovs-dev,RFC,v4,01/24] Move out Table 0 (ingress) operations to functions | expand

Commit Message

Anton Ivanov Sept. 2, 2020, 2:59 p.m. UTC
From: Anton Ivanov <anton.ivanov@cambridgegreys.com>

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

Patch

diff --git a/northd/ovn-northd.c b/northd/ovn-northd.c
index 440b12235..455258dfd 100644
--- a/northd/ovn-northd.c
+++ b/northd/ovn-northd.c
@@ -6597,6 +6597,25 @@  build_drop_arp_nd_flows_for_unbound_router_ports(struct ovn_port *op,
     ds_destroy(&match);
 }
 
+static void
+build_lswitch_flows_pre_acl_and_acl_od(
+        struct ovn_datapath *od, struct hmap *lflows,
+        struct shash *meter_groups, struct hmap *lbs,
+        struct hmap *port_groups)
+{
+    /* Build pre-ACL and ACL tables for both ingress and egress.
+     * Ingress tables 3 through 10.  Egress tables 0 through 7. */
+    if (od->nbs) {
+        build_pre_acls(od, lflows);
+        build_pre_lb(od, lflows, meter_groups, lbs);
+        build_pre_stateful(od, lflows);
+        build_acls(od, lflows, port_groups);
+        build_qos(od, lflows);
+        build_lb(od, lflows);
+        build_stateful(od, lflows, lbs);
+    }
+}
+
 static void
 build_lswitch_flows(struct hmap *datapaths, struct hmap *ports,
                     struct hmap *port_groups, struct hmap *lflows,
@@ -6610,21 +6629,10 @@  build_lswitch_flows(struct hmap *datapaths, struct hmap *ports,
     struct ds match = DS_EMPTY_INITIALIZER;
     struct ds actions = DS_EMPTY_INITIALIZER;
 
-    /* Build pre-ACL and ACL tables for both ingress and egress.
-     * 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_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(
+                od, lflows, meter_groups, lbs, port_groups);
     }
 
     /* Build logical flows for the forwarding groups */