diff mbox series

[ovs-dev,v10,2/4] Fix BDF Calling conventions

Message ID 20210111095132.7781-2-anton.ivanov@cambridgegreys.com
State Superseded
Headers show
Series [ovs-dev,v10,1/4] ovn-libs: Add support for parallel processing | expand

Commit Message

Anton Ivanov Jan. 11, 2021, 9:51 a.m. UTC
From: Anton Ivanov <anton.ivanov@cambridgegreys.com>

The calling convention for the per-od/per-op routines is that
any data is passed as a part of the lsi struct. This way the
functions can be used in both sequential and parallel builds.

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

Patch

diff --git a/northd/ovn-northd.c b/northd/ovn-northd.c
index 50507685b..dda033543 100644
--- a/northd/ovn-northd.c
+++ b/northd/ovn-northd.c
@@ -11581,6 +11581,7 @@  struct lswitch_flow_build_info {
     struct hmap *igmp_groups;
     struct shash *meter_groups;
     struct hmap *lbs;
+    struct hmap *bfd_connections;
     char *svc_check_match;
     struct ds match;
     struct ds actions;
@@ -11588,12 +11589,14 @@  struct lswitch_flow_build_info {
 
 /* Helper function to combine all lflow generation which is iterated by
  * datapath.
+ *
+ * When extending the function new "work data" must be added to the lsi
+ * struct, not passed as an argument.
  */
 
 static void
 build_lswitch_and_lrouter_iterate_by_od(struct ovn_datapath *od,
-                                        struct lswitch_flow_build_info *lsi,
-                                        struct hmap *bfd_connections)
+                                        struct lswitch_flow_build_info *lsi)
 {
     /* Build Logical Switch Flows. */
     build_lswitch_lflows_pre_acl_and_acl(od, lsi->port_groups, lsi->lflows,
@@ -11614,7 +11617,7 @@  build_lswitch_and_lrouter_iterate_by_od(struct ovn_datapath *od,
                                            &lsi->actions);
     build_ND_RA_flows_for_lrouter(od, lsi->lflows);
     build_static_route_flows_for_lrouter(od, lsi->lflows, lsi->ports,
-                                         bfd_connections);
+                                         lsi->bfd_connections);
     build_mcast_lookup_flows_for_lrouter(od, lsi->lflows, &lsi->match,
                                          &lsi->actions);
     build_ingress_policy_flows_for_lrouter(od, lsi->lflows, lsi->ports);
@@ -11697,6 +11700,7 @@  build_lswitch_and_lrouter_flows(struct hmap *datapaths, struct hmap *ports,
         .igmp_groups = igmp_groups,
         .meter_groups = meter_groups,
         .lbs = lbs,
+        .bfd_connections = bfd_connections,
         .svc_check_match = svc_check_match,
         .match = DS_EMPTY_INITIALIZER,
         .actions = DS_EMPTY_INITIALIZER,
@@ -11706,7 +11710,7 @@  build_lswitch_and_lrouter_flows(struct hmap *datapaths, struct hmap *ports,
      * will move here and will be reogranized by iterator type.
      */
     HMAP_FOR_EACH (od, key_node, datapaths) {
-        build_lswitch_and_lrouter_iterate_by_od(od, &lsi, bfd_connections);
+        build_lswitch_and_lrouter_iterate_by_od(od, &lsi);
     }
     HMAP_FOR_EACH (op, key_node, ports) {
         build_lswitch_and_lrouter_iterate_by_op(op, &lsi);