68#include <rte_compat.h>
74#define RTE_MEMBER_NO_MATCH 0
76#define RTE_MEMBER_ENTRIES_MAX (1 << 30)
78#define RTE_MEMBER_LOOKUP_BULK_MAX 64
80#define RTE_MEMBER_BUCKET_ENTRIES 16
82#define RTE_MEMBER_NAMESIZE 32
84#define RTE_RAND_MAX ~0LLU
94#define RTE_MEMBER_SKETCH_ALWAYS_BOUNDED 0x01
96#define RTE_MEMBER_SKETCH_COUNT_BYTE 0x02
99#if defined(RTE_ARCH_X86) || defined(__ARM_FEATURE_CRC32)
101#define MEMBER_HASH_FUNC rte_hash_crc
104#define MEMBER_HASH_FUNC rte_jhash
107extern int librte_member_logtype;
109#define RTE_MEMBER_LOG(level, ...) \
110 rte_log(RTE_LOG_ ## level, \
111 librte_member_logtype, \
112 RTE_FMT("%s(): " RTE_FMT_HEAD(__VA_ARGS__,), \
114 RTE_FMT_TAIL(__VA_ARGS__,)))
117struct rte_member_setsum;
136 RTE_MEMBER_TYPE_SKETCH,
141enum rte_member_sig_compare_function {
142 RTE_MEMBER_COMPARE_SCALAR = 0,
143 RTE_MEMBER_COMPARE_AVX2,
144 RTE_MEMBER_COMPARE_NUM
148typedef void (*sketch_update_fn_t)(
const struct rte_member_setsum *ss,
153typedef uint64_t (*sketch_lookup_fn_t)(
const struct rte_member_setsum *ss,
157typedef void (*sketch_delete_fn_t)(
const struct rte_member_setsum *ss,
161struct rte_member_setsum {
164 uint32_t prim_hash_seed;
165 uint32_t sec_hash_seed;
169 uint32_t bucket_mask;
171 enum rte_member_sig_compare_function sig_cmp_fn;
186 double converge_thresh;
189 uint64_t *hash_seeds;
190 sketch_update_fn_t sketch_update;
191 sketch_lookup_fn_t sketch_lookup;
192 sketch_delete_fn_t sketch_delete;
367struct rte_member_setsum *
382struct rte_member_setsum *
427 const void **keys, uint32_t num_keys,
456 const void *key, uint32_t max_match_per_key,
487 const void **keys, uint32_t num_keys,
488 uint32_t max_match_per_key,
489 uint32_t *match_count,
543 const void *key, uint32_t byte_count);
563 const void *key, uint64_t *count);
585 void **keys, uint64_t *counts);
#define __rte_cache_aligned
struct rte_member_setsum * rte_member_find_existing(const char *name)
int rte_member_add(const struct rte_member_setsum *setsum, const void *key, member_set_t set_id)
int rte_member_lookup_bulk(const struct rte_member_setsum *setsum, const void **keys, uint32_t num_keys, member_set_t *set_ids)
int rte_member_lookup(const struct rte_member_setsum *setsum, const void *key, member_set_t *set_id)
__rte_experimental int rte_member_report_heavyhitter(const struct rte_member_setsum *setsum, void **keys, uint64_t *counts)
int rte_member_delete(const struct rte_member_setsum *setsum, const void *key, member_set_t set_id)
struct rte_member_setsum * rte_member_create(const struct rte_member_parameters *params)
__rte_experimental int rte_member_add_byte_count(const struct rte_member_setsum *setsum, const void *key, uint32_t byte_count)
__rte_experimental int rte_member_query_count(const struct rte_member_setsum *setsum, const void *key, uint64_t *count)
#define RTE_MEMBER_NAMESIZE
void rte_member_free(struct rte_member_setsum *setsum)
int rte_member_lookup_multi(const struct rte_member_setsum *setsum, const void *key, uint32_t max_match_per_key, member_set_t *set_id)
void rte_member_reset(const struct rte_member_setsum *setsum)
int rte_member_lookup_multi_bulk(const struct rte_member_setsum *setsum, const void **keys, uint32_t num_keys, uint32_t max_match_per_key, uint32_t *match_count, member_set_t *set_ids)
float false_positive_rate
enum rte_member_setsum_type type