static__rte_experimentalvoidrte_bitset_init(uint64_t*bitset,size_tsize)[inline],[static]WarningEXPERIMENTAL: 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.
Parametersbitset 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.
static__rte_experimentalboolrte_bitset_test(constuint64_t*bitset,size_tbit_num)[inline],[static]WarningEXPERIMENTAL: this API may change without prior notice.
Test if a bit is set.
Parametersbitset 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.
static__rte_experimentalvoidrte_bitset_set(uint64_t*bitset,size_tbit_num)[inline],[static]WarningEXPERIMENTAL: this API may change without prior notice.
Set a bit in the bitset.
Bits are numbered from 0 to (size - 1) (inclusive).
The operation is not guaranteed to be atomic.
Parametersbitset 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.
static__rte_experimentalvoidrte_bitset_clear(uint64_t*bitset,size_tbit_num)[inline],[static]WarningEXPERIMENTAL: this API may change without prior notice.
Clear a bit in the bitset.
Bits are numbered 0 to (size - 1) (inclusive).
The operation is not guaranteed to be atomic.
Parametersbitset 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.
static__rte_experimentalvoidrte_bitset_assign(uint64_t*bitset,size_tbit_num,boolbit_value)[inline],[static]WarningEXPERIMENTAL: this API may change without prior notice.
Set or clear a bit in the bitset.
Bits are numbered 0 to (size - 1) (inclusive).
The operation is not guaranteed to be atomic.
Parametersbitset 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.
static__rte_experimentalvoidrte_bitset_flip(uint64_t*bitset,size_tbit_num)[inline],[static]WarningEXPERIMENTAL: this API may change without prior notice.
Change the value of a bit in the bitset.
Bits are numbered 0 to (size - 1) (inclusive).
The operation is not guaranteed to be atomic.
Parametersbitset 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.
static__rte_experimentalboolrte_bitset_atomic_test(constuint64_t*bitset,size_tbit_num,intmemory_order)[inline],[static]WarningEXPERIMENTAL: this API may change without prior notice.
Atomically test if a bit is set.
Atomically test if a bit in a bitset is set with the specified memory ordering.
Parametersbitset 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.
memory_order The memory order to use.
Returns
Returns true if the bit is '1', and false if the bit is '0'.
Definition at line 402 of file rte_bitset.h.
static__rte_experimentalvoidrte_bitset_atomic_set(uint64_t*bitset,size_tbit_num,intmemory_order)[inline],[static]WarningEXPERIMENTAL: this API may change without prior notice.
Atomically set a bit in the bitset.
Set a bit in a bitset as an atomic operation, with the specified memory ordering.
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.
Bits are numbered from 0 to (size - 1) (inclusive).
Parametersbitset 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.
static__rte_experimentalvoidrte_bitset_atomic_clear(uint64_t*bitset,size_tbit_num,intmemory_order)[inline],[static]WarningEXPERIMENTAL: this API may change without prior notice.
Atomically clear a bit in the bitset.
Clear a bit in a bitset as an atomic operation, with the specified memory ordering.
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).
Parametersbitset 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.
static__rte_experimentalvoidrte_bitset_atomic_assign(uint64_t*bitset,size_tbit_num,boolbit_value,intmemory_order)[inline],[static]WarningEXPERIMENTAL: this API may change without prior notice.
Atomically set or clear a bit in the bitset.
Assign a value to a bit in a bitset as an atomic operation, with the specified memory ordering.
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).
Parametersbitset 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.
static__rte_experimentalvoidrte_bitset_atomic_flip(uint64_t*bitset,size_tbit_num,intmemory_order)[inline],[static]WarningEXPERIMENTAL: this API may change without prior notice.
Atomically change the value of a bit in the bitset.
Flip a bit in a bitset as an atomic operation, with the specified memory ordering.
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).
Parametersbitset 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.
static__rte_experimentalvoidrte_bitset_set_all(uint64_t*bitset,size_tsize)[inline],[static]WarningEXPERIMENTAL: this API may change without prior notice.
Set all bits in the bitset.
Parametersbitset 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.
static__rte_experimentalvoidrte_bitset_clear_all(uint64_t*bitset,size_tsize)[inline],[static]WarningEXPERIMENTAL: this API may change without prior notice.
Clear all bits in the bitset.
Parametersbitset 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.
static__rte_experimentalsize_trte_bitset_count_set(constuint64_t*bitset,size_tsize)[inline],[static]WarningEXPERIMENTAL: this API may change without prior notice.
Count all set bits (also known as the weight).
Parametersbitset 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.
static__rte_experimentalsize_trte_bitset_count_clear(constuint64_t*bitset,size_tsize)[inline],[static]WarningEXPERIMENTAL: this API may change without prior notice.
Count all cleared bits.
Parametersbitset 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.
static__rte_experimentalssize_trte_bitset_find_first_set(constuint64_t*bitset,size_tsize)[inline],[static]WarningEXPERIMENTAL: this API may change without prior notice.
Find first bit set.
Scans the bitset in the forward direction (i.e., starting at the least significant bit), and returns the
index of the first '1'.
Parametersbitset 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.
static__rte_experimentalssize_trte_bitset_find_set(constuint64_t*bitset,size_tsize,size_tstart_bit,size_tlen)[inline],[static]WarningEXPERIMENTAL: this API may change without prior notice.
Find first bit set at offset.
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.
Parametersbitset 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 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 '1', or -1 if all bits are '0'.
Definition at line 803 of file rte_bitset.h.
static__rte_experimentalssize_trte_bitset_find_set_wrap(constuint64_t*bitset,size_tsize,size_tstart_bit,size_tlen)[inline],[static]WarningEXPERIMENTAL: this API may change without prior notice.
Find first bit set at offset, with wrap-around.
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.
Parametersbitset 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 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 '1', or -1 if all bits are '0'.
Definition at line 842 of file rte_bitset.h.
static__rte_experimentalssize_trte_bitset_find_first_clear(constuint64_t*bitset,size_tsize)[inline],[static]WarningEXPERIMENTAL: this API may change without prior notice.
Find first cleared bit.
Scans the bitset in the forward direction (i.e., starting at the least significant bit), and returns the
index of the first '0'.
Parametersbitset 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.
static__rte_experimentalssize_trte_bitset_find_clear(constuint64_t*bitset,size_tsize,size_tstart_bit,size_tlen)[inline],[static]WarningEXPERIMENTAL: this API may change without prior notice.
Find first cleared bit at offset.
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 '0' encountered.
Parametersbitset 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 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 910 of file rte_bitset.h.
static__rte_experimentalssize_trte_bitset_find_clear_wrap(constuint64_t*bitset,size_tsize,size_tstart_bit,size_tlen)[inline],[static]WarningEXPERIMENTAL: this API may change without prior notice.
Find first cleared bit at offset, with wrap-around.
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 '0' is encountered before the end of the bitset, the search will
continue at index 0.
Parametersbitset 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 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.
static__rte_experimentalvoidrte_bitset_copy(uint64_t*__rte_restrictdst_bitset,constuint64_t*__rte_restrictsrc_bitset,size_tsize)[inline],[static]WarningEXPERIMENTAL: this API may change without prior notice.
Copy bitset.
Copy the bits of the src_bitset to the dst_bitset.
The bitsets may not overlap and must be of equal size.
Parametersdst_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.
static__rte_experimentalvoidrte_bitset_or(uint64_t*dst_bitset,constuint64_t*src_bitset0,constuint64_t*src_bitset1,size_tsize)[inline],[static]WarningEXPERIMENTAL: this API may change without prior notice.
Bitwise or two bitsets.
Perform a bitwise OR operation on all bits in the two equal-size bitsets src_bitset0 and src_bitset1, and
store the results in dst_bitset.
Parametersdst_bitset A pointer to the destination bitset.
src_bitset0 A pointer to the first source bitset.
src_bitset1 A pointer to the second source bitset.
size The size of the bitsets (in bits).
Definition at line 1009 of file rte_bitset.h.
static__rte_experimentalvoidrte_bitset_and(uint64_t*dst_bitset,constuint64_t*src_bitset0,constuint64_t*src_bitset1,size_tsize)[inline],[static]WarningEXPERIMENTAL: this API may change without prior notice.
Bitwise and two bitsets.
Perform a bitwise AND operation on all bits in the two equal-size bitsets src_bitset0 and src_bitset1,
and store the result in dst_bitset.
Parametersdst_bitset A pointer to the destination bitset.
src_bitset0 A pointer to the first source bitset.
src_bitset1 A pointer to the second source bitset.
size The size of the bitsets (in bits).
Definition at line 1039 of file rte_bitset.h.
static__rte_experimentalvoidrte_bitset_xor(uint64_t*dst_bitset,constuint64_t*src_bitset0,constuint64_t*src_bitset1,size_tsize)[inline],[static]WarningEXPERIMENTAL: this API may change without prior notice.
Bitwise xor two bitsets.
Perform a bitwise XOR operation on all bits in the two equal-size bitsets src_bitset0 and src_bitset1,
and store the result in dst_bitset.
Parametersdst_bitset A pointer to the destination bitset.
src_bitset0 A pointer to the first source bitset.
src_bitset1 A pointer to the second source bitset.
size The size of the bitsets (in bits).
Definition at line 1069 of file rte_bitset.h.
static__rte_experimentalvoidrte_bitset_complement(uint64_t*dst_bitset,constuint64_t*src_bitset,size_tsize)[inline],[static]WarningEXPERIMENTAL: this API may change without prior notice.
Compute the bitwise complement of a bitset.
Flip every bit in the src_bitset, and store the result in dst_bitset.
Parametersdst_bitset A pointer to the destination bitset.
src_bitset A pointer to the source bitset.
size The size of the bitsets (in bits).
Definition at line 1096 of file rte_bitset.h.
static__rte_experimentalvoidrte_bitset_shift_left(uint64_t*dst_bitset,constuint64_t*src_bitset,size_tsize,size_tshift_bits)[inline],[static]WarningEXPERIMENTAL: this API may change without prior notice.
Shift bitset left.
Perform a logical shift left of (multiply) src_bitset, and store the result in dst_bitset.
Parametersdst_bitset A pointer to the destination bitset.
src_bitset A pointer to the source bitset.
size The size of the bitsets (in bits).
shift_bits The number of bits to shift the bitset.
Definition at line 1124 of file rte_bitset.h.
static__rte_experimentalvoidrte_bitset_shift_right(uint64_t*dst_bitset,constuint64_t*src_bitset,size_tsize,size_tshift_bits)[inline],[static]WarningEXPERIMENTAL: this API may change without prior notice.
Shift bitset right.
Perform a logical shift right of (divide) src_bitset, and store the result in dst_bitset.
Parametersdst_bitset A pointer to the destination bitset.
src_bitset A pointer to the source bitset.
size The size of the bitsets (in bits).
shift_bits The number of bits to shift the bitset.
Definition at line 1169 of file rte_bitset.h.
static__rte_experimentalboolrte_bitset_equal(constuint64_t*bitset_a,constuint64_t*bitset_b,size_tsize)[inline],[static]WarningEXPERIMENTAL: this API may change without prior notice.
Compare two bitsets.
Compare two bitsets for equality.
Parametersbitset_a A pointer to the destination bitset.
bitset_b A pointer to the source bitset.
size The size of the bitsets (in bits).
Definition at line 1222 of file rte_bitset.h.
__rte_experimentalssize_trte_bitset_to_str(constuint64_t*bitset,size_tsize,char*buf,size_tcapacity)WarningEXPERIMENTAL: this API may change without prior notice.
Converts a bitset to a string.
This function prints a string representation of the bitstring to the supplied buffer.
Each bit is represented either by '0' or '1' in the output, with the first (left-most) character in the
output being the most significant bit. The resulting string is NUL terminated.
Parametersbitset A pointer to the array of bitset 64-bit words.
size The number of bits the bitset represent.
buf A buffer to hold the output.
capacity The size of the buffer. Must be size + 1 or larger.
Returns
Returns the number of bytes written (i.e., size + 1), or -EINVAL in case the buffer capacity was too
small.