2 *------------------------------------------------------------------
3 * cnat_bulk_port_defs.h bulk port alloc definitions
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:
10 * http://www.apache.org/licenses/LICENSE-2.0
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 *------------------------------------------------------------------
20 #ifndef __CNAT_BULK_PORT_DEFS_H__
21 #define __CNAT_BULK_PORT_DEFS_H__
24 #ifndef NO_BULK_LOGGING
27 BULK_ALLOC_SIZE_NONE = 1,
28 BULK_ALLOC_SIZE_16 = 16,
29 BULK_ALLOC_SIZE_32 = 32,
30 BULK_ALLOC_SIZE_64 = 64,
31 BULK_ALLOC_SIZE_128 = 128,
32 BULK_ALLOC_SIZE_256 = 256,
33 BULK_ALLOC_SIZE_512 = 512,
34 BULK_ALLOC_SIZE_1024 = 1024,
35 BULK_ALLOC_SIZE_2048 = 2048,
36 BULK_ALLOC_SIZE_4096 = 4096
39 /* #define DEBUG_BULK_PORT 1 TODO: remove this later */
41 #define CACHE_ALLOC_NO_LOG_REQUIRED -1
42 #define BULK_ALLOC_NOT_ATTEMPTED -2
44 #define BULK_RANGE_INVALID 0xFFFF
45 #define BULK_RANGE_CACHE_SIZE 4
47 #define BULKSIZE_FROM_VRFMAP(vrfmap) ((vrfmap)->bulk_size)
49 #define INIT_BULK_CACHE(udb) \
52 for(i =0; i < BULK_RANGE_CACHE_SIZE; i++) \
53 (udb)->bulk_port_range_cache[i] = (i16)BULK_RANGE_INVALID; \
56 #endif /* NO_BULK_LOGGING */
57 #endif /* __CNAT_BULK_PORT_DEFS_H__ */