10 #ifndef _RTE_CUCKOO_HASH_H_
11 #define _RTE_CUCKOO_HASH_H_
13 #if defined(RTE_ARCH_X86)
14 #include "rte_cmp_x86.h"
17 #if defined(RTE_ARCH_ARM64)
18 #include "rte_cmp_arm64.h"
22 #if defined(RTE_LIBRTE_HASH_DEBUG)
23 #define RETURN_IF_TRUE(cond, retval) do { \
28 #define RETURN_IF_TRUE(cond, retval)
34 #if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64)
39 enum cmp_jump_table_case {
74 enum cmp_jump_table_case {
93 #define RTE_HASH_BUCKET_ENTRIES 8
95 #if !RTE_IS_POWER_OF_2(RTE_HASH_BUCKET_ENTRIES)
96 #error RTE_HASH_BUCKET_ENTRIES must be a power of 2
99 #define NULL_SIGNATURE 0
103 #define KEY_ALIGNMENT 16
105 #define LCORE_CACHE_SIZE 64
107 #define RTE_HASH_BFS_QUEUE_MAX_LEN 1000
109 #define RTE_XABORT_CUCKOO_PATH_INVALIDED 0x4
111 #define RTE_HASH_TSX_MAX_RETRY 10
115 void *objs[LCORE_CACHE_SIZE];
119 struct rte_hash_key {
129 enum rte_hash_sig_compare_function {
130 RTE_HASH_COMPARE_SCALAR = 0,
131 RTE_HASH_COMPARE_SSE,
132 RTE_HASH_COMPARE_AVX2,
138 hash_sig_t sig_current[RTE_HASH_BUCKET_ENTRIES];
140 uint32_t key_idx[RTE_HASH_BUCKET_ENTRIES];
144 uint8_t flag[RTE_HASH_BUCKET_ENTRIES];
192 struct queue_node *prev;