crypto/dpaa2_sec: fix handling of session init failure
[dpdk.git] / lib / librte_member / 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
9 extern "C" {
10 #endif
11
12 /* Maximum number of pushes for cuckoo path in HT mode. */
13 #define RTE_MEMBER_MAX_PUSHES 50
14
15 typedef uint16_t member_sig_t;                  /* signature size is 16 bit */
16
17 /* The bucket struct for ht setsum */
18 struct 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 */
21 } __rte_cache_aligned;
22
23 int
24 rte_member_create_ht(struct rte_member_setsum *ss,
25                 const struct rte_member_parameters *params);
26
27 int
28 rte_member_lookup_ht(const struct rte_member_setsum *setsum,
29                 const void *key, member_set_t *set_id);
30
31 uint32_t
32 rte_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
36 uint32_t
37 rte_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
41 uint32_t
42 rte_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
47 int
48 rte_member_add_ht(const struct rte_member_setsum *setsum,
49                 const void *key, member_set_t set_id);
50
51 void
52 rte_member_free_ht(struct rte_member_setsum *setsum);
53
54 int
55 rte_member_delete_ht(const struct rte_member_setsum *ss, const void *key,
56                 member_set_t set_id);
57
58 void
59 rte_member_reset_ht(const struct rte_member_setsum *setsum);
60
61 #ifdef __cplusplus
62 }
63 #endif
64
65 #endif /* _RTE_MEMBER_HT_H_ */