On Mon, Nov 24, 2025 at 5:10 PM Lorenzo Bianconi < [email protected]> wrote:
> This allow easy bitmap resizing needed for IP support. > > Signed-off-by: Lorenzo Bianconi <[email protected]> > --- > Hi Lorenzo, thank you for the v2. I'm slightly confused why is this needed now. Shouldn't all changes in 2/2 to lflow-mgr be here? I don't think it's related specifically to LS I-P. lib/ovn-util.h | 10 ++++++++++ > northd/lflow-mgr.c | 15 ++++++--------- > 2 files changed, 16 insertions(+), 9 deletions(-) > > diff --git a/lib/ovn-util.h b/lib/ovn-util.h > index 1c9b62ebb..98fcc534c 100644 > --- a/lib/ovn-util.h > +++ b/lib/ovn-util.h > @@ -628,6 +628,16 @@ dynamic_bitmap_clone_from_db(struct dynamic_bitmap > *dst, > dst->capacity = orig->capacity; > } > > +static inline void > +dynamic_bitmap_clone_from_bitmap(struct dynamic_bitmap *dst, > + const unsigned long *src, size_t n) > +{ > + bitmap_free(dst->map); > + dst->map = bitmap_clone(src, n); > + dst->n_elems = dynamic_bitmap_count1(dst); > + dst->capacity = n; > +} > + > static inline size_t > dynamic_bitmap_scan(struct dynamic_bitmap *dp, bool target, size_t start) > { > diff --git a/northd/lflow-mgr.c b/northd/lflow-mgr.c > index a942f287b..d1fbc2196 100644 > --- a/northd/lflow-mgr.c > +++ b/northd/lflow-mgr.c > @@ -576,9 +576,7 @@ struct lflow_ref_node { > /* Indicates whether the lflow was added with a dp_group using the > * ovn_lflow_add_with_dp_group() macro. */ > bool dpgrp_lflow; > - /* dpgrp bitmap and bitmap length. Valid only of dpgrp_lflow is > true. */ > - unsigned long *dpgrp_bitmap; > - size_t dpgrp_bitmap_len; > + struct dynamic_bitmap dpgrp_bitmap; > > /* Index id of the datapath this lflow_ref_node belongs to. > * Valid only if dpgrp_lflow is false. */ > @@ -631,8 +629,7 @@ lflow_ref_unlink_lflows(struct lflow_ref *lflow_ref) > HMAP_FOR_EACH (lrn, ref_node, &lflow_ref->lflow_ref_nodes) { > if (lrn->dpgrp_lflow) { > size_t index; > - BITMAP_FOR_EACH_1 (index, lrn->dpgrp_bitmap_len, > - lrn->dpgrp_bitmap) { > + DYNAMIC_BITMAP_FOR_EACH_1 (index, &lrn->dpgrp_bitmap) { > if (dp_refcnt_release(&lrn->lflow->dp_refcnts_map, > index)) { > dynamic_bitmap_set0(&lrn->lflow->dpg_bitmap, index); > } > @@ -739,8 +736,8 @@ lflow_table_add_lflow(struct lflow_table *lflow_table, > lrn->lflow_ref = lflow_ref; > lrn->dpgrp_lflow = !od; > if (lrn->dpgrp_lflow) { > - lrn->dpgrp_bitmap = bitmap_clone(dp_bitmap, > dp_bitmap_len); > - lrn->dpgrp_bitmap_len = dp_bitmap_len; > + dynamic_bitmap_clone_from_bitmap(&lrn->dpgrp_bitmap, > + dp_bitmap, > dp_bitmap_len); > } else { > lrn->dp_index = od->index; > } > @@ -750,7 +747,7 @@ lflow_table_add_lflow(struct lflow_table *lflow_table, > > if (!lrn->linked) { > if (lrn->dpgrp_lflow) { > - ovs_assert(lrn->dpgrp_bitmap_len == dp_bitmap_len); > + ovs_assert(lrn->dpgrp_bitmap.capacity == dp_bitmap_len); > size_t index; > BITMAP_FOR_EACH_1 (index, dp_bitmap_len, dp_bitmap) { > /* Allocate a reference counter only if already used. > */ > @@ -1459,7 +1456,7 @@ lflow_ref_node_destroy(struct lflow_ref_node *lrn) > hmap_remove(&lrn->lflow_ref->lflow_ref_nodes, &lrn->ref_node); > ovs_list_remove(&lrn->ref_list_node); > if (lrn->dpgrp_lflow) { > - bitmap_free(lrn->dpgrp_bitmap); > + dynamic_bitmap_free(&lrn->dpgrp_bitmap); > } > free(lrn); > } > -- > 2.52.0 > > Regards, Ales _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
