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)
35#if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64)
40enum cmp_jump_table_case {
75enum cmp_jump_table_case {
100#define RTE_HASH_BUCKET_ENTRIES 8
102#if !RTE_IS_POWER_OF_2(RTE_HASH_BUCKET_ENTRIES)
103#error RTE_HASH_BUCKET_ENTRIES must be a power of 2
106#define NULL_SIGNATURE 0
110#define KEY_ALIGNMENT 16
112#define LCORE_CACHE_SIZE 64
114#define RTE_HASH_BFS_QUEUE_MAX_LEN 1000
116#define RTE_XABORT_CUCKOO_PATH_INVALIDED 0x4
118#define RTE_HASH_TSX_MAX_RETRY 10
122 uint32_t objs[LCORE_CACHE_SIZE];
136enum rte_hash_sig_compare_function {
137 RTE_HASH_COMPARE_SCALAR = 0,
138 RTE_HASH_COMPARE_SSE,
139 RTE_HASH_COMPARE_NEON,
145 uint16_t sig_current[RTE_HASH_BUCKET_ENTRIES];
147 uint32_t key_idx[RTE_HASH_BUCKET_ENTRIES];
149 uint8_t flag[RTE_HASH_BUCKET_ENTRIES];
169 struct rte_rcu_qsbr_dq *
dq;
220 uint32_t *ext_bkt_to_free;
227 uint32_t cur_bkt_idx;
229 struct queue_node *prev;
234#define RTE_HASH_RCU_DQ_RECLAIM_MAX 16
#define __rte_cache_aligned
uint32_t(* rte_hash_function)(const void *key, uint32_t key_len, uint32_t init_val)
#define RTE_HASH_NAMESIZE
int(* rte_hash_cmp_eq_t)(const void *key1, const void *key2, size_t key_len)
uint32_t hash_func_init_val
struct rte_hash_bucket * buckets_ext
uint8_t readwrite_concur_support
struct rte_rcu_qsbr_dq * dq
struct lcore_cache * local_free_slots
char name[RTE_HASH_NAMESIZE]
struct rte_ring * free_ext_bkts
uint8_t readwrite_concur_lf_support
uint8_t writer_takes_lock
struct rte_hash_rcu_config * hash_rcu_cfg
struct rte_hash_bucket * buckets
enum cmp_jump_table_case cmp_jump_table_idx
rte_hash_cmp_eq_t rte_hash_custom_cmp_eq
uint32_t key_len __rte_cache_aligned
rte_hash_function hash_func
struct rte_ring * free_slots
enum rte_hash_sig_compare_function sig_cmp_fn
uint8_t ext_table_support
uint8_t hw_trans_mem_support
rte_rwlock_t * readwrite_lock