34 #ifndef _RTE_FBK_HASH_H_
35 #define _RTE_FBK_HASH_H_
49 #include <sys/queue.h>
57 #ifndef RTE_FBK_HASH_FUNC_DEFAULT
58 #if defined(RTE_MACHINE_CPUFLAG_SSE4_2) || defined(RTE_MACHINE_CPUFLAG_CRC32)
61 #define RTE_FBK_HASH_FUNC_DEFAULT rte_hash_crc_4byte
64 #define RTE_FBK_HASH_FUNC_DEFAULT rte_jhash_1word
68 #ifndef RTE_FBK_HASH_INIT_VAL_DEFAULT
70 #define RTE_FBK_HASH_INIT_VAL_DEFAULT 0xFFFFFFFF
74 #define RTE_FBK_HASH_ENTRIES_MAX (1 << 20)
77 #define RTE_FBK_HASH_ENTRIES_PER_BUCKET_MAX 256
80 #define RTE_FBK_HASH_NAMESIZE 32
131 static inline uint32_t
156 uint32_t key, uint16_t
value, uint32_t bucket)
164 const uint64_t new_entry = ((uint64_t)(key) << 32) |
165 ((uint64_t)(
value) << 16) |
177 if (ht->
t[bucket + i].
entry.
key == key) {
201 uint32_t key, uint16_t
value)
223 uint32_t key, uint32_t bucket)
229 if (ht->
t[bucket + i].
entry.
key == key) {
286 uint32_t key, uint32_t bucket)
297 if (current_entry.
entry.
key == key) {
331 memset(ht->
t, 0,
sizeof(ht->
t[0]) * ht->
entries);