diff mbox series

[ovs-dev,ovn,RFC,v3,21/29] Pull external port ARP responses into a separate function

Message ID 20200716131927.3943-22-anton.ivanov@cambridgegreys.com
State RFC
Headers show
Series [ovs-dev,ovn,RFC,v3,01/29] Move out Table 0 operations to functions | expand

Commit Message

Anton Ivanov July 16, 2020, 1:19 p.m. UTC
From: Anton Ivanov <anton.ivanov@cambridgegreys.com>

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

Patch

diff --git a/northd/ovn-northd.c b/northd/ovn-northd.c
index e5d64993a..e2060e8ac 100644
--- a/northd/ovn-northd.c
+++ b/northd/ovn-northd.c
@@ -6864,6 +6864,24 @@  build_lswitch_flows_step_80_od(
     }
 }
 
+static void
+build_lswitch_flows_step_90_op(
+        struct ovn_port *op, struct hmap *lflows)
+{
+    if (!op->nbsp || !lsp_is_external(op->nbsp)) {
+       return;
+    }
+
+    /* Table 18: External port. Drop ARP request for router ips from
+     * external ports  on chassis not binding those ports.
+     * This makes the router pipeline to be run only on the chassis
+     * binding the external ports. */
+    for (size_t i = 0; i < op->od->n_localnet_ports; i++) {
+        build_drop_arp_nd_flows_for_unbound_router_ports(
+            op, op->od->localnet_ports[i], lflows);
+    }
+}
+
 static void
 build_lswitch_flows(struct hmap *datapaths, struct hmap *ports,
                     struct hmap *port_groups, struct hmap *lflows,
@@ -6931,18 +6949,7 @@  build_lswitch_flows(struct hmap *datapaths, struct hmap *ports,
     }
 
     HMAP_FOR_EACH (op, key_node, ports) {
-        if (!op->nbsp || !lsp_is_external(op->nbsp)) {
-           continue;
-        }
-
-        /* Table 18: External port. Drop ARP request for router ips from
-         * external ports  on chassis not binding those ports.
-         * This makes the router pipeline to be run only on the chassis
-         * binding the external ports. */
-        for (size_t i = 0; i < op->od->n_localnet_ports; i++) {
-            build_drop_arp_nd_flows_for_unbound_router_ports(
-                op, op->od->localnet_ports[i], lflows);
-        }
+        build_lswitch_flows_step_90_op(op, lflows);
     }
 
     char *svc_check_match = xasprintf("eth.dst == %s", svc_monitor_mac);