DPDK 22.11.5
rte_member_ht.h
1/* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2017 Intel Corporation
3 */
4
5#ifndef _RTE_MEMBER_HT_H_
6#define _RTE_MEMBER_HT_H_
7
8#ifdef __cplusplus
9extern "C" {
10#endif
11
12/* Maximum number of pushes for cuckoo path in HT mode. */
13#define RTE_MEMBER_MAX_PUSHES 50
14
15typedef uint16_t member_sig_t; /* signature size is 16 bit */
16
17/* The bucket struct for ht setsum */
18struct member_ht_bucket {
19 member_sig_t sigs[RTE_MEMBER_BUCKET_ENTRIES]; /* 2-byte signature */
20 member_set_t sets[RTE_MEMBER_BUCKET_ENTRIES]; /* 2-byte set */
22
23int
24rte_member_create_ht(struct rte_member_setsum *ss,
25 const struct rte_member_parameters *params);
26
27int
28rte_member_lookup_ht(const struct rte_member_setsum *setsum,
29 const void *key, member_set_t *set_id);
30
31uint32_t
32rte_member_lookup_bulk_ht(const struct rte_member_setsum *setsum,
33 const void **keys, uint32_t num_keys,
34 member_set_t *set_ids);
35
36uint32_t
37rte_member_lookup_multi_ht(const struct rte_member_setsum *setsum,
38 const void *key, uint32_t match_per_key,
39 member_set_t *set_id);
40
41uint32_t
42rte_member_lookup_multi_bulk_ht(const struct rte_member_setsum *setsum,
43 const void **keys, uint32_t num_keys, uint32_t match_per_key,
44 uint32_t *match_count,
45 member_set_t *set_ids);
46
47int
48rte_member_add_ht(const struct rte_member_setsum *setsum,
49 const void *key, member_set_t set_id);
50
51void
52rte_member_free_ht(struct rte_member_setsum *setsum);
53
54int
55rte_member_delete_ht(const struct rte_member_setsum *ss, const void *key,
56 member_set_t set_id);
57
58void
59rte_member_reset_ht(const struct rte_member_setsum *setsum);
60
61#ifdef __cplusplus
62}
63#endif
64
65#endif /* _RTE_MEMBER_HT_H_ */
#define __rte_cache_aligned
Definition: rte_common.h:440
#define RTE_MEMBER_BUCKET_ENTRIES
Definition: rte_member.h:80
uint16_t member_set_t
Definition: rte_member.h:72