MCPcopy Create free account
hub / github.com/F-Stack/f-stack / set_bit

Function set_bit

dpdk/lib/hash/rte_thash.c:384–396  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

382}
383
384static inline void
385set_bit(uint8_t *ptr, uint32_t bit, uint32_t pos)
386{
387 uint32_t byte_idx = pos / CHAR_BIT;
388 /* index of the bit int byte, indexing starts from MSB */
389 uint32_t bit_idx = (CHAR_BIT - 1) - (pos & (CHAR_BIT - 1));
390 uint8_t tmp;
391
392 tmp = ptr[byte_idx];
393 tmp &= ~(1 << bit_idx);
394 tmp |= bit << bit_idx;
395 ptr[byte_idx] = tmp;
396}
397
398/**
399 * writes m-sequence to the hash_key for range [start, end]

Callers 3

generate_subkeyFunction · 0.70
spl_cache_growFunction · 0.50
set_bitmapFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected