[PATCH v3] bitmap: add scan from offset function

Dumitrescu, Cristian cristian.dumitrescu at intel.com
Fri Jun 23 14:40:52 CEST 2023



> -----Original Message-----
> From: Thomas Monjalon <thomas at monjalon.net>
> Sent: Thursday, June 22, 2023 6:45 PM
> To: Volodymyr Fialko <vfialko at marvell.com>
> Cc: dev at dpdk.org; Dumitrescu, Cristian <cristian.dumitrescu at intel.com>;
> jerinj at marvell.com; anoobj at marvell.com
> Subject: Re: [PATCH v3] bitmap: add scan from offset function
> 
> 21/06/2023 12:01, Volodymyr Fialko:
> > Currently, in the case when we search for a bit set after a particular
> > value, the bitmap has to be scanned from the beginning and
> > rte_bitmap_scan() has to be called multiple times until we hit the value.
> >
> > Add a new rte_bitmap_scan_from_offset() function to initialize scan
> > state at the given offset and perform scan, this will allow getting
> > the next set bit after certain offset within one scan call.
> >
> > Signed-off-by: Volodymyr Fialko <vfialko at marvell.com>
> > ---
> > v2:
> >  - added rte_bitmap_scan_from_offset
> > v3
> >  - added note for internal use only for init_at function
> [...]
> > +/**
> > + * @warning
> > + * @b EXPERIMENTAL: this API may change without prior notice.
> > + *
> > + * Bitmap initialize internal scan pointers at the given position for the scan
> function.
> > + *
> > + * Note: for private/internal use, for public:
> > + * @see rte_bitmap_scan_from_offset()
> > + *
> > + * @param bmp
> > + *   Handle to bitmap instance
> > + * @param pos
> > + *   Bit position to start scan
> > + */
> > +__rte_experimental
> > +static inline void
> > +__rte_bitmap_scan_init_at(struct rte_bitmap *bmp, uint32_t pos)
> 
> I think it should marked with __rte_internal instead of experimental.
> 
> 


+1


More information about the dev mailing list