|static uint32_t ||rte_bitmap_get_memory_footprint (uint32_t n_bits)|
|static struct rte_bitmap * ||rte_bitmap_init (uint32_t n_bits, uint8_t *mem, uint32_t mem_size)|
|static int ||rte_bitmap_free (struct rte_bitmap *bmp)|
|static void ||rte_bitmap_reset (struct rte_bitmap *bmp)|
|static void ||rte_bitmap_prefetch0 (struct rte_bitmap *bmp, uint32_t pos)|
|static uint64_t ||rte_bitmap_get (struct rte_bitmap *bmp, uint32_t pos)|
|static void ||rte_bitmap_set (struct rte_bitmap *bmp, uint32_t pos)|
|static void ||rte_bitmap_set_slab (struct rte_bitmap *bmp, uint32_t pos, uint64_t slab)|
|static void ||rte_bitmap_clear (struct rte_bitmap *bmp, uint32_t pos)|
|static int ||rte_bitmap_scan (struct rte_bitmap *bmp, uint32_t *pos, uint64_t *slab)|
The bitmap component provides a mechanism to manage large arrays of bits through bit get/set/clear and bit array scan operations.
The bitmap scan operation is optimized for 64-bit CPUs using 64/128 byte cache lines. The bitmap is hierarchically organized using two arrays (array1 and array2), with each bit in array1 being associated with a full cache line (512/1024 bits) of bitmap bits, which are stored in array2: the bit in array1 is set only when there is at least one bit set within its associated array2 bits, otherwise the bit in array1 is cleared. The read and write operations for array1 and array2 are always done in slabs of 64 bits.
This bitmap is not thread safe. For lock free operation on a specific bitmap instance, a single writer thread performing bit set/clear operations is allowed, only the writer thread can do bitmap scan operations, while there can be several reader threads performing bit get operations in parallel with the writer thread. When the use of locking primitives is acceptable, the serialization of the bit set/clear and bitmap scan operations needs to be enforced by the caller, while the bit get operation does not require locking the bitmap.
Definition in file rte_bitmap.h.