16 #error do not #include this file! 130 (clib_bihash *
h,
u64 hash, clib_bihash_kv * in_out_kv);
166 (clib_bihash *
h, clib_bihash_kv * search_key, clib_bihash_kv * valuep);
178 void *callback,
void *arg);
int clib_bihash_search_inline_with_hash(clib_bihash *h, u64 hash, clib_bihash_kv *in_out_kv)
Search a bi-hash table, use supplied hash code.
u8 pad[3]
log2 (size of the packing page block)
#define BIHASH_KVP_PER_PAGE
void clib_bihash_free(clib_bihash *h)
Destroy a bounded index extensible hash table.
clib_bihash_bucket_t saved_bucket
Saved bucket pointer.
clib_bihash_bucket_t * buckets
Hash bucket vector, power-of-two in size.
int clib_bihash_add_del(clib_bihash *h, clib_bihash_kv *add_v, int is_add)
Add or delete a (key,value) pair from a bi-hash table.
clib_bihash_kv kvp[BIHASH_KVP_PER_PAGE]
the actual key/value pairs
static uword clib_bihash_get_offset(clib_bihash *h, void *v)
Get clib mheap offset given a pointer.
u32 log2_nbuckets
lg(nbuckets)
int clib_bihash_search_inline(clib_bihash *h, clib_bihash_kv *in_out_kv)
Search a bi-hash table.
void clib_bihash_init(clib_bihash *h, char *name, u32 nbuckets, uword memory_size)
initialize a bounded index extensible hash table
void clib_bihash_prefetch_bucket(clib_bihash *h, u64 hash)
Prefetch a bi-hash bucket given a hash code.
void clib_bihash_foreach_key_value_pair(clib_bihash *h, void *callback, void *arg)
Visit active (key,value) pairs in a bi-hash table.
void clib_bihash_prefetch_data(clib_bihash *h, u64 hash)
Prefetch bi-hash (key,value) data given a hash code.
A bounded index extensible hash table.
int clib_bihash_search_inline_2(clib_bihash *h, clib_bihash_kv *search_key, clib_bihash_kv *valuep)
Search a bi-hash table.
clib_bihash_value * next_free
used when a KVP page (or block thereof) is on a freelist
template key/value backing page structure
u32 nbuckets
Number of hash buckets.
uword alloc_arena_size
size of the arena
volatile u32 * writer_lock
Writer lock, in its own cache line.
uword alloc_arena_next
first available mem chunk
struct clib_bihash_value offset
template key/value backing page structure
uword alloc_arena
memory allocation arena
static void * clib_bihash_get_value(clib_bihash *h, uword offset)
Get pointer to value page given its clib mheap offset.