FD.io VPP
v19.01.3-6-g70449b9b9
Vector Packet Processing
cuckoo_common.h
Go to the documentation of this file.
1
/*
2
Copyright (c) 2017 Cisco and/or its affiliates.
3
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at:
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*/
16
17
/*
18
* Note: to instantiate the template multiple times in a single file,
19
* #undef __included_cuckoo_template_h__...
20
*/
21
#ifndef __included_cuckoo_common_h__
22
#define __included_cuckoo_common_h__
23
24
#include <
vppinfra/types.h
>
25
26
#define CLIB_CUCKOO_OPTIMIZE_PREFETCH 1
27
#define CLIB_CUCKOO_OPTIMIZE_CMP_REDUCED_HASH 1
28
#define CLIB_CUCKOO_OPTIMIZE_UNROLL 1
29
#define CLIB_CUCKOO_OPTIMIZE_USE_COUNT_LIMITS_SEARCH 1
30
31
#define foreach_clib_cuckoo_error(F) \
32
F (CLIB_CUCKOO_ERROR_SUCCESS, 0, "success") \
33
F (CLIB_CUCKOO_ERROR_NOT_FOUND, -1, "object not found") \
34
F (CLIB_CUCKOO_ERROR_AGAIN, -2, "object busy")
35
36
typedef
enum
37
{
38
#define F(n, v, s) n = v,
39
foreach_clib_cuckoo_error
(
F
)
40
#undef F
41
}
clib_cuckoo_error_e
;
42
43
typedef
struct
44
{
45
uword
bucket1
;
46
uword
bucket2
;
47
u8
reduced_hash
;
48
}
clib_cuckoo_lookup_info_t
;
49
50
#endif
/* __included_cuckoo_common_h__ */
51
52
/** @endcond */
53
54
/*
55
* fd.io coding-style-patch-verification: ON
56
*
57
* Local Variables:
58
* eval: (c-set-style "gnu")
59
* End:
60
*/
u8
unsigned char u8
Definition:
types.h:56
clib_cuckoo_lookup_info_t::bucket2
uword bucket2
Definition:
cuckoo_common.h:46
clib_cuckoo_lookup_info_t::bucket1
uword bucket1
Definition:
cuckoo_common.h:45
clib_cuckoo_lookup_info_t
Definition:
cuckoo_common.h:43
foreach_clib_cuckoo_error
#define foreach_clib_cuckoo_error(F)
Definition:
cuckoo_common.h:31
types.h
uword
u64 uword
Definition:
types.h:112
clib_cuckoo_lookup_info_t::reduced_hash
u8 reduced_hash
Definition:
cuckoo_common.h:47
clib_cuckoo_error_e
clib_cuckoo_error_e
Definition:
cuckoo_common.h:36
F
#define F(n, v, s)
Definition:
cuckoo_common.h:38
src
vppinfra
cuckoo_common.h
Generated on Sun Dec 8 2019 18:03:43 for FD.io VPP by
1.8.13