4c7b3f969085c91a9af55fd822e9e7fd7db6ed39
1 /**************************************************************
2 * FILE: netapi_tune.h
3 * Purpose: hold tunable parameters (build time)
4 **************************************************************
5 * @file netapi_tune.h
6 *
7 * @brief DESCRIPTION: Tuneable (compile time) parameters for user space transport
8 * library
9 *
10 * REVISION HISTORY: rev 0.0.1
11 *
12 * Copyright (c) Texas Instruments Incorporated 2010-2011
13 *
14 * Redistribution and use in source and binary forms, with or without
15 * modification, are permitted provided that the following conditions
16 * are met:
17 *
18 * Redistributions of source code must retain the above copyright
19 * notice, this list of conditions and the following disclaimer.
20 *
21 * Redistributions in binary form must reproduce the above copyright
22 * notice, this list of conditions and the following disclaimer in the
23 * documentation and/or other materials provided with the
24 * distribution.
25 *
26 * Neither the name of Texas Instruments Incorporated nor the names of
27 * its contributors may be used to endorse or promote products derived
28 * from this software without specific prior written permission.
29 *
30 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
31 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
32 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
33 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
34 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
35 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
36 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
37 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
38 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
39 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
40 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
42 ****************************************************/
43 #ifndef __NETAPI_TUNE__H
44 #define __NETAPI_TUNE__H
47 /**
48 * @defgroup NETAPI_TUNE NETAPI tunable parameters
49 */
50 /** @ingroup NETAPI_TUNE */
52 /**
53 * @def NETAPI_ENABLE_SECURITY
54 * (0) define this to enable securtiy. Note: libraries being use need to be built with SA enabled also!
55 */
56 //#define NETAPI_ENABLE_SECURITY
58 /**
59 * @def TUNE_NETAPI_NUM_CORES
60 * (0) How many cores (theads)
61 */
62 #define TUNE_NETAPI_NUM_CORES 1
64 /**
65 * @def TUNE_NETAPI_PERM_MEM_SZ
66 * (1) how much contiguous memory to grab. This is used for
67 * descriptors and buffers. Can't be bigger than MSMC (internal SOC memory area)
68 */
69 #define TUNE_NETAPI_PERM_MEM_SZ (2*1024*1024)
71 /**
72 * @def TUNE_NETAPI_MAX_PKTIO
73 * (2) how many GLOBAL pkt io channels
74 */
75 #define TUNE_NETAPI_MAX_PKTIO 16
77 //(2a) default TX channel name
78 //(2b) default RX channel name
81 /**
82 * @def TUNE_NETAPI_DEFAULT_BUFFER_SIZE
83 * (3) size of netapi default pktlib heap buffers
84 */
85 #define TUNE_NETAPI_DEFAULT_BUFFER_SIZE 1600
87 //(3a) default pkt heap name
89 /**
90 * @def TUNE_NETAPI_DEFAULT_NUM_BUFFERS
91 *(4) number of netapi default pktlib heap buffers (and assoc descriptors)
92 */
93 #define TUNE_NETAPI_DEFAULT_NUM_BUFFERS 200
95 /*
96 * @def TUNE_NETAPI_DEFAULT_NUM_SOLO_DESCRIPTORS
97 * (5) number of netapi default pkt lib heap solo descriptors
98 */
99 #define TUNE_NETAPI_DEFAULT_NUM_SOLO_DESCRIPTORS 100
101 /**
102 * @def NETAPI_INCLUDE_SCHED
103 * (6) define this to include the scheduler component
104 */
105 #define NETAPI_INCLUDE_SCHED
107 //(7) # of QM descriptors (total)
108 #define TUNE_NETAPI_QM_CONFIG_MAX_DESC_NUM 1024 /* 16384 is abs max */
110 //(8) Region info
111 #define TUNE_NETAPI_NUM_LOCAL_DESC 64
113 /* at least as big as DEFAULT_NUM_SOLO+DEFAULT_NUM_BUFFERS but also a power of 2*/
114 #define TUNE_NETAPI_NUM_GLOBAL_DESC 512
115 #define TUNE_NETAPI_DESC_SIZE 128 //don't change!!
117 //(9) Define to 1 for DEBUG MODE [where NETCP just loops pkts that tx back to rx]
118 #define TUNE_NETAPI_NWAL_ENABLE_PASS_LOOPBACK 1 /*0*/
121 //(10) NWAL (internal) config. Should not have to change
122 #define TUNE_NETAPI_CONFIG_MAX_PA_TO_SA_DESC 16
123 #define TUNE_NETAPI_CONFIG_MAX_SA_TO_PA_DESC 16
125 #define TUNE_NETAPI_MAX_NUM_MAC 2 //2 'logical' mac addresses
126 #define TUNE_NETAPI_MAX_NUM_IP 2 //2 ip addresses
127 #define TUNE_NETAPI_MAX_NUM_PORTS_PER_CORE 4 //udp/tcp ports -> for lUT2 )
128 #define TUNE_NETAPI_MAX_NUM_PORTS (TUNE_NETAPI_MAX_NUM_PORTS_PER_CORE * (TUNE_NETAPI_NUM_CORES))
130 #ifdef NETAPI_ENABLE_SECURITY
131 #define TUNE_NETAPI_MAX_NUM_IPSEC_CHANNELS 2
132 #else
133 #define TUNE_NETAPI_MAX_NUM_IPSEC_CHANNELS 0
134 #endif
135 #define TUNE_NETAPI_MAX_NUM_L2_L3_HDRS 2
136 #define TUNE_NETAPI_MAX_NUM_TRANS (TUNE_NETAPI_MAX_NUM_MAC + TUNE_NETAPI_MAX_NUM_IP + TUNE_NETAPI_MAX_NUM_PORTS + TUNE_NETAPI_MAX_NUM_IPSEC_CHANNELS)
138 //(11) PA control buffer pool (internal)
139 #define TUNE_NETAPI_CONFIG_MAX_CTL_RXTX_BUF_SIZE 384
140 #define TUNE_NETAPI_CONFIG_NUM_CTL_BUF 16
142 //(12) PKTIO RECV BURST SIZE
143 #define TUNE_NETAPI_MAX_BURST_RCV 32 //max #ok pkts to recv in one poll
145 //(13) netcp interfaces
146 #define TUNE_NETAPI_MAX_IP_PER_INTERFACE 2 //2 ip's per interface
147 #define TUNE_NETAPI_MAX_INTERFACES 2 //2 interfaces
149 //(14) timers
150 #define TUNE_NETAPI_NUM_TIMER_CELLS 128 //# of hash bins in a timer group
151 #define TUNE_NETAPI_NUM_GLOBAL_TIMERS 4 //# global timer blocks
152 #endif