57 #ifndef _RTE_MEMBER_H_ 58 #define _RTE_MEMBER_H_ 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 107 extern 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__,))) 117 struct rte_member_setsum;
136 RTE_MEMBER_TYPE_SKETCH,
141 enum rte_member_sig_compare_function {
142 RTE_MEMBER_COMPARE_SCALAR = 0,
143 RTE_MEMBER_COMPARE_AVX2,
144 RTE_MEMBER_COMPARE_NUM
148 typedef void (*sketch_update_fn_t)(
const struct rte_member_setsum *ss,
153 typedef uint64_t (*sketch_lookup_fn_t)(
const struct rte_member_setsum *ss,
157 typedef void (*sketch_delete_fn_t)(
const struct rte_member_setsum *ss,
161 struct 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;
366 struct rte_member_setsum *
381 struct rte_member_setsum *
402 member_set_t *set_id);
426 const void **keys, uint32_t num_keys,
427 member_set_t *set_ids);
455 const void *key, uint32_t max_match_per_key,
456 member_set_t *set_id);
486 const void **keys, uint32_t num_keys,
487 uint32_t max_match_per_key,
488 uint32_t *match_count,
489 member_set_t *set_ids);
521 rte_member_add(
const struct rte_member_setsum *setsum,
const void *key,
522 member_set_t set_id);
542 const void *key, uint32_t byte_count);
562 const void *key, uint64_t *count);
584 void **keys, uint64_t *counts);
633 member_set_t set_id);
#define RTE_MEMBER_NAMESIZE
int rte_member_delete(const struct rte_member_setsum *setsum, const void *key, member_set_t set_id)
int rte_member_add(const struct rte_member_setsum *setsum, const void *key, member_set_t set_id)
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)
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)
__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_report_heavyhitter(const struct rte_member_setsum *setsum, void **keys, uint64_t *counts)
void rte_member_free(struct rte_member_setsum *setsum)
#define __rte_cache_aligned
int rte_member_lookup_bulk(const struct rte_member_setsum *setsum, const void **keys, uint32_t num_keys, member_set_t *set_ids)
__rte_experimental int rte_member_query_count(const struct rte_member_setsum *setsum, const void *key, uint64_t *count)
struct rte_member_setsum * rte_member_find_existing(const char *name)
int rte_member_lookup(const struct rte_member_setsum *setsum, const void *key, member_set_t *set_id)
void rte_member_reset(const struct rte_member_setsum *setsum)
struct rte_member_setsum * rte_member_create(const struct rte_member_parameters *params)
float false_positive_rate