/************************************************************** * FILE: netapi_tune.h * Purpose: hold tunable parameters (build time) ************************************************************** * FILE: netapi_tune.h.h * * 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 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 MSMC (internal SOC memory area) */ #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 */ #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) */ #define TUNE_NETAPI_DEFAULT_NUM_BUFFERS 200 /* * @def TUNE_NETAPI_DEFAULT_NUM_SOLO_DESCRIPTORS * (5) number of netapi default pkt lib heap solo descriptors */ #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) #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!! //(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_CONFIG_MAX_GLOB_DESC (TEST_CONFIG_MAX_PA_TO_SA_DESC + TEST_CONFIG_MAX_SA_TO_PA_DESC) #if 0 #define TEST_CONFIG_GLOB_DESC_SIZE 128 /* todo:could be smaller */ #define TEST_CONFIG_GLOB_BUF_SIZE 1500 /* MTU Size */ #endif #define TUNE_NETAPI_MAX_NUM_MAC 2 #define TUNE_NETAPI_MAX_NUM_IP 2 #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 2 #else #define TUNE_NETAPI_MAX_NUM_IPSEC_CHANNELS 0 #endif #define TUNE_NETAPI_MAX_NUM_L2_L3_HDRS 2 #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_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_PER_INTERFACE 2 //2 ip's per interface #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 #endif