DPDK
18.05.1
Main Page
Related Pages
Data Structures
Files
Examples
File List
Globals
lib
librte_hash
rte_hash.h
Go to the documentation of this file.
1
/* SPDX-License-Identifier: BSD-3-Clause
2
* Copyright(c) 2010-2015 Intel Corporation
3
*/
4
5
#ifndef _RTE_HASH_H_
6
#define _RTE_HASH_H_
7
14
#include <stdint.h>
15
#include <stddef.h>
16
17
#ifdef __cplusplus
18
extern
"C"
{
19
#endif
20
22
#define RTE_HASH_ENTRIES_MAX (1 << 30)
23
25
#define RTE_HASH_NAMESIZE 32
26
28
#define RTE_HASH_LOOKUP_BULK_MAX 64
29
#define RTE_HASH_LOOKUP_MULTI_MAX RTE_HASH_LOOKUP_BULK_MAX
30
32
#define RTE_HASH_EXTRA_FLAGS_TRANS_MEM_SUPPORT 0x01
33
35
#define RTE_HASH_EXTRA_FLAGS_MULTI_WRITER_ADD 0x02
36
38
typedef
uint32_t
hash_sig_t
;
39
41
typedef
uint32_t (*
rte_hash_function
)(
const
void
*key, uint32_t key_len,
42
uint32_t
init_val
);
43
45
typedef
int (*
rte_hash_cmp_eq_t
)(
const
void
*key1,
const
void
*key2,
size_t
key_len);
46
50
struct
rte_hash_parameters
{
51
const
char
*
name
;
52
uint32_t
entries
;
53
uint32_t
reserved
;
54
uint32_t
key_len
;
55
rte_hash_function
hash_func
;
56
uint32_t
hash_func_init_val
;
57
int
socket_id
;
58
uint8_t
extra_flag
;
59
};
60
62
struct
rte_hash
;
63
81
struct
rte_hash
*
82
rte_hash_create
(
const
struct
rte_hash_parameters
*params);
83
95
void
rte_hash_set_cmp_func
(
struct
rte_hash
*h,
rte_hash_cmp_eq_t
func);
96
107
struct
rte_hash
*
108
rte_hash_find_existing
(
const
char
*
name
);
109
115
void
116
rte_hash_free
(
struct
rte_hash
*h);
117
123
void
124
rte_hash_reset
(
struct
rte_hash
*h);
125
142
int
143
rte_hash_add_key_data
(
const
struct
rte_hash
*h,
const
void
*key,
void
*data);
144
164
int32_t
165
rte_hash_add_key_with_hash_data
(
const
struct
rte_hash
*h,
const
void
*key,
166
hash_sig_t sig,
void
*data);
167
182
int32_t
183
rte_hash_add_key
(
const
struct
rte_hash
*h,
const
void
*key);
184
202
int32_t
203
rte_hash_add_key_with_hash
(
const
struct
rte_hash
*h,
const
void
*key, hash_sig_t sig);
204
221
int32_t
222
rte_hash_del_key
(
const
struct
rte_hash
*h,
const
void
*key);
223
242
int32_t
243
rte_hash_del_key_with_hash
(
const
struct
rte_hash
*h,
const
void
*key, hash_sig_t sig);
244
260
int
261
rte_hash_get_key_with_position
(
const
struct
rte_hash
*h,
const
int32_t position,
262
void
**key);
263
281
int
282
rte_hash_lookup_data
(
const
struct
rte_hash
*h,
const
void
*key,
void
**data);
283
304
int
305
rte_hash_lookup_with_hash_data
(
const
struct
rte_hash
*h,
const
void
*key,
306
hash_sig_t sig,
void
**data);
307
323
int32_t
324
rte_hash_lookup
(
const
struct
rte_hash
*h,
const
void
*key);
325
343
int32_t
344
rte_hash_lookup_with_hash
(
const
struct
rte_hash
*h,
345
const
void
*key, hash_sig_t sig);
346
358
hash_sig_t
359
rte_hash_hash
(
const
struct
rte_hash
*h,
const
void
*key);
360
378
int
379
rte_hash_lookup_bulk_data
(
const
struct
rte_hash
*h,
const
void
**keys,
380
uint32_t num_keys, uint64_t *hit_mask,
void
*data[]);
381
401
int
402
rte_hash_lookup_bulk
(
const
struct
rte_hash
*h,
const
void
**keys,
403
uint32_t num_keys, int32_t *positions);
404
424
int32_t
425
rte_hash_iterate
(
const
struct
rte_hash
*h,
const
void
**key,
void
**data, uint32_t *next);
426
#ifdef __cplusplus
427
}
428
#endif
429
430
#endif
/* _RTE_HASH_H_ */
Generated by
1.8.1.2