We were passing the lflow_table, but the only part of the lflow table we needed was the dp_groups, so just pass that instead.
Signed-off-by: Mark Michelson <mmich...@redhat.com> --- northd/lflow-mgr.c | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/northd/lflow-mgr.c b/northd/lflow-mgr.c index b41eb1d87..fcedbfe43 100644 --- a/northd/lflow-mgr.c +++ b/northd/lflow-mgr.c @@ -89,7 +89,7 @@ static bool lflow_ref_sync_lflows__( const struct sbrec_logical_dp_group_table *); static bool sync_lflow_to_sb(struct ovn_lflow *, struct ovsdb_idl_txn *ovnsb_txn, - struct lflow_table *, + struct hmap *dp_groups, const struct ovn_datapaths *datapaths, bool ovn_internal_version_changed, const struct sbrec_logical_flow *sbflow, @@ -311,8 +311,15 @@ lflow_table_sync_to_sb(struct lflow_table *lflow_table, sbflow->controller_meter, sbflow->hash); if (lflow) { const struct ovn_datapaths *datapaths; - datapaths = dp_type == DP_SWITCH ? ls_datapaths : lr_datapaths; - sync_lflow_to_sb(lflow, ovnsb_txn, lflow_table, datapaths, + struct hmap *dp_groups; + if (dp_type == DP_SWITCH) { + datapaths = ls_datapaths; + dp_groups = &lflow_table->ls_dp_groups; + } else { + datapaths = lr_datapaths; + dp_groups = &lflow_table->lr_dp_groups; + } + sync_lflow_to_sb(lflow, ovnsb_txn, dp_groups, datapaths, ovn_internal_version_changed, sbflow, dpgrp_table); @@ -326,12 +333,15 @@ lflow_table_sync_to_sb(struct lflow_table *lflow_table, HMAP_FOR_EACH_SAFE (lflow, hmap_node, lflows) { const struct ovn_datapaths *datapaths; + struct hmap *dp_groups; if (ovn_stage_to_datapath_type(lflow->stage) == DP_SWITCH) { datapaths = ls_datapaths; + dp_groups = &lflow_table->ls_dp_groups; } else { datapaths = lr_datapaths; + dp_groups = &lflow_table->lr_dp_groups; } - sync_lflow_to_sb(lflow, ovnsb_txn, lflow_table, datapaths, + sync_lflow_to_sb(lflow, ovnsb_txn, dp_groups, datapaths, ovn_internal_version_changed, NULL, dpgrp_table); hmap_remove(lflows, &lflow->hmap_node); @@ -1008,7 +1018,7 @@ do_ovn_lflow_add(struct lflow_table *lflow_table, size_t dp_bitmap_len, static bool sync_lflow_to_sb(struct ovn_lflow *lflow, struct ovsdb_idl_txn *ovnsb_txn, - struct lflow_table *lflow_table, + struct hmap *dp_groups, const struct ovn_datapaths *datapaths, bool ovn_internal_version_changed, const struct sbrec_logical_flow *sbflow, @@ -1017,16 +1027,10 @@ sync_lflow_to_sb(struct ovn_lflow *lflow, struct sbrec_logical_dp_group *sbrec_dp_group = NULL; struct ovn_dp_group *pre_sync_dpg = lflow->dpg; struct ovn_datapath **datapaths_array; - struct hmap *dp_groups; size_t n_datapaths; n_datapaths = ods_size(datapaths); datapaths_array = datapaths->array; - if (ovn_stage_to_datapath_type(lflow->stage) == DP_SWITCH) { - dp_groups = &lflow_table->ls_dp_groups; - } else { - dp_groups = &lflow_table->lr_dp_groups; - } lflow->n_ods = bitmap_count1(lflow->dpg_bitmap, n_datapaths); ovs_assert(lflow->n_ods); @@ -1301,7 +1305,7 @@ lflow_ref_sync_lflows__(struct lflow_ref *lflow_ref, size_t n_ods = bitmap_count1(lflow->dpg_bitmap, n_datapaths); if (n_ods) { - if (!sync_lflow_to_sb(lflow, ovnsb_txn, lflow_table, datapaths, + if (!sync_lflow_to_sb(lflow, ovnsb_txn, dp_groups, datapaths, ovn_internal_version_changed, sblflow, dpgrp_table)) { return false; -- 2.47.0 _______________________________________________ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev