[PATCH v2] bitmap: add scan from offset function

Dumitrescu, Cristian cristian.dumitrescu at intel.com
Mon Jun 19 13:30:00 CEST 2023



> -----Original Message-----
> From: Volodymyr Fialko <vfialko at marvell.com>
> Sent: Tuesday, June 13, 2023 4:40 PM
> To: dev at dpdk.org; Dumitrescu, Cristian <cristian.dumitrescu at intel.com>
> Cc: jerinj at marvell.com; anoobj at marvell.com; thomas at monjalon.net;
> Volodymyr Fialko <vfialko at marvell.com>
> Subject: [PATCH v2] bitmap: add scan from offset function
> 
> 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>
> ---
>  app/test/test_bitmap.c       | 33 ++++++++++++++++++++-
>  lib/eal/include/rte_bitmap.h | 56 ++++++++++++++++++++++++++++++++++++
>  2 files changed, 88 insertions(+), 1 deletion(-)
> 
<snip>

> +/**
> + * @warning
> + * @b EXPERIMENTAL: this API may change without prior notice.
> + *
> + * Bitmap initialize internal scan pointers at the given position for the scan
> function.
> + *
> + * @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)

Please add a note for this function to mark it as internal, which should be obvious from the double underscore prefix in the name, but better to write it explicitly as well.




More information about the dev mailing list