DPDK
19.05.0
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
#include <rte_compat.h>
18
19
#ifdef __cplusplus
20
extern
"C"
{
21
#endif
22
24
#define RTE_HASH_ENTRIES_MAX (1 << 30)
25
27
#define RTE_HASH_NAMESIZE 32
28
30
#define RTE_HASH_LOOKUP_BULK_MAX 64
31
#define RTE_HASH_LOOKUP_MULTI_MAX RTE_HASH_LOOKUP_BULK_MAX
32
34
#define RTE_HASH_EXTRA_FLAGS_TRANS_MEM_SUPPORT 0x01
35
37
#define RTE_HASH_EXTRA_FLAGS_MULTI_WRITER_ADD 0x02
38
40
#define RTE_HASH_EXTRA_FLAGS_RW_CONCURRENCY 0x04
41
43
#define RTE_HASH_EXTRA_FLAGS_EXT_TABLE 0x08
44
50
#define RTE_HASH_EXTRA_FLAGS_NO_FREE_ON_DEL 0x10
51
57
#define RTE_HASH_EXTRA_FLAGS_RW_CONCURRENCY_LF 0x20
58
63
typedef
uint32_t
hash_sig_t
;
64
66
typedef
uint32_t (*
rte_hash_function
)(
const
void
*key, uint32_t key_len,
67
uint32_t
init_val
);
68
70
typedef
int (*
rte_hash_cmp_eq_t
)(
const
void
*key1,
const
void
*key2,
size_t
key_len);
71
75
struct
rte_hash_parameters
{
76
const
char
*
name
;
77
uint32_t
entries
;
78
uint32_t
reserved
;
79
uint32_t
key_len
;
80
rte_hash_function
hash_func
;
81
uint32_t
hash_func_init_val
;
82
int
socket_id
;
83
uint8_t
extra_flag
;
84
};
85
87
struct
rte_hash
;
88
106
struct
rte_hash
*
107
rte_hash_create
(
const
struct
rte_hash_parameters
*params);
108
120
void
rte_hash_set_cmp_func
(
struct
rte_hash
*h,
rte_hash_cmp_eq_t
func);
121
132
struct
rte_hash
*
133
rte_hash_find_existing
(
const
char
*
name
);
134
140
void
141
rte_hash_free
(
struct
rte_hash
*h);
142
153
void
154
rte_hash_reset
(
struct
rte_hash
*h);
155
164
int32_t
165
rte_hash_count
(
const
struct
rte_hash
*h);
166
190
int
191
rte_hash_add_key_data
(
const
struct
rte_hash
*h,
const
void
*key,
void
*data);
192
219
int32_t
220
rte_hash_add_key_with_hash_data
(
const
struct
rte_hash
*h,
const
void
*key,
221
hash_sig_t sig,
void
*data);
222
239
int32_t
240
rte_hash_add_key
(
const
struct
rte_hash
*h,
const
void
*key);
241
261
int32_t
262
rte_hash_add_key_with_hash
(
const
struct
rte_hash
*h,
const
void
*key, hash_sig_t sig);
263
290
int32_t
291
rte_hash_del_key
(
const
struct
rte_hash
*h,
const
void
*key);
292
321
int32_t
322
rte_hash_del_key_with_hash
(
const
struct
rte_hash
*h,
const
void
*key, hash_sig_t sig);
323
341
int
342
rte_hash_get_key_with_position
(
const
struct
rte_hash
*h,
const
int32_t position,
343
void
**key);
344
369
int
__rte_experimental
370
rte_hash_free_key_with_position
(
const
struct
rte_hash
*h,
371
const
int32_t position);
372
392
int
393
rte_hash_lookup_data
(
const
struct
rte_hash
*h,
const
void
*key,
void
**data);
394
417
int
418
rte_hash_lookup_with_hash_data
(
const
struct
rte_hash
*h,
const
void
*key,
419
hash_sig_t sig,
void
**data);
420
438
int32_t
439
rte_hash_lookup
(
const
struct
rte_hash
*h,
const
void
*key);
440
460
int32_t
461
rte_hash_lookup_with_hash
(
const
struct
rte_hash
*h,
462
const
void
*key, hash_sig_t sig);
463
475
hash_sig_t
476
rte_hash_hash
(
const
struct
rte_hash
*h,
const
void
*key);
477
497
int
498
rte_hash_lookup_bulk_data
(
const
struct
rte_hash
*h,
const
void
**keys,
499
uint32_t num_keys, uint64_t *hit_mask,
void
*data[]);
500
522
int
523
rte_hash_lookup_bulk
(
const
struct
rte_hash
*h,
const
void
**keys,
524
uint32_t num_keys, int32_t *positions);
525
545
int32_t
546
rte_hash_iterate
(
const
struct
rte_hash
*h,
const
void
**key,
void
**data, uint32_t *next);
547
#ifdef __cplusplus
548
}
549
#endif
550
551
#endif
/* _RTE_HASH_H_ */
Generated by
1.8.1.2