FD.io VPP  v17.01.1-3-gc6833f8
Vector Packet Processing
cnat_bulk_port_defs.h
Go to the documentation of this file.
1 /*
2  *------------------------------------------------------------------
3  * cnat_bulk_port_defs.h bulk port alloc definitions
4  *
5  * Copyright (c) 2011 Cisco and/or its affiliates.
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at:
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *------------------------------------------------------------------
18  */
19 
20 #ifndef __CNAT_BULK_PORT_DEFS_H__
21 #define __CNAT_BULK_PORT_DEFS_H__
22 
23 
24 #ifndef NO_BULK_LOGGING
25 
26 typedef enum {
38 
39 /* #define DEBUG_BULK_PORT 1 TODO: remove this later */
40 
41 #define CACHE_ALLOC_NO_LOG_REQUIRED -1
42 #define BULK_ALLOC_NOT_ATTEMPTED -2
43 
44 #define BULK_RANGE_INVALID 0xFFFF
45 #define BULK_RANGE_CACHE_SIZE 4
46 
47 #define BULKSIZE_FROM_VRFMAP(vrfmap) ((vrfmap)->bulk_size)
48 
49 #define INIT_BULK_CACHE(udb) \
50  { \
51  int i; \
52  for(i =0; i < BULK_RANGE_CACHE_SIZE; i++) \
53  (udb)->bulk_port_range_cache[i] = (i16)BULK_RANGE_INVALID; \
54  }
55 
56 #endif /* NO_BULK_LOGGING */
57 #endif /* __CNAT_BULK_PORT_DEFS_H__ */
bulk_alloc_size_t