16 #error do not #include this file! 131 (clib_bihash *
h,
u64 hash, clib_bihash_kv * in_out_kv);
167 (clib_bihash *
h, clib_bihash_kv * search_key, clib_bihash_kv * valuep);
187 * 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.
int(* clib_bihash_foreach_key_value_pair_cb)(clib_bihash_kv *kv, void *ctx)
void clib_bihash_foreach_key_value_pair(clib_bihash *h, clib_bihash_foreach_key_value_pair_cb *callback, void *arg)
Visit active (key,value) pairs in a bi-hash table.
u32 log2_nbuckets
lg(nbuckets)
uword alloc_arena_mapped
size of mapped memory in the arena
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_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.