index 54dcad9ff100c2342280a4b727e9217f7a6e055d..b469431053cb98b6a7e6063312ebde59f326e0c4 100755 (executable)
-/**************************************************************\r
- * FILE: netapi_tune.h\r
- * Purpose: hold tunable parameters (build time)\r
- **************************************************************\r
- * @file netapi_tune.h\r
- * \r
- * @brief DESCRIPTION: Tuneable (compile time) parameters for user space transport\r
- * library\r
- * \r
- * REVISION HISTORY: rev 0.0.1 \r
- *\r
- * Copyright (c) Texas Instruments Incorporated 2010-2011\r
- * \r
- * Redistribution and use in source and binary forms, with or without \r
- * modification, are permitted provided that the following conditions \r
- * are met:\r
- *\r
- * Redistributions of source code must retain the above copyright \r
- * notice, this list of conditions and the following disclaimer.\r
- *\r
- * Redistributions in binary form must reproduce the above copyright\r
- * notice, this list of conditions and the following disclaimer in the \r
- * documentation and/or other materials provided with the \r
- * distribution.\r
- *\r
- * Neither the name of Texas Instruments Incorporated nor the names of\r
- * its contributors may be used to endorse or promote products derived\r
- * from this software without specific prior written permission.\r
- *\r
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \r
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT \r
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT \r
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, \r
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT \r
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT \r
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE \r
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
-\r
- ****************************************************/\r
-#ifndef __NETAPI_TUNE__H\r
-#define __NETAPI_TUNE__H\r
-\r
-\r
-/**\r
- * @defgroup NETAPI_TUNE NETAPI tunable parameters\r
- */\r
-/** @ingroup NETAPI_TUNE */\r
-\r
-/**\r
-* @def NETAPI_ENABLE_SECURITY\r
-* (0) define this to enable securtiy. Note: libraries being use need to be built with SA enabled also! \r
-*/\r
-#define NETAPI_ENABLE_SECURITY \r
-\r
-\r
-/**\r
-* @def NETAPI_USE_DDR\r
-* (0) define this to enable use of cached DDR for buffers and descriptors \r
-* do not define if USE_MSMC defined below\r
-*/\r
-#define NETAPI_USE_DDR\r
-#ifdef NETAPI_USE_DDR\r
-#define NETAPI_TUNE_USE_CACHE_OPS //for appleton, no cache coherency with netcp & ARM \r
-#endif\r
-/**\r
-* @def NETAPI_USE_MSMC\r
-* (0) define this to enable use of un-cached MSMC for buffers and descriptors \r
-* do not define if USE_DDR defined above \r
-*/\r
-//#define NETAPI_USE_MSMC\r
-\r
-#ifdef NETAPI_USE_MSMC\r
-#ifdef NETAPI_USE_DDR\r
-#error "only define NETAPO_USE_MSMC or NETAPI_USE_DDR"\r
-#endif\r
-#endif\r
-\r
-/**\r
- * @def TUNE_NETAPI_NUM_CORES\r
- * (0) How many cores (theads) \r
- */\r
-#define TUNE_NETAPI_NUM_CORES 1\r
-\r
-/**\r
- * @def TUNE_NETAPI_PERM_MEM_SZ\r
- * (1) how much contiguous memory to grab. This is used for\r
- * descriptors and buffers. Can't be bigger than CMA memory area (or msmc if\r
- * we are using uncached . This can be set at netapi_init via NETAPI_CFG_T\r
- */\r
-#define TUNE_NETAPI_PERM_MEM_SZ (2*1024*1024) \r
-\r
-/**\r
- * @def TUNE_NETAPI_MAX_PKTIO\r
- * (2) how many GLOBAL pkt io channels\r
- */\r
-#define TUNE_NETAPI_MAX_PKTIO 16\r
-\r
-//(2a) default TX channel name\r
-//(2b) default RX channel name\r
-\r
-\r
-/**\r
- * @def TUNE_NETAPI_DEFAULT_BUFFER_SIZE\r
- * (3) size of netapi default pktlib heap buffers\r
-* This can be set at netapi_init() \r
- */\r
-#define TUNE_NETAPI_DEFAULT_BUFFER_SIZE 1600 \r
-\r
-//(3a) default pkt heap name\r
-\r
-/**\r
- * @def TUNE_NETAPI_DEFAULT_NUM_BUFFERS\r
- *(4) number of netapi default pktlib heap buffers (and assoc descriptors)\r
- * this can be set at netapi_init()\r
- */\r
-#define TUNE_NETAPI_DEFAULT_NUM_BUFFERS 200 \r
-\r
-/*\r
- * @def TUNE_NETAPI_DEFAULT_NUM_SOLO_DESCRIPTORS\r
- * (5) number of netapi default pkt lib heap solo descriptors\r
- * this can be set at netapi_init\r
- */\r
-#define TUNE_NETAPI_DEFAULT_NUM_SOLO_DESCRIPTORS 100 \r
-\r
-/**\r
- * @def NETAPI_INCLUDE_SCHED\r
- * (6) define this to include the scheduler component\r
- */\r
-#define NETAPI_INCLUDE_SCHED \r
-\r
-//(7) # of QM descriptors (total)\r
-// this can be set set in netapi_init\r
-// MUST BE POWER OF 2\r
-#define TUNE_NETAPI_QM_CONFIG_MAX_DESC_NUM 1024 /* 16384 is abs max */\r
-\r
-//(8) Region info\r
-#define TUNE_NETAPI_NUM_LOCAL_DESC 64 \r
-\r
-/* at least as big as DEFAULT_NUM_SOLO+DEFAULT_NUM_BUFFERS but also a power of 2*/\r
-#define TUNE_NETAPI_NUM_GLOBAL_DESC 512 \r
-\r
-#define TUNE_NETAPI_DESC_SIZE 128 //don't change!!\r
-#ifdef NETAPI_USE_DDR\r
-#define TUNE_NETAPI_QM_START_INDEX 0x2000 //WARNING: must reflect what kernel is using for their region, see device tree blob\r
-#define TUNE_NETAPI_QM_GLOBAL_REGION 18 //WARNING: must reflect what kernel is using for their region, see device tree blob\r
-#else //use msmc..\r
-#define TUNE_NETAPI_QM_START_INDEX 0 //ok to use 0 since kernel is somewhere higher\r
-#define TUNE_NETAPI_QM_GLOBAL_REGION 0 //ok to to use 0 since msmc addr < ddr addr \r
-#endif\r
-//(9) Define to 1 for DEBUG MODE [where NETCP just loops pkts that tx back to rx]\r
-#define TUNE_NETAPI_NWAL_ENABLE_PASS_LOOPBACK 0 /*1*/\r
-\r
-\r
-//(10) NWAL (internal) config. Should not have to change\r
-#define TUNE_NETAPI_CONFIG_MAX_PA_TO_SA_DESC 16\r
-#define TUNE_NETAPI_CONFIG_MAX_SA_TO_PA_DESC 16\r
-\r
-#define TUNE_NETAPI_MAX_NUM_MAC 2 //2 'logical' mac addresses\r
-#define TUNE_NETAPI_MAX_NUM_IP 4 //2 ip addresses \r
-#define TUNE_NETAPI_MAX_NUM_PORTS_PER_CORE 4 //udp/tcp ports -> for lUT2 ) \r
-#define TUNE_NETAPI_MAX_NUM_PORTS (TUNE_NETAPI_MAX_NUM_PORTS_PER_CORE * (TUNE_NETAPI_NUM_CORES)) \r
-\r
-#ifdef NETAPI_ENABLE_SECURITY\r
-#define TUNE_NETAPI_MAX_NUM_IPSEC_CHANNELS 4\r
-#else\r
-#define TUNE_NETAPI_MAX_NUM_IPSEC_CHANNELS 0\r
-#endif\r
-#define TUNE_NETAPI_MAX_NUM_L2_L3_HDRS 3\r
-#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)\r
-\r
-//(11) PA control buffer pool (internal)\r
-#define TUNE_NETAPI_CONFIG_MAX_CTL_RXTX_BUF_SIZE 384\r
-#define TUNE_NETAPI_CONFIG_NUM_CTL_BUF 16 \r
-\r
-//(12) PKTIO RECV BURST SIZE\r
-#define TUNE_NETAPI_MAX_BURST_RCV 32 //max #ok pkts to recv in one poll\r
-\r
-//(13) netcp interfaces\r
-#define TUNE_NETAPI_MAX_IP 4 //4 ip's can be attached to interfaces\r
-#define TUNE_NETAPI_MAX_INTERFACES 2 //2 interfaces\r
-\r
-//(14) timers\r
-#define TUNE_NETAPI_NUM_TIMER_CELLS 128 //# of hash bins in a timer group\r
-#define TUNE_NETAPI_NUM_GLOBAL_TIMERS 4 //# global timer blocks\r
-\r
-//(15) heaps\r
-#define TUNE_NETAPI_MAX_HEAPS 4 //max # of heaps one instance can create\r
-\r
-//(16) classifiers\r
-#define TUNE_NETAPI_MAX_CLASSIFIERS 16\r
-\r
-//(17) FLows\r
-#define TUNE_NETAPI_MAX_BUF_POOLS_IN_FLOW 4 //!!do not change!!\r
-#define TUNE_NETAPI_MAX_FLOWS 4 //app defined flows\r
-\r
-//(18) SAs & RX policies\r
-#define TUNE_NETAPI_MAX_SA 8 //rx&tx combined (so MAX_SA/4 tunnels typically)\r
-#define TUNE_NETAPI_MAX_POLICY 8 //rx policies\r
-\r
-#endif\r
+/**************************************************************
+ * FILE: netapi_tune.h
+ * Purpose: hold tunable parameters (build time)
+ **************************************************************
+ * @file netapi_tune.h
+ *
+ * @brief DESCRIPTION: Tuneable (compile time) parameters for user space transport
+ * library
+ *
+ * REVISION HISTORY: rev 0.0.1
+ *
+ * Copyright (c) Texas Instruments Incorporated 2010-2011
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ ****************************************************/
+#ifndef __NETAPI_TUNE__H
+#define __NETAPI_TUNE__H
+
+
+/**
+ * @defgroup NETAPI_TUNE NETAPI tunable parameters
+ */
+/** @ingroup NETAPI_TUNE */
+
+/**
+* @def NETAPI_ENABLE_SECURITY
+* (0) define this to enable securtiy. Note: libraries being use need to be built with SA enabled also!
+*/
+#define NETAPI_ENABLE_SECURITY
+
+
+/**
+* @def NETAPI_USE_DDR
+* (0) define this to enable use of cached DDR for buffers and descriptors
+* do not define if USE_MSMC defined below
+*/
+#define NETAPI_USE_DDR
+#ifdef NETAPI_USE_DDR
+#define NETAPI_TUNE_USE_CACHE_OPS //for appleton, no cache coherency with netcp & ARM
+#endif
+/**
+* @def NETAPI_USE_MSMC
+* (0) define this to enable use of un-cached MSMC for buffers and descriptors
+* do not define if USE_DDR defined above
+*/
+//#define NETAPI_USE_MSMC
+
+#ifdef NETAPI_USE_MSMC
+#ifdef NETAPI_USE_DDR
+#error "only define NETAPO_USE_MSMC or NETAPI_USE_DDR"
+#endif
+#endif
+
+/**
+ * @def TUNE_NETAPI_NUM_CORES
+ * (0) How many cores (theads)
+ */
+#define TUNE_NETAPI_NUM_CORES 1
+
+/**
+ * @def TUNE_NETAPI_PERM_MEM_SZ
+ * (1) how much contiguous memory to grab. This is used for
+ * descriptors and buffers. Can't be bigger than CMA memory area (or msmc if
+ * we are using uncached . This can be set at netapi_init via NETAPI_CFG_T
+ */
+#define TUNE_NETAPI_PERM_MEM_SZ (2*1024*1024)
+
+/**
+ * @def TUNE_NETAPI_MAX_PKTIO
+ * (2) how many GLOBAL pkt io channels
+ */
+#define TUNE_NETAPI_MAX_PKTIO 16
+
+//(2a) default TX channel name
+//(2b) default RX channel name
+
+
+/**
+ * @def TUNE_NETAPI_DEFAULT_BUFFER_SIZE
+ * (3) size of netapi default pktlib heap buffers
+* This can be set at netapi_init()
+ */
+#define TUNE_NETAPI_DEFAULT_BUFFER_SIZE 1600
+
+//(3a) default pkt heap name
+
+/**
+ * @def TUNE_NETAPI_DEFAULT_NUM_BUFFERS
+ *(4) number of netapi default pktlib heap buffers (and assoc descriptors)
+ * this can be set at netapi_init()
+ */
+#define TUNE_NETAPI_DEFAULT_NUM_BUFFERS 200
+
+/*
+ * @def TUNE_NETAPI_DEFAULT_NUM_SOLO_DESCRIPTORS
+ * (5) number of netapi default pkt lib heap solo descriptors
+ * this can be set at netapi_init
+ */
+#define TUNE_NETAPI_DEFAULT_NUM_SOLO_DESCRIPTORS 100
+
+/**
+ * @def NETAPI_INCLUDE_SCHED
+ * (6) define this to include the scheduler component
+ */
+#define NETAPI_INCLUDE_SCHED
+
+//(7) # of QM descriptors (total)
+// this can be set set in netapi_init
+// MUST BE POWER OF 2
+#define TUNE_NETAPI_QM_CONFIG_MAX_DESC_NUM 1024 /* 16384 is abs max */
+
+//(8) Region info
+#define TUNE_NETAPI_NUM_LOCAL_DESC 64
+
+/* at least as big as DEFAULT_NUM_SOLO+DEFAULT_NUM_BUFFERS but also a power of 2*/
+#define TUNE_NETAPI_NUM_GLOBAL_DESC 512
+
+#define TUNE_NETAPI_DESC_SIZE 128 //don't change!!
+#ifdef NETAPI_USE_DDR
+#define TUNE_NETAPI_QM_START_INDEX 0x2000 //WARNING: must reflect what kernel is using for their region, see device tree blob
+#define TUNE_NETAPI_QM_GLOBAL_REGION 18 //WARNING: must reflect what kernel is using for their region, see device tree blob
+#else //use msmc..
+#define TUNE_NETAPI_QM_START_INDEX 0 //ok to use 0 since kernel is somewhere higher
+#define TUNE_NETAPI_QM_GLOBAL_REGION 0 //ok to to use 0 since msmc addr < ddr addr
+#endif
+//(9) Define to 1 for DEBUG MODE [where NETCP just loops pkts that tx back to rx]
+#define TUNE_NETAPI_NWAL_ENABLE_PASS_LOOPBACK 0 /*1*/
+
+
+//(10) NWAL (internal) config. Should not have to change
+#define TUNE_NETAPI_CONFIG_MAX_PA_TO_SA_DESC 16
+#define TUNE_NETAPI_CONFIG_MAX_SA_TO_PA_DESC 16
+
+#define TUNE_NETAPI_MAX_NUM_MAC 2 //2 'logical' mac addresses
+#define TUNE_NETAPI_MAX_NUM_IP 4 //2 ip addresses
+#define TUNE_NETAPI_MAX_NUM_PORTS_PER_CORE 4 //udp/tcp ports -> for lUT2 )
+#define TUNE_NETAPI_MAX_NUM_PORTS (TUNE_NETAPI_MAX_NUM_PORTS_PER_CORE * (TUNE_NETAPI_NUM_CORES))
+
+#ifdef NETAPI_ENABLE_SECURITY
+#define TUNE_NETAPI_MAX_NUM_IPSEC_CHANNELS 4
+#else
+#define TUNE_NETAPI_MAX_NUM_IPSEC_CHANNELS 0
+#endif
+#define TUNE_NETAPI_MAX_NUM_L2_L3_HDRS 3
+#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)
+
+//(11) PA control buffer pool (internal)
+#define TUNE_NETAPI_CONFIG_MAX_CTL_RXTX_BUF_SIZE 384
+#define TUNE_NETAPI_CONFIG_NUM_CTL_RX_BUF 16
+#define TUNE_NETAPI_CONFIG_NUM_CTL_TX_BUF 16
+
+//(12) PKTIO RECV BURST SIZE
+#define TUNE_NETAPI_MAX_BURST_RCV 32 //max #ok pkts to recv in one poll
+
+//(13) netcp interfaces
+#define TUNE_NETAPI_MAX_IP 4 //4 ip's can be attached to interfaces
+#define TUNE_NETAPI_MAX_INTERFACES 2 //2 interfaces
+
+//(14) timers
+#define TUNE_NETAPI_NUM_TIMER_CELLS 128 //# of hash bins in a timer group
+#define TUNE_NETAPI_NUM_GLOBAL_TIMERS 4 //# global timer blocks
+
+//(15) heaps
+#define TUNE_NETAPI_MAX_HEAPS 4 //max # of heaps one instance can create
+
+//(16) classifiers
+#define TUNE_NETAPI_MAX_CLASSIFIERS 16
+
+//(17) FLows
+#define TUNE_NETAPI_MAX_BUF_POOLS_IN_FLOW 4 //!!do not change!!
+#define TUNE_NETAPI_MAX_FLOWS 4 //app defined flows
+
+//(18) SAs & RX policies
+#define TUNE_NETAPI_MAX_SA 8 //rx&tx combined (so MAX_SA/4 tunnels typically)
+#define TUNE_NETAPI_MAX_POLICY 8 //rx policies
+
+#endif