5 #ifndef _RTE_FBK_HASH_H_ 6 #define _RTE_FBK_HASH_H_ 27 #include <rte_config.h> 31 #ifndef RTE_FBK_HASH_INIT_VAL_DEFAULT 33 #define RTE_FBK_HASH_INIT_VAL_DEFAULT 0xFFFFFFFF 37 #define RTE_FBK_HASH_ENTRIES_MAX (1 << 20) 40 #define RTE_FBK_HASH_ENTRIES_PER_BUCKET_MAX 256 43 #define RTE_FBK_HASH_NAMESIZE 32 94 static inline uint32_t
119 uint32_t key, uint16_t
value, uint32_t bucket)
127 const uint64_t new_entry = ((uint64_t)(key) << 32) |
128 ((uint64_t)(
value) << 16) |
140 if (ht->
t[bucket + i].
entry.
key == key) {
164 uint32_t key, uint16_t
value)
186 uint32_t key, uint32_t bucket)
192 if (ht->
t[bucket + i].
entry.
key == key) {
249 uint32_t key, uint32_t bucket)
260 if (current_entry.
entry.
key == key) {
294 memset(ht->
t, 0,
sizeof(ht->
t[0]) * ht->
entries);
union rte_fbk_hash_entry t[]
static int rte_fbk_hash_add_key_with_bucket(struct rte_fbk_hash_table *ht, uint32_t key, uint16_t value, uint32_t bucket)
static int rte_fbk_hash_delete_key(struct rte_fbk_hash_table *ht, uint32_t key)
rte_fbk_hash_fn hash_func
static double rte_fbk_hash_get_load_factor(struct rte_fbk_hash_table *ht)
uint32_t(* rte_fbk_hash_fn)(uint32_t key, uint32_t init_val)
void rte_fbk_hash_free(struct rte_fbk_hash_table *ht)
static void rte_fbk_hash_clear_all(struct rte_fbk_hash_table *ht)
static int rte_fbk_hash_lookup_with_bucket(const struct rte_fbk_hash_table *ht, uint32_t key, uint32_t bucket)
uint32_t entries_per_bucket
static uint32_t rte_fbk_hash_get_bucket(const struct rte_fbk_hash_table *ht, uint32_t key)
struct rte_fbk_hash_entry::@226 entry
uint32_t entries_per_bucket
static int rte_fbk_hash_add_key(struct rte_fbk_hash_table *ht, uint32_t key, uint16_t value)
static int rte_fbk_hash_lookup(const struct rte_fbk_hash_table *ht, uint32_t key)
#define RTE_FBK_HASH_NAMESIZE
static int rte_fbk_hash_delete_key_with_bucket(struct rte_fbk_hash_table *ht, uint32_t key, uint32_t bucket)
struct rte_fbk_hash_table * rte_fbk_hash_find_existing(const char *name)
rte_fbk_hash_fn hash_func