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
23rte_member_create_sketch(
struct rte_member_setsum *ss,
28rte_member_lookup_sketch(
const struct rte_member_setsum *setsum,
32rte_member_add_sketch(
const struct rte_member_setsum *setsum,
37rte_member_add_sketch_byte_count(
const struct rte_member_setsum *ss,
38 const void *key, uint32_t byte_count);
41sketch_update_scalar(
const struct rte_member_setsum *ss,
46sketch_lookup_scalar(
const struct rte_member_setsum *ss,
50sketch_delete_scalar(
const struct rte_member_setsum *ss,
54rte_member_delete_sketch(
const struct rte_member_setsum *setsum,
58rte_member_query_sketch(
const struct rte_member_setsum *setsum,
59 const void *key, uint64_t *output);
62rte_member_free_sketch(
struct rte_member_setsum *ss);
65rte_member_reset_sketch(
const struct rte_member_setsum *setsum);
68rte_member_report_heavyhitter_sketch(
const struct rte_member_setsum *setsum,
69 void **key, uint64_t *count);
72rte_member_update_heap(
const struct rte_member_setsum *ss);
75count_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