rte_bitset.h(3)
rte_bitset.h(3) โ Library Functions Manual ๐ โจ
okay bestie, this is the manual page for rte_bitset.h. no cap, it's giving bitset realness. every macro, function, value, warning and line number is staying exactly where it belongs. ๐ซถ
NAME ๐
rte_bitset.h โ the header that lets you query and manipulate sets of bits kept in arrays of uint64_t-sized elements. iconic. ๐
SYNOPSIS ๐ฆ
#include <limits.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <rte_bitops.h>
#include <rte_branch_prediction.h>
#include <rte_common.h>
#include <rte_compat.h>
#include <rte_debug.h>
#include <rte_memcpy.h>
Macros ๐งฉ
#define RTE_BITSET_WORD_SIZE (sizeof(uint64_t))
#define RTE_BITSET_WORD_BITS (RTE_BITSET_WORD_SIZE * CHAR_BIT)
#define RTE_BITSET_NUM_WORDS(size)
#define RTE_BITSET_SIZE(size)
#define RTE_BITSET_DECLARE(name, size)
#define RTE_BITSET_FOREACH_SET(var, bitset, size)
#define RTE_BITSET_FOREACH_CLEAR(var, bitset, size)
#define RTE_BITSET_FOREACH_SET_RANGE(var, bitset, size, start_bit, len)
#define RTE_BITSET_FOREACH_CLEAR_RANGE(var, bitset, size, start_bit, len)
Functions ๐งฉ
static __rte_experimental void rte_bitset_init (uint64_t *bitset, size_t size)
static __rte_experimental bool rte_bitset_test (const uint64_t *bitset, size_t bit_num)
static __rte_experimental void rte_bitset_set (uint64_t *bitset, size_t bit_num)
static __rte_experimental void rte_bitset_clear (uint64_t *bitset, size_t bit_num)
static __rte_experimental void rte_bitset_assign (uint64_t *bitset, size_t bit_num, bool bit_value)
static __rte_experimental void rte_bitset_flip (uint64_t *bitset, size_t bit_num)
static __rte_experimental bool rte_bitset_atomic_test (const uint64_t *bitset, size_t bit_num, int memory_order)
static __rte_experimental void rte_bitset_atomic_set (uint64_t *bitset, size_t bit_num, int memory_order)
static __rte_experimental void rte_bitset_atomic_clear (uint64_t *bitset, size_t bit_num, int memory_order)
static __rte_experimental void rte_bitset_atomic_assign (uint64_t *bitset, size_t bit_num, bool bit_value, int memory_order)
static __rte_experimental void rte_bitset_atomic_flip (uint64_t *bitset, size_t bit_num, int memory_order)
static __rte_experimental void rte_bitset_set_all (uint64_t *bitset, size_t size)
static __rte_experimental void rte_bitset_clear_all (uint64_t *bitset, size_t size)
static __rte_experimental size_t rte_bitset_count_set (const uint64_t *bitset, size_t size)
static __rte_experimental size_t rte_bitset_count_clear (const uint64_t *bitset, size_t size)
static __rte_experimental ssize_t rte_bitset_find_first_set (const uint64_t *bitset, size_t size)
static __rte_experimental ssize_t rte_bitset_find_set (const uint64_t *bitset, size_t size, size_t start_bit, size_t len)
static __rte_experimental ssize_t rte_bitset_find_set_wrap (const uint64_t *bitset, size_t size, size_t start_bit, size_t len)
static __rte_experimental ssize_t rte_bitset_find_first_clear (const uint64_t *bitset, size_t size)
static __rte_experimental ssize_t rte_bitset_find_clear (const uint64_t *bitset, size_t size, size_t start_bit, size_t len)
static __rte_experimental ssize_t rte_bitset_find_clear_wrap (const uint64_t *bitset, size_t size, size_t start_bit, size_t len)
static __rte_experimental void rte_bitset_copy (uint64_t *__rte_restrict dst_bitset, const uint64_t *__rte_restrict src_bitset, size_t size)
static __rte_experimental void rte_bitset_or (uint64_t *dst_bitset, const uint64_t *src_bitset0, const uint64_t *src_bitset1, size_t size)
static __rte_experimental void rte_bitset_and (uint64_t *dst_bitset, const uint64_t *src_bitset0, const uint64_t *src_bitset1, size_t size)
static __rte_experimental void rte_bitset_xor (uint64_t *dst_bitset, const uint64_t *src_bitset0, const uint64_t *src_bitset1, size_t size)
static __rte_experimental void rte_bitset_complement (uint64_t *dst_bitset, const uint64_t *src_bitset, size_t size)
static __rte_experimental void rte_bitset_shift_left (uint64_t *dst_bitset, const uint64_t *src_bitset, size_t size, size_t shift_bits)
static __rte_experimental void rte_bitset_shift_right (uint64_t *dst_bitset, const uint64_t *src_bitset, size_t size, size_t shift_bits)
static __rte_experimental bool rte_bitset_equal (const uint64_t *bitset_a, const uint64_t *bitset_b, size_t size)
__rte_experimental ssize_t rte_bitset_to_str (const uint64_t *bitset, size_t size, char *buf, size_t capacity)
Detailed Description ๐
RTE Bitset โ yes, that's the name, and it's lowkey iconic.
This file provides functions and macros for querying and manipulating sets of bits kept in arrays of uint64_t-sized elements. basically a glow-up for bit arrays. ๐
The bits in a bitset are numbered from 0 to size - 1, with the lowest index being the least significant bit. so index 0 is the LSB, periodt. ๐ข
The bitset array must be properly aligned. don't be messy with alignment, bestie. ๐
For optimal performance, the size parameter, required by many of the API's functions, should be a compile-time constant. make it constant if you want that speed. โก
For large bitsets, the rte_bitmap.h API may be more appropriate. just saying. ๐บ๏ธ
Warning โ All functions modifying a bitset may overwrite any unused bits of the last word. Such unused bits are ignored by all functions reading bits. โ ๏ธ
Definition in file rte_bitset.h.
Macro Definition Documentation ๐
#define RTE_BITSET_WORD_SIZE (sizeof(uint64_t))
okay so this is the size (in bytes) of each element in the array used to represent a bitset. it's literally sizeof(uint64_t). ๐
Definition at line 53 of file rte_bitset.h.
#define RTE_BITSET_WORD_BITS (RTE_BITSET_WORD_SIZE * CHAR_BIT)
the size (in bits) of each element in the array used to represent a bitset. yes bestie, it multiplies the word size by CHAR_BIT. ๐
Definition at line 59 of file rte_bitset.h.
#define RTE_BITSET_NUM_WORDS( size)
Value:
((size + RTE_BITSET_WORD_BITS - 1) / RTE_BITSET_WORD_BITS)
computes the number of words required to store size bits. math girl summer. ๐งฎโจ
Definition at line 64 of file rte_bitset.h.
#define RTE_BITSET_SIZE( size)
Value:
((size_t)(RTE_BITSET_NUM_WORDS(size) * RTE_BITSET_WORD_SIZE))
computes the amount of memory (in bytes) required to fit a bitset holding size bits. slay. ๐พ
Definition at line 71 of file rte_bitset.h.
#define RTE_BITSET_DECLARE( name, size)
Value:
uint64_t name[RTE_BITSET_NUM_WORDS(size)]
Warning โ EXPERIMENTAL: this API may change without prior notice. ๐ญ
Declare a bitset. Declare (e.g., as a struct field) or define (e.g., as a stack variable) a bitset of the specified size. it's giving "make it official". ๐
Parameters
sizeโ The number of bits the bitset must be able to represent. Must be a compile-time constant.nameโ The field or variable name of the resulting definition.
Definition at line 104 of file rte_bitset.h.
#define RTE_BITSET_FOREACH_SET( var, bitset, size)
Value:
__RTE_BITSET_FOREACH(var, bitset, size, 0, size, 0)
Warning โ EXPERIMENTAL: this API may change without prior notice. ๐
Iterate over all bits set. This macro iterates over all bits set (i.e., all ones) in the bitset, in the forward direction (i.e., starting with the least significant '1'). periodt. ๐ฅ
Parameters
varโ An iterator variable of typessize_t. For each successive iteration, this variable will hold the bit index of a set bit.bitsetโ Aconst uint64_t *pointer to the bitset array.sizeโ The size of the bitset (in bits).
Definition at line 135 of file rte_bitset.h.
#define RTE_BITSET_FOREACH_CLEAR( var, bitset, size)
Value:
__RTE_BITSET_FOREACH(var, bitset, size, 0, size, __RTE_BITSET_FIND_FLAG_FIND_CLEAR)
Warning โ EXPERIMENTAL: this API may change without prior notice. ๐ซ
Iterate over all bits cleared. This macro iterates over all bits cleared in the bitset, in the forward direction (i.e., starting with the lowest-indexed set bit). ngl, it's giving zero energy but make it useful. ๐ณ๏ธ
Parameters
varโ An iterator variable of typessize_t. For each successive iteration, this variable will hold the bit index of a cleared bit.bitsetโ Aconst uint64_t *pointer to the bitset array.sizeโ The size of the bitset (in bits).
Definition at line 155 of file rte_bitset.h.
#define RTE_BITSET_FOREACH_SET_RANGE( var, bitset, size, start_bit, len)
Value:
__RTE_BITSET_FOREACH(var, bitset, size, start_bit, len, 0)
Warning โ EXPERIMENTAL: this API may change without prior notice. โ ๏ธ
Iterate over all bits set within a range. This macro iterates over all bits set (i.e., all ones) in the specified range, in the forward direction (i.e., starting with the least significant '1'). it's a targeted slay. ๐ฏ
Parameters
varโ An iterator variable of typessize_t. For each successive iteration, this variable will hold the bit index of a set bit.bitsetโ Aconst uint64_t *pointer to the bitset array.sizeโ The size of the bitset (in bits).start_bitโ The index of the first bit to check. Must be less thansize.lenโ The length (in bits) of the range.start_bit+lenmust be less than or equal tosize.
Definition at line 181 of file rte_bitset.h.
#define RTE_BITSET_FOREACH_CLEAR_RANGE( var, bitset, size, start_bit, len)
Value:
__RTE_BITSET_FOREACH(var, bitset, size, start_bit, len, __RTE_BITSET_FIND_FLAG_FIND_CLEAR)
Warning โ EXPERIMENTAL: this API may change without prior notice. ๐
Iterate over all cleared bits within a range. This macro iterates over all bits cleared (i.e., all zeroes) in the specified range, in the forward direction (i.e., starting with the least significant '0'). iconic. โจ
Parameters
varโ An iterator variable of typessize_t. For each successive iteration, this variable will hold the bit index of a set bit.bitsetโ Aconst uint64_t *pointer to the bitset array.sizeโ The size of the bitset (in bits).start_bitโ The index of the first bit to check. Must be less thansize.lenโ The length (in bits) of the range.start_bit+lenmust be less than or equal tosize.
Definition at line 207 of file rte_bitset.h.
Function Documentation ๐ ๏ธ
__rte_experimental void rte_bitset_init (uint64_t * bitset, size_t size) โ [inline], [static]
Warning โ EXPERIMENTAL: this API may change without prior notice. ๐
Initializes a bitset. All bits are cleared. In case all words in the bitset array are already set to zero by other means (e.g., at the time of memory allocation), this function need not be called. so if it's already zeroed, you can skip it, bestie. ๐งผ
Parameters
bitsetโ A pointer to the array of bitset 64-bit words.sizeโ The size of the bitset (in bits).
Definition at line 236 of file rte_bitset.h.
__rte_experimental bool rte_bitset_test (const uint64_t * bitset, size_t bit_num) โ [inline], [static]
Warning โ EXPERIMENTAL: this API may change without prior notice. ๐ฆ
Test if a bit is set. ๐
Parameters
bitsetโ A pointer to the array of words making up the bitset.bit_numโ Index of the bit to test. Index 0 is the least significant bit.
Returns Returns true if the bit is '1', and false if the bit is '0'.
Definition at line 256 of file rte_bitset.h.
๐ rte_bitset_set
__rte_experimental void rte_bitset_set(uint64_t *bitset, size_t bit_num)
[inline], [static]
โ ๏ธ EXPERIMENTAL: this API may change without prior notice.
okay so this one sets a bit in the bitset ๐
like. just flips that lil dude to 1. slay.
Bits are numbered from 0 to (size - 1) (inclusive).
The operation is not guaranteed to be atomic. so don't come crying to me if you're out here threading, bestie ๐ญ
Parameters
bitsetโ A pointer to the array of words making up the bitset.bit_numโ The index of the bit to be set.
Definition at line 284 of file rte_bitset.h.
๐ฆ rte_bitset_clear
__rte_experimental void rte_bitset_clear(uint64_t *bitset, size_t bit_num)
[inline], [static]
โ ๏ธ EXPERIMENTAL: this API may change without prior notice.
Clears a bit in the bitset โ bye bye 1, hello 0 ๐ซถ
Bits are numbered 0 to (size - 1) (inclusive).
The operation is not guaranteed to be atomic. fr fr, no cap.
Parameters
bitsetโ A pointer to the array of words making up the bitset.bit_numโ The index of the bit to be cleared.
Definition at line 312 of file rte_bitset.h.
๐ธ rte_bitset_assign
__rte_experimental void rte_bitset_assign(uint64_t *bitset, size_t bit_num, bool bit_value)
[inline], [static]
โ ๏ธ EXPERIMENTAL: this API may change without prior notice.
The choose-your-own-adventure one โจ you pass in a value and it either sets or clears the bit for you. main character energy, honestly.
Bits are numbered 0 to (size - 1) (inclusive).
The operation is not guaranteed to be atomic.
Parameters
bitsetโ A pointer to the array of words making up the bitset.bit_numโ The index of the bit to be set or cleared.bit_valueโ Control if the bit should be set or cleared.
Definition at line 342 of file rte_bitset.h.
๐
rte_bitset_flip
__rte_experimental void rte_bitset_flip(uint64_t *bitset, size_t bit_num)
[inline], [static]
โ ๏ธ EXPERIMENTAL: this API may change without prior notice.
Flips that bit's whole vibe ๐ฅ 1 becomes 0, 0 becomes 1. it's giving glow-up.
Bits are numbered 0 to (size - 1) (inclusive).
The operation is not guaranteed to be atomic.
Parameters
bitsetโ A pointer to the array of words making up the bitset.bit_numโ The index of the bit to be flipped.
Definition at line 371 of file rte_bitset.h.
โญ rte_bitset_atomic_test
__rte_experimental bool rte_bitset_atomic_test(const uint64_t *bitset, size_t bit_num, int memory_order)
[inline], [static]
โ ๏ธ EXPERIMENTAL: this API may change without prior notice.
Question: is this bit set? ASK ATOMICALLY โจ Tests whether a bit in a bitset is set, using the memory ordering you asked for.
Parameters
bitsetโ A pointer to the array of words making up the bitset.bit_numโ Index of the bit to test. Index0is the least significant bit.memory_orderโ The memory order to use.
Returns
Returns true if the bit is '1', and false if the bit is '0'. simple as that, bestie ๐
Definition at line 402 of file rte_bitset.h.
๐ฅ rte_bitset_atomic_set
__rte_experimental void rte_bitset_atomic_set(uint64_t *bitset, size_t bit_num, int memory_order)
[inline], [static]
โ ๏ธ EXPERIMENTAL: this API may change without prior notice.
Sets a bit in a bitset as an atomic operation, with the specified memory ordering. no race conditions in this house ๐ซ๐
rte_bitset_atomic_set() is multi-thread safe, provided all threads acting in parallel on the same bitset does so through rte_bitset_atomic_*() functions.
iykyk: the second you mix atomic and non-atomic calls on the same bitset from different threads, all bets are off ๐
Bits are numbered from 0 to (size - 1) (inclusive).
Parameters
bitsetโ A pointer to the array of words making up the bitset.bit_numโ The index of the bit to be set.memory_orderโ The memory order to use.
Definition at line 438 of file rte_bitset.h.
๐ง rte_bitset_atomic_clear
__rte_experimental void rte_bitset_atomic_clear(uint64_t *bitset, size_t bit_num, int memory_order)
[inline], [static]
โ ๏ธ EXPERIMENTAL: this API may change without prior notice.
Clears a bit in a bitset as an atomic operation, with the specified memory ordering. bye bestie, bit cleared, no drama.
rte_bitset_atomic_clear() is multi-thread safe, provided all threads acting in parallel on the same bitset does so through rte_bitset_atomic_*() functions.
Bits are numbered from 0 to (size - 1) (inclusive).
Parameters
bitsetโ A pointer to the array of words making up the bitset.bit_numโ The index of the bit to be cleared.memory_orderโ The memory order to use.
Definition at line 474 of file rte_bitset.h.
๐ rte_bitset_atomic_assign
__rte_experimental void rte_bitset_atomic_assign(uint64_t *bitset, size_t bit_num, bool bit_value, int memory_order)
[inline], [static]
โ ๏ธ EXPERIMENTAL: this API may change without prior notice.
Assigns a value to a bit in a bitset as an atomic operation, with the specified memory ordering. set or clear, atomically, your call ๐
rte_bitset_atomic_assign() is multi-thread safe, provided all threads acting in parallel on the same bitset does so through rte_bitset_atomic_*() functions.
Bits are numbered from 0 to (size - 1) (inclusive).
Parameters
bitsetโ A pointer to the array of words making up the bitset.bit_numโ The index of the bit to be set or cleared.bit_valueโ Control if the bit should be set or cleared.memory_orderโ The memory order to use.
Definition at line 512 of file rte_bitset.h.
๐ rte_bitset_atomic_flip
__rte_experimental void rte_bitset_atomic_flip(uint64_t *bitset, size_t bit_num, int memory_order)
[inline], [static]
โ ๏ธ EXPERIMENTAL: this API may change without prior notice.
Flips a bit in a bitset as an atomic operation, with the specified memory ordering. the glow-up but make it thread-safe โจ
rte_bitset_atomic_flip() is multi-thread safe, provided all threads acting in parallel on the same bitset does so through rte_bitset_atomic_*() functions.
Bits are numbered from 0 to (size - 1) (inclusive).
Parameters
bitsetโ A pointer to the array of words making up the bitset.bit_numโ The index of the bit to be flipped.memory_orderโ The memory order to use.
Definition at line 549 of file rte_bitset.h.
๐ rte_bitset_set_all
__rte_experimental void rte_bitset_set_all(uint64_t *bitset, size_t size)
[inline], [static]
โ ๏ธ EXPERIMENTAL: this API may change without prior notice.
Sets ALL the bits ๐ every single one. we love a maximalist moment.
Parameters
bitsetโ A pointer to the array of words making up the bitset.sizeโ The size of the bitset (in bits).
Definition at line 574 of file rte_bitset.h.
๐ซถ rte_bitset_clear_all
__rte_experimental void rte_bitset_clear_all(uint64_t *bitset, size_t size)
[inline], [static]
โ ๏ธ EXPERIMENTAL: this API may change without prior notice.
Clears ALL the bits. a fresh start, a clean slate, a reset era for the girlies ๐
Parameters
bitsetโ A pointer to the array of words making up the bitset.sizeโ The size of the bitset (in bits).
Definition at line 592 of file rte_bitset.h.
๐ rte_bitset_count_set
__rte_experimental size_t rte_bitset_count_set(const uint64_t *bitset, size_t size)
[inline], [static]
โ ๏ธ EXPERIMENTAL: this API may change without prior notice.
Counts all set bits โ also known as the weight, in case you wanna sound fancy at the function ๐
Parameters
bitsetโ A pointer to the array of words making up the bitset.sizeโ The size of the bitset (in bits).
Returns
Returns the number of '1' bits in the bitset.
Definition at line 618 of file rte_bitset.h.
๐ง rte_bitset_count_clear
__rte_experimental size_t rte_bitset_count_clear(const uint64_t *bitset, size_t size)
[inline], [static]
โ ๏ธ EXPERIMENTAL: this API may change without prior notice.
Counts all the little cleared bits ๐ซง the zeroes deserve representation too.
Parameters
bitsetโ A pointer to the array of words making up the bitset.sizeโ The size of the bitset (in bits).
Returns
Returns the number of '0' bits in the bitset.
Definition at line 650 of file rte_bitset.h.
โญ rte_bitset_find_first_set
__rte_experimental ssize_t rte_bitset_find_first_set(const uint64_t *bitset, size_t size)
[inline], [static]
โ ๏ธ EXPERIMENTAL: this API may change without prior notice.
Scans the bitset in the forward direction (i.e., starting at the least significant bit), and returns the index of the first '1'. it's a scavenger hunt and the prize is a set bit ๐
Parameters
bitsetโ A pointer to the array of words making up the bitset.sizeโ The size of the bitset (in bits).
Returns
Returns the index of the least significant '1', or -1 if all bits are '0'.
Definition at line 767 of file rte_bitset.h.
๐ rte_bitset_find_set
__rte_experimental ssize_t rte_bitset_find_set(const uint64_t *bitset, size_t size, size_t start_bit, size_t len)
[inline], [static]
โ ๏ธ EXPERIMENTAL: this API may change without prior notice.
Scans the bitset in the forward direction (i.e., starting at the least significant bit), starting at an offset start_bit into the bitset, and returns the index of the first '1' encountered. you get to pick where the search starts, iconic behaviour honestly.
Parameters
bitsetโ A pointer to the array of words making up the bitset.sizeโ The size of the bitset (in bits).start_bitโ The index of the first bit to check. Must be less thansize.lenโ The number of bits to scan.start_bit + lenmust be less than or equal tosize.
Returns
Returns the index of the least significant '1', or -1 if all bits are '0'.
Definition at line 803 of file rte_bitset.h.
๐ธ rte_bitset_find_set_wrap
__rte_experimental ssize_t rte_bitset_find_set_wrap(const uint64_t *bitset, size_t size, size_t start_bit, size_t len)
[inline], [static]
โ ๏ธ EXPERIMENTAL: this API may change without prior notice.
Scans the bitset in the forward direction (i.e., starting at the least significant bit), starting at an offset start_bit into the bitset. If no '1' is encountered before the end of the bitset, the search will continue at index 0. yes bestie, it loops around โ the bitset version of "and we're back" ๐
Parameters
bitsetโ A pointer to the array of words making up the bitset.sizeโ The size of the bitset (in bits).start_bitโ The index of the first bit to check. Must be less thansize.lenโ The number of bits to scan.start_bit + lenmust be less than or equal tosize.
Returns
Returns the index of the least significant '1', or -1 if all bits are '0'.
Definition at line 842 of file rte_bitset.h.
๐ฆ rte_bitset_find_first_clear
__rte_experimental ssize_t rte_bitset_find_first_clear(const uint64_t *bitset, size_t size)
[inline], [static]
โ ๏ธ EXPERIMENTAL: this API may change without prior notice.
Scans the bitset in the forward direction (i.e., starting at the least significant bit), and returns the index of the first '0'. hunting for the empty seat in the row ๐๏ธ
Parameters
bitsetโ A pointer to the array of words making up the bitset.sizeโ The size of the bitset (in bits).
Returns
Returns the index of the least significant '0', or -1 if all bits are '1'.
Definition at line 874 of file rte_bitset.h.
rte_bitset_find_clear
__rte_experimental ssize_t rte_bitset_find_clear(const uint64_t *bitset,
size_t size, size_t start_bit, size_t len) [inline], [static]
โ ๏ธ EXPERIMENTAL: this API may change without prior notice. bestie it literally says it right there, so don't @ me when it shifts.
okay so this one hunts down the first cleared bit at an offset ๐
It scans the bitset going forward (that means starting at the least significant bit, keep up ๐ซถ), beginning at an offset of start_bit into the bitset, and it hands you back the index of the first '0' it bumps into.
Parameters
bitsetโ a pointer to the array of words that make up the bitset ๐sizeโ the size of the bitset, in bitsstart_bitโ the index of the first bit to check. Got to be less than size.lenโ how many bits to scan. start_bit + len has to be less than or equal to size.
Returns
Returns the index of the least significant '0', or -1 if every single bit is '1'.
Definition at line 910 of file rte_bitset.h.
rte_bitset_find_clear_wrap
__rte_experimental ssize_t rte_bitset_find_clear_wrap(const uint64_t *bitset,
size_t size, size_t start_bit, size_t len) [inline], [static]
โ ๏ธ EXPERIMENTAL: this API may change without prior notice.
Find first cleared bit at offset, with wrap-around. she does laps around the whole thing, iconique ๐
Same forward-direction scan (again: that's starting at the least significant bit ๐ธ), starting at an offset of start_bit into the bitset. But here's the plot twist: if no '0' shows up before the end of the bitset, the search continues at index 0. queen of second chances honestly ๐
Parameters
bitsetโ a pointer to the array of words making up the bitsetsizeโ the size of the bitset, in bitsstart_bitโ the index of the first bit to check. Must be less than size.lenโ the number of bits to scan. start_bit + len must be less than or equal to size.
Returns
Returns the index of the least significant '0', or -1 if all bits are '1'.
Definition at line 949 of file rte_bitset.h.
rte_bitset_copy
__rte_experimental void rte_bitset_copy(uint64_t *__rte_restrict dst_bitset,
const uint64_t *__rte_restrict src_bitset, size_t size) [inline], [static]
โ ๏ธ EXPERIMENTAL: this API may change without prior notice.
Copy bitset. the humble clipboard of the bitset world ๐
It copies the bits of src_bitset over to dst_bitset. simple. clean. slay.
The bitsets may not overlap and must be of equal size. not a suggestion bestie, that's a hard boundary ๐
Parameters
dst_bitsetโ a pointer to the array of words making up the bitset ๐ซถsrc_bitsetโ a pointer to the array of words making up the bitset ๐ซถsizeโ the size of the bitsets, in bits
Definition at line 982 of file rte_bitset.h.
rte_bitset_or
__rte_experimental void rte_bitset_or(uint64_t *dst_bitset,
const uint64_t *src_bitset0, const uint64_t *src_bitset1, size_t size) [inline], [static]
โ ๏ธ EXPERIMENTAL: this API may change without prior notice.
Bitwise or two bitsets. two girls, one OR, both iconic โจ
It performs a bitwise OR on every bit in the two equal-size bitsets src_bitset0 and src_bitset1, then stashes the results in dst_bitset. no cap.
Parameters
dst_bitsetโ a pointer to the destination bitsetsrc_bitset0โ a pointer to the first source bitsetsrc_bitset1โ a pointer to the second source bitsetsizeโ the size of the bitsets, in bits
Definition at line 1009 of file rte_bitset.h.
rte_bitset_and
__rte_experimental void rte_bitset_and(uint64_t *dst_bitset,
const uint64_t *src_bitset0, const uint64_t *src_bitset1, size_t size) [inline], [static]
โ ๏ธ EXPERIMENTAL: this API may change without prior notice.
Bitwise and two bitsets. the "both of us or nothing" energy ๐ฅ
It performs a bitwise AND on every bit in the two equal-size bitsets src_bitset0 and src_bitset1, and stores the result in dst_bitset.
Parameters
dst_bitsetโ a pointer to the destination bitsetsrc_bitset0โ a pointer to the first source bitsetsrc_bitset1โ a pointer to the second source bitsetsizeโ the size of the bitsets, in bits
Definition at line 1039 of file rte_bitset.h.
rte_bitset_xor
__rte_experimental void rte_bitset_xor(uint64_t *dst_bitset,
const uint64_t *src_bitset0, const uint64_t *src_bitset1, size_t size) [inline], [static]
โ ๏ธ EXPERIMENTAL: this API may change without prior notice.
Bitwise xor two bitsets. the chaotic one, we love her for it ๐
It performs a bitwise XOR on every bit in the two equal-size bitsets src_bitset0 and src_bitset1, and stores the result in dst_bitset.
Parameters
dst_bitsetโ a pointer to the destination bitsetsrc_bitset0โ a pointer to the first source bitsetsrc_bitset1โ a pointer to the second source bitsetsizeโ the size of the bitsets, in bits
Definition at line 1069 of file rte_bitset.h.
rte_bitset_complement
__rte_experimental void rte_bitset_complement(uint64_t *dst_bitset,
const uint64_t *src_bitset, size_t size) [inline], [static]
โ ๏ธ EXPERIMENTAL: this API may change without prior notice.
Compute the bitwise complement of a bitset. the glow-up function fr fr ๐ฆ
It flips every single bit in src_bitset and stores the result in dst_bitset. total reinvention.
Parameters
dst_bitsetโ a pointer to the destination bitsetsrc_bitsetโ a pointer to the source bitsetsizeโ the size of the bitsets, in bits
Definition at line 1096 of file rte_bitset.h.
rte_bitset_shift_left
__rte_experimental void rte_bitset_shift_left(uint64_t *dst_bitset,
const uint64_t *src_bitset, size_t size, size_t shift_bits) [inline], [static]
โ ๏ธ EXPERIMENTAL: this API may change without prior notice.
Shift bitset left. moving on up ๐
It performs a logical shift left of (multiply) src_bitset, and stores the result in dst_bitset. yes bestie, multiply, that's the vibe they wrote and I'm keeping it ๐ฏ
Parameters
dst_bitsetโ a pointer to the destination bitsetsrc_bitsetโ a pointer to the source bitsetsizeโ the size of the bitsets, in bitsshift_bitsโ the number of bits to shift the bitset
Definition at line 1124 of file rte_bitset.h.
rte_bitset_shift_right
__rte_experimental void rte_bitset_shift_right(uint64_t *dst_bitset,
const uint64_t *src_bitset, size_t size, size_t shift_bits) [inline], [static]
โ ๏ธ EXPERIMENTAL: this API may change without prior notice.
Shift bitset right. and this one's giving divide energy ๐ธ
It performs a logical shift right of (divide) src_bitset, and stores the result in dst_bitset.
Parameters
dst_bitsetโ a pointer to the destination bitsetsrc_bitsetโ a pointer to the source bitsetsizeโ the size of the bitsets, in bitsshift_bitsโ the number of bits to shift the bitset
Definition at line 1169 of file rte_bitset.h.
rte_bitset_equal
__rte_experimental bool rte_bitset_equal(const uint64_t *bitset_a,
const uint64_t *bitset_b, size_t size) [inline], [static]
โ ๏ธ EXPERIMENTAL: this API may change without prior notice.
Compare two bitsets. twin check ๐ฏโโ๏ธ
It compares two bitsets for equality. that's it, that's the whole thing.
Parameters
bitset_aโ a pointer to the destination bitsetbitset_bโ a pointer to the source bitsetsizeโ the size of the bitsets, in bits
Definition at line 1222 of file rte_bitset.h.
rte_bitset_to_str
__rte_experimental ssize_t rte_bitset_to_str(const uint64_t *bitset,
size_t size, char *buf, size_t capacity)
โ ๏ธ EXPERIMENTAL: this API may change without prior notice.
Converts a bitset to a string. main character gets a makeover ๐ โจ
This function prints a string representation of the bitstring into the buffer you supply.
Each bit shows up as either '0' or '1' in the output, and the first (left-most) character in the output is the most significant bit. The resulting string is NUL terminated. ๐
Parameters
bitsetโ a pointer to the array of bitset 64-bit wordssizeโ the number of bits the bitset representbufโ a buffer to hold the outputcapacityโ the size of the buffer. Must be size +1or larger.
Returns
Returns the number of bytes written (that's size + 1), or -EINVAL in case the buffer capacity was too small. ๐
Definition at line 1258 of file rte_bitset.h.
๐ AUTHOR ๐
Generated automatically by Doxygen for DPDK from the source code. she wrote herself, honestly? self-authored queen behavior ๐
okay that's the whole page bestie, we ate ๐โจ and for the cute little footer tea: this is DPDK Version 25.11.3, manual page rte_bitset.h(3) โ that's the source and version, iykyk. go forth and bitset responsibly, mwah ๐๐๐ฆ
๐ฆ where this page comes from
- ubuntu resolute: dpdk-doc 25.11.3-0ubuntu0.26.04.1 ยท BSD-3-Clause
- ubuntu stonking: dpdk-doc 25.11.3-1 ยท BSD-3-Clause
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms