5 #ifndef RTE_MEMBER_SKETCH_H 6 #define RTE_MEMBER_SKETCH_H 15 #define NUM_ROW_SCALAR 5 16 #define INTERVAL (1 << 15) 18 #if !RTE_IS_POWER_OF_2(INTERVAL) 19 #error sketch INTERVAL macro must be a power of 2 23 rte_member_create_sketch(
struct rte_member_setsum *ss,
28 rte_member_lookup_sketch(
const struct rte_member_setsum *setsum,
32 rte_member_add_sketch(
const struct rte_member_setsum *setsum,
37 rte_member_add_sketch_byte_count(
const struct rte_member_setsum *ss,
38 const void *key, uint32_t byte_count);
41 sketch_update_scalar(
const struct rte_member_setsum *ss,
46 sketch_lookup_scalar(
const struct rte_member_setsum *ss,
50 sketch_delete_scalar(
const struct rte_member_setsum *ss,
54 rte_member_delete_sketch(
const struct rte_member_setsum *setsum,
58 rte_member_query_sketch(
const struct rte_member_setsum *setsum,
59 const void *key, uint64_t *output);
62 rte_member_free_sketch(
struct rte_member_setsum *ss);
65 rte_member_reset_sketch(
const struct rte_member_setsum *setsum);
68 rte_member_report_heavyhitter_sketch(
const struct rte_member_setsum *setsum,
69 void **key, uint64_t *count);
72 rte_member_update_heap(
const struct rte_member_setsum *ss);
75 count_min(
const struct rte_member_setsum *ss,
const uint32_t *hash_results)
77 uint64_t *count_array = ss->table;
80 uint64_t min = UINT64_MAX;
82 for (cur_row = 0; cur_row < ss->num_row; cur_row++) {
83 uint64_t cnt = count_array[cur_row * ss->num_col + hash_results[cur_row]];
#define __rte_always_inline