Every caller of this function is aware of the type of datapath group
they are creating and therefore only needs to pass a single type of
datapaths in.

Signed-off-by: Mark Michelson <mmich...@redhat.com>
---
 northd/en-sync-sb.c |  6 ++----
 northd/lflow-mgr.c  | 18 ++++++------------
 northd/lflow-mgr.h  |  6 ++----
 3 files changed, 10 insertions(+), 20 deletions(-)

diff --git a/northd/en-sync-sb.c b/northd/en-sync-sb.c
index 0a68d1d65..52f1c8206 100644
--- a/northd/en-sync-sb.c
+++ b/northd/en-sync-sb.c
@@ -793,8 +793,7 @@ sync_sb_lb_record(struct sb_lb_record *sb_lb,
             sb_lb->ls_dpg = ovn_dp_group_create(
                 ovnsb_txn, &sb_lbs->ls_dp_groups, sbrec_ls_dp_group,
                 lb_dps->n_nb_ls, lb_dps->nb_ls_map,
-                ods_size(ls_datapaths), true,
-                ls_datapaths, lr_datapaths);
+                ods_size(ls_datapaths), ls_datapaths);
         }
 
         if (chassis_features->ls_dpg_column) {
@@ -848,8 +847,7 @@ sync_sb_lb_record(struct sb_lb_record *sb_lb,
             sb_lb->lr_dpg = ovn_dp_group_create(
                 ovnsb_txn, &sb_lbs->lr_dp_groups, sbrec_lr_dp_group,
                 lb_dps->n_nb_lr, lb_dps->nb_lr_map,
-                ods_size(lr_datapaths), false,
-                ls_datapaths, lr_datapaths);
+                ods_size(lr_datapaths), lr_datapaths);
         }
 
         sbrec_load_balancer_set_lr_datapath_group(sbrec_lb,
diff --git a/northd/lflow-mgr.c b/northd/lflow-mgr.c
index a1e962ee2..4456d9ea6 100644
--- a/northd/lflow-mgr.c
+++ b/northd/lflow-mgr.c
@@ -761,9 +761,7 @@ ovn_dp_group_create(struct ovsdb_idl_txn *ovnsb_txn,
                     size_t desired_n,
                     const unsigned long *desired_bitmap,
                     size_t bitmap_len,
-                    bool is_switch,
-                    const struct ovn_datapaths *ls_datapaths,
-                    const struct ovn_datapaths *lr_datapaths)
+                    const struct ovn_datapaths *datapaths)
 {
     struct ovn_dp_group *dpg;
 
@@ -775,10 +773,8 @@ ovn_dp_group_create(struct ovsdb_idl_txn *ovnsb_txn,
     for (i = 0; sb_group && i < sb_group->n_datapaths; i++) {
         struct ovn_datapath *datapath_od;
 
-        datapath_od = ovn_datapath_from_sbrec(
-                        ls_datapaths ? &ls_datapaths->datapaths : NULL,
-                        lr_datapaths ? &lr_datapaths->datapaths : NULL,
-                        sb_group->datapaths[i]);
+        datapath_od = ovn_datapath_from_sbrec_(&datapaths->datapaths,
+                                               sb_group->datapaths[i]);
         if (!datapath_od || ovn_datapath_is_stale(datapath_od)) {
             break;
         }
@@ -807,8 +803,7 @@ ovn_dp_group_create(struct ovsdb_idl_txn *ovnsb_txn,
         dpg->dp_group = ovn_sb_insert_or_update_logical_dp_group(
                             ovnsb_txn,
                             can_modify ? sb_group : NULL,
-                            desired_bitmap,
-                            is_switch ? ls_datapaths : lr_datapaths);
+                            desired_bitmap, datapaths);
     }
     dpg->dpg_uuid = dpg->dp_group->header_.uuid;
     hmap_insert(dp_groups, &dpg->node, hash_int(desired_n, 0));
@@ -1170,9 +1165,8 @@ sync_lflow_to_sb(struct ovn_lflow *lflow,
             lflow->dpg = ovn_dp_group_create(
                                 ovnsb_txn, dp_groups, sbrec_dp_group,
                                 lflow->n_ods, lflow->dpg_bitmap,
-                                n_datapaths, is_switch,
-                                ls_datapaths,
-                                lr_datapaths);
+                                n_datapaths,
+                                is_switch ? ls_datapaths : lr_datapaths);
         }
         sbrec_logical_flow_set_logical_dp_group(sbflow,
                                                 lflow->dpg->dp_group);
diff --git a/northd/lflow-mgr.h b/northd/lflow-mgr.h
index 2c05b352d..16ffc105c 100644
--- a/northd/lflow-mgr.h
+++ b/northd/lflow-mgr.h
@@ -179,9 +179,7 @@ struct ovn_dp_group *ovn_dp_group_create(
     struct ovsdb_idl_txn *ovnsb_txn, struct hmap *dp_groups,
     struct sbrec_logical_dp_group *sb_group,
     size_t desired_n, const unsigned long *desired_bitmap,
-    size_t bitmap_len, bool is_switch,
-    const struct ovn_datapaths *ls_datapaths,
-    const struct ovn_datapaths *lr_datapaths);
+    size_t bitmap_len, const struct ovn_datapaths *datapaths);
 
 static inline void
 inc_ovn_dp_group_ref(struct ovn_dp_group *dpg)
@@ -201,4 +199,4 @@ dec_ovn_dp_group_ref(struct hmap *dp_groups, struct 
ovn_dp_group *dpg)
     }
 }
 
-#endif /* LFLOW_MGR_H */
\ No newline at end of file
+#endif /* LFLOW_MGR_H */
-- 
2.47.0

_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to