]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - keystone-rtos/netapi.git/blobdiff - ti/runtime/netapi/netapi_tune.h
Doxygen updates
[keystone-rtos/netapi.git] / ti / runtime / netapi / netapi_tune.h
old mode 100644 (file)
new mode 100755 (executable)
index 3e6215d..fd8113b
-/**************************************************************
- * 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 
+/******************************************************************************
+ * FILE PURPOSE:  netapi tunable parameters (compile time)
+ ******************************************************************************
+ * FILE NAME:   netapi_tune.h
+ *
+ * DESCRIPTION:Tuneable (compile time) parameters for user space transport library
+ *
+ * REVISION HISTORY:
  *
  *  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 
+ *
+ *  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 
+ *    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   
+ *    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 
+ *  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 
+ *  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 
+ *  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.
+ *
+ */
+/* ============================================================= */
+
+/**
+ *   @file netapi_tune.h
+ *   @brief Netapi Tuneable (compile time) parameters for user space transport library
+ */
+
 
- ****************************************************/
 #ifndef __NETAPI_TUNE__H
 #define __NETAPI_TUNE__H
 
 
 /**
- *   @defgroup NETAPI_TUNE NETAPI tunable parameters
- */
-/**  @ingroup NETAPI_TUNE */
+ * @ingroup netapi_tune_parameters
+* @brief Define this to enable securtiy.  Note: libraries being use need to be built with SA enabled also
+*/
+#define NETAPI_ENABLE_SECURITY 
+
 
 /**
-*  @def  NETAPI_ENABLE_SECURITY
-* (0) define this to enable securtiy.  Note: libraries being use need to be built with SA enabled also! 
+ * @ingroup netapi_tune_parameters
+* @brief Define this to enable use of cached DDR for buffers and descriptors. Do not define if USE_MSMC defined below
 */
-//#define NETAPI_ENABLE_SECURITY 
+#define NETAPI_USE_DDR
+#ifdef NETAPI_USE_DDR
+#define NETAPI_TUNE_USE_CACHE_OPS   //for appleton, no cache coherency with netcp & ARM 
+#endif
 
 /**
- * @def TUNE_NETAPI_NUM_CORES
- * (0) How many cores (theads) 
+ * @ingroup netapi_tune_parameters
+* @brief 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
+
+/**
+ * @ingroup netapi_tune_parameters
+* @brief Define this to the number of 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) 
+ * @ingroup netapi_tune_parameters
+* @brief Define this to how much contiguous memory to grab. This is used for
+ * descriptors and buffers in the case of uncached configuration only.  
+ * descriptors and buffers.  Can't be bigger than  msmc if
+ * MSMC memory is being using uncached .  This can be set at netapi_init via NETAPI_CFG_T
  */
-#define TUNE_NETAPI_PERM_MEM_SZ   (2*1024*1024)
+#define TUNE_NETAPI_PERM_MEM_SZ   (2*1024*1024) 
 
 /**
- * @def TUNE_NETAPI_MAX_PKTIO
- * (2) how many GLOBAL pkt io channels
+ * @ingroup netapi_tune_parameters
+ * @brief Define this to 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
+ * @ingroup netapi_tune_parameters
+ * @brief Define this to the size of netapi default pktlib heap buffers This can be set at @ref 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)
+ * @ingroup netapi_tune_parameters
+ * @brief Define this to number of netapi default pktlib heap buffers (and assoc descriptors)
+ * this can be set at @ref 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
+/**
+ * @ingroup netapi_tune_parameters
+ * @brief Define this to  number of netapi default pkt lib heap solo descriptors
+ * this can be set at @ref netapi_init
  */
 #define TUNE_NETAPI_DEFAULT_NUM_SOLO_DESCRIPTORS  100 
 
 /**
- * @def NETAPI_INCLUDE_SCHED
- * (6) define this to include the scheduler component
+ * @ingroup netapi_tune_parameters
+* @brief  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 */
+/**
+ * @ingroup netapi_tune_parameters
+* @brief  Define this to the number of of QM descriptors (total). This can be set set in @ref netapi_init
+* @note MUST BE POWER OF 2
+*/
+#define TUNE_NETAPI_QM_CONFIG_MAX_DESC_NUM  2048 /* 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!!
+#define TUNE_NETAPI_NUM_GLOBAL_DESC  1024 
 
+#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_CONFIG_MAX_PA_TO_SA_DESC       32
+#define TUNE_NETAPI_CONFIG_MAX_SA_TO_PA_DESC       32
 
 #define TUNE_NETAPI_MAX_NUM_MAC                2    //2 'logical' mac addresses
-#define TUNE_NETAPI_MAX_NUM_IP                 2    //2 ip addresses 
+#define TUNE_NETAPI_MAX_NUM_IP                 32    //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     2
+#define TUNE_NETAPI_MAX_NUM_IPSEC_CHANNELS     32
 #else
 #define TUNE_NETAPI_MAX_NUM_IPSEC_CHANNELS     0
 #endif
-#define TUNE_NETAPI_MAX_NUM_L2_L3_HDRS         2
+#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_BUF  16 
+#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_PER_INTERFACE 2  //2 ip's per interface
+#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