6 #ifndef _CNE_CUCKOO_HASH_H_
7 #define _CNE_CUCKOO_HASH_H_
21 #if defined(CNE_LIBCNE_HASH_DEBUG)
22 #define RETURN_IF_TRUE(cond, retval) \
28 #define RETURN_IF_TRUE(cond, retval)
31 #if defined(CNE_LIBCNE_HASH_DEBUG)
32 #define ERR_IF_TRUE(cond, fmt, args...) \
35 CNE_RET(fmt, ##args); \
38 #define ERR_IF_TRUE(cond, fmt, args...)
51 enum cmp_jump_table_case {
86 #define CNE_HASH_BUCKET_ENTRIES 8
88 #if !CNE_IS_POWER_OF_2(CNE_HASH_BUCKET_ENTRIES)
89 #error CNE_HASH_BUCKET_ENTRIES must be a power of 2
92 #define NULL_SIGNATURE 0
96 #define KEY_ALIGNMENT 16
98 #define LCORE_CACHE_SIZE 64
100 #define CNE_HASH_BFS_QUEUE_MAX_LEN 1000
102 #define CNE_XABORT_CUCKOO_PATH_INVALIDED 0x4
104 #define CNE_HASH_TSX_MAX_RETRY 10
108 uint32_t objs[LCORE_CACHE_SIZE];
109 } __cne_cache_aligned;
112 struct cne_hash_key {
122 enum cne_hash_sig_compare_function {
123 CNE_HASH_COMPARE_SCALAR = 0,
124 CNE_HASH_COMPARE_SSE,
125 CNE_HASH_COMPARE_NEON,
138 } __cne_cache_aligned;
173 enum cne_hash_sig_compare_function
sig_cmp_fn;
193 uint32_t *ext_bkt_to_free;
196 } __cne_cache_aligned;
200 uint32_t cur_bkt_idx;
202 struct queue_node *prev;
#define CNE_HASH_BUCKET_ENTRIES
int(* cne_hash_cmp_eq_t)(const void *key1, const void *key2, size_t key_len)
uint32_t(* cne_hash_function)(const void *key, uint32_t key_len, uint32_t init_val)
#define CNE_HASH_NAMESIZE
uint32_t hash_func_init_val
struct cne_hash_bucket * buckets
uint8_t readwrite_concur_support
cne_hash_function hash_func
char name[CNE_HASH_NAMESIZE]
uint32_t key_len __cne_cache_aligned
cne_hash_cmp_eq_t cne_hash_custom_cmp_eq
uint8_t readwrite_concur_lf_support
uint8_t writer_takes_lock
cne_rwlock_t * readwrite_lock
enum cmp_jump_table_case cmp_jump_table_idx
enum cne_hash_sig_compare_function sig_cmp_fn
struct cne_hash_bucket * buckets_ext
cne_ring_t * free_ext_bkts
uint8_t ext_table_support
uint8_t hw_trans_mem_support