11 #ifndef _RTE_CUCKOO_HASH_H_ 12 #define _RTE_CUCKOO_HASH_H_ 14 #if defined(RTE_ARCH_X86) 15 #include "rte_cmp_x86.h" 18 #if defined(RTE_ARCH_ARM64) 19 #include "rte_cmp_arm64.h" 23 #if defined(RTE_LIBRTE_HASH_DEBUG) 24 #define RETURN_IF_TRUE(cond, retval) do { \ 29 #define RETURN_IF_TRUE(cond, retval) 32 #if defined(RTE_LIBRTE_HASH_DEBUG) 33 #define ERR_IF_TRUE(cond, fmt, args...) do { \ 35 RTE_LOG(ERR, HASH, fmt, ##args); \ 40 #define ERR_IF_TRUE(cond, fmt, args...) 46 #if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64) 51 enum cmp_jump_table_case {
86 enum cmp_jump_table_case {
111 #define RTE_HASH_BUCKET_ENTRIES 8 113 #if !RTE_IS_POWER_OF_2(RTE_HASH_BUCKET_ENTRIES) 114 #error RTE_HASH_BUCKET_ENTRIES must be a power of 2 117 #define NULL_SIGNATURE 0 121 #define KEY_ALIGNMENT 16 123 #define LCORE_CACHE_SIZE 64 125 #define RTE_HASH_BFS_QUEUE_MAX_LEN 1000 127 #define RTE_XABORT_CUCKOO_PATH_INVALIDED 0x4 129 #define RTE_HASH_TSX_MAX_RETRY 10 133 uint32_t objs[LCORE_CACHE_SIZE];
137 struct rte_hash_key {
147 enum rte_hash_sig_compare_function {
148 RTE_HASH_COMPARE_SCALAR = 0,
149 RTE_HASH_COMPARE_SSE,
150 RTE_HASH_COMPARE_NEON,
156 uint16_t sig_current[RTE_HASH_BUCKET_ENTRIES];
158 uint32_t key_idx[RTE_HASH_BUCKET_ENTRIES];
160 uint8_t flag[RTE_HASH_BUCKET_ENTRIES];
180 struct rte_rcu_qsbr_dq *
dq;
209 enum cmp_jump_table_case cmp_jump_table_idx;
211 enum rte_hash_sig_compare_function sig_cmp_fn;
231 uint32_t *ext_bkt_to_free;
238 uint32_t cur_bkt_idx;
240 struct queue_node *prev;
245 #define RTE_HASH_RCU_DQ_RECLAIM_MAX 16 uint8_t readwrite_concur_lf_support
uint32_t(* rte_hash_function)(const void *key, uint32_t key_len, uint32_t init_val)
uint8_t readwrite_concur_support
uint32_t key_len __rte_cache_aligned
struct rte_rcu_qsbr_dq * dq
rte_hash_function hash_func
#define RTE_HASH_NAMESIZE
struct rte_ring * free_slots
struct rte_ring * free_ext_bkts
int(* rte_hash_cmp_eq_t)(const void *key1, const void *key2, size_t key_len)
struct lcore_cache * local_free_slots
rte_rwlock_t * readwrite_lock
#define __rte_cache_aligned
uint8_t hw_trans_mem_support
struct rte_hash_rcu_config * hash_rcu_cfg
struct rte_hash_bucket * buckets_ext
rte_hash_cmp_eq_t rte_hash_custom_cmp_eq
uint8_t writer_takes_lock
uint8_t ext_table_support
uint32_t hash_func_init_val
struct rte_hash_bucket * buckets