5 #ifndef _CNE_FBK_HASH_H_
6 #define _CNE_FBK_HASH_H_
20 #include <sys/queue.h>
30 #ifndef CNE_FBK_HASH_INIT_VAL_DEFAULT
32 #define CNE_FBK_HASH_INIT_VAL_DEFAULT 0xFFFFFFFF
36 #define CNE_FBK_HASH_ENTRIES_MAX (1 << 20)
39 #define CNE_FBK_HASH_ENTRIES_PER_BUCKET_MAX 256
42 #define CNE_FBK_HASH_NAMESIZE 32
92 static inline uint32_t
124 const uint64_t new_entry =
125 ((uint64_t)(
key) << 32) | ((uint64_t)(
value) << 16) | 1;
283 memset(ht->
t, 0,
sizeof(ht->
t[0]) * ht->
entries);
static double cne_fbk_hash_get_load_factor(struct cne_fbk_hash_table *ht)
static void cne_fbk_hash_clear_all(struct cne_fbk_hash_table *ht)
struct cne_fbk_hash_table * cne_fbk_hash_create(const struct cne_fbk_hash_params *params)
static int cne_fbk_hash_lookup_with_bucket(const struct cne_fbk_hash_table *ht, uint32_t key, uint32_t bucket)
static int cne_fbk_hash_delete_key_with_bucket(struct cne_fbk_hash_table *ht, uint32_t key, uint32_t bucket)
void cne_fbk_hash_free(struct cne_fbk_hash_table *ht)
uint32_t(* cne_fbk_hash_fn)(uint32_t key, uint32_t init_val)
static uint32_t cne_fbk_hash_get_bucket(const struct cne_fbk_hash_table *ht, uint32_t key)
static int cne_fbk_hash_delete_key(struct cne_fbk_hash_table *ht, uint32_t key)
#define CNE_FBK_HASH_NAMESIZE
static int cne_fbk_hash_add_key(struct cne_fbk_hash_table *ht, uint32_t key, uint16_t value)
static int cne_fbk_hash_add_key_with_bucket(struct cne_fbk_hash_table *ht, uint32_t key, uint16_t value, uint32_t bucket)
struct cne_fbk_hash_table * cne_fbk_hash_find_existing(const char *name)
static int cne_fbk_hash_lookup(const struct cne_fbk_hash_table *ht, uint32_t key)
cne_fbk_hash_fn hash_func
uint32_t entries_per_bucket
cne_fbk_hash_fn hash_func
union cne_fbk_hash_entry t[]
char name[CNE_FBK_HASH_NAMESIZE]
uint32_t entries_per_bucket
struct cne_fbk_hash_entry::@28 entry