index 336c0bf78c853a1e97a7b893ee7b5242d48663bf..21cd90c2309902b9c3b15e9d1ca9d2ca53ff6c3c 100755 (executable)
-/*******************************
+/***********************************************************************
* FILE: netapi.c
- * Purpose: implementation of netapi startup/shutdown
- **************************************************************
+ * Purpose: Main initialization and shutdown routines of NETAPI
+ * user space transport library.
+ ***********************************************************************
* FILE: netapi.c
*
* DESCRIPTION: netapi main source file for user space transport
* library
*
- * REVISION HISTORY: rev 0.0.1
+ * REVISION HISTORY:
*
- * Copyright (c) Texas Instruments Incorporated 2010-2011
+ * Copyright (c) Texas Instruments Incorporated 2013
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *****************************/
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include "netapi.h"
-#include "src/netapi_loc.h"
-
-
-/*------------internal prototypes---------------*/
-static uint8_t* netapiSharedMemoryMalloc(uint32_t size);
-static void netapiSharedMemoryFree(uint8_t* ptr, uint32_t size);
-static int system_init(NETAPI_HANDLE_T *);
-static void netapi_cleanup_at_start(void);
-
-/*------------globals-----------------*/
-#define NUM_HOST_DESC (TUNE_NETAPI_NUM_LOCAL_DESC)
-#define SIZE_LOCAL_DESC (TUNE_NETAPI_DESC_SIZE)
-#define SIZE_SHARED_DESC (TUNE_NETAPI_DESC_SIZE)
-
-#define CONFIG_BUFSIZE_PA_INST 256
-#define CONFIG_BUFSIZE_L2_TABLE 1000
-#define CONFIG_BUFSIZE_L3_TABLE 4000
+#include <unistd.h>
+#include "ti/runtime/netapi/netapi.h"
+#include "netapi_loc.h"
static NETAPI_CFG_T netapi_default_cfg=
{
-TUNE_NETAPI_PERM_MEM_SZ,
-0, //start of packet offset for hw to place data on rx for default flow
-TUNE_NETAPI_QM_CONFIG_MAX_DESC_NUM, //max number of descriptors in system
-TUNE_NETAPI_NUM_GLOBAL_DESC, //total we will use
-TUNE_NETAPI_DEFAULT_NUM_BUFFERS, //#descriptors+buffers in default heap
-TUNE_NETAPI_DEFAULT_NUM_SOLO_DESCRIPTORS, //#descriptors w/o buffers in default heap
-TUNE_NETAPI_DEFAULT_BUFFER_SIZE, //size of buffers in default heap
-0,0
+ TUNE_NETAPI_PERM_MEM_SZ,
+ 0, //start of packet offset for hw to place data on rx for default flow
+ TUNE_NETAPI_QM_CONFIG_MAX_DESC_NUM, //max number of descriptors in system
+ TUNE_NETAPI_NUM_GLOBAL_DESC, //total we will use
+ TUNE_NETAPI_DEFAULT_NUM_BUFFERS, //#descriptors+buffers in default heap
+ TUNE_NETAPI_DEFAULT_NUM_SOLO_DESCRIPTORS, //#descriptors w/o buffers in default heap
+ TUNE_NETAPI_DEFAULT_BUFFER_SIZE, //size of buffers in default heap
+ 0,0
};
/* Global variablesto hold virtual address of various subsystems */
hplib_virtualAddrInfo_T netapi_VM_VirtAddr[HPLIB_MAX_MEM_POOLS];
+
/* Global variables which needs to be populated with memory pool attributes
- which is passed to HPLIB for memory pool initialization*/
+ which is passed to HPLIB for memory pool initialization*/
hplib_memPoolAttr_T netapi_VM_MempoolAttr[HPLIB_MAX_MEM_POOLS];
unsigned char *netapi_VM_QMemLocalDescRam;
unsigned char *netapi_VM_QMemGlobalDescRam;
unsigned char *netapi_VM_SaContextVaddr;
-static Pktlib_HeapIfTable netapi_pktlib_ifTable;
-static NETAPI_GLOBAL_T netapi_global;
+Pktlib_HeapIfTable netapi_pktlib_ifTable;
+NETAPI_GLOBAL_T netapi_global;
NETAPI_GLOBAL_T * netapi_get_global(){ return &netapi_global;}
/* utility API for NETAPI user to get pktlib if table to use if he creates his own heap */
Pktlib_HeapIfTable *netapi_getPktlibIfTable(void) {return &netapi_pktlib_ifTable;}
-//zap a queue
-void netapi_zapQ(int queueNum);\
-
/********************************************************************
* FUNCTION PURPOSE: API instantiates the NETAPI and allocated global resources.
#ifdef NETAPI_INCLUDE_SCHED
/* create space for scheduler */
p->p_sched = calloc(1,sizeof(NETAPI_SCHED_HANDLE_T));
+ if (!p->p_sched)
+ {
+ goto ERR_netapi_init;
+ }
#endif
-
- /* global stuff (if master) */
+ /* Global init for SYS_MATER */
if (master==NETAPI_SYS_MASTER)
{
if (p_cfg)
//this goes to shared memory eventually
p->global = (void *) &netapi_global;
- //dalmt: save master's handle back in global; else for slave retrieve p_master
+ //save master's handle back in global; else for slave retrieve p_master
if (master==NETAPI_SYS_MASTER)
{
netapi_global.p_master = p;
/* system init */
if(master==NETAPI_SYS_MASTER)
{
- err = system_init(p);
- netcp_cfgExceptions(p, NETCP_CFG_ALL_EXCEPTIONS, NETCP_CFG_ACTION_TO_SW, (NETCP_CFG_ROUTE_HANDLE_T) NULL);
+ err = netapip_systemInit(p);
+ netapi_netcpCfgExceptions(p, NETCP_CFG_ALL_EXCEPTIONS, NETCP_CFG_ACTION_TO_SW, (NETCP_CFG_ROUTE_HANDLE_T) NULL);
if (err<0)
{
- //todo: cleanup
- return NULL;
+ goto ERR_netapi_init;
}
/* create pktio channels for tx,rx */
}
{
/* Start the QMSS. */
- if (netapi_start_qm() != 1)
+ if (netapip_startQm() != 1)
{
- return -1;
+ goto ERR_netapi_init;
}
- netapi_start_nwal(p_master->netcp_heap,
+ netapip_startNwal(p_master->netcp_heap,
p_master->netcp_control_rx_heap,
p_master->netcp_control_tx_heap,
&p->nwal_local,
}
else
{
- printf("netapi_init: no master specified\n");
- return -1;
+ netapi_Log("netapi_init: no master specified\n");
+ goto ERR_netapi_init;
}
return (NETAPI_T) p;
+
+ERR_netapi_init:
+ for(i=0;i<TUNE_NETAPI_MAX_PKTIO; i++)
+ {
+ if (p->pktios[i])
+ {
+ free(p->pktios[i]);
+ }
+ }
+#ifdef NETAPI_INCLUDE_SCHED
+ if (p->p_sched)
+ {
+ free(p->p_sched);
+ }
+#endif
+ return NULL;
}
/********************************************************************
NETAPI_HANDLE_T * p = (NETAPI_HANDLE_T *) h;
if (!p) return;
- printf(">netapi: WARNING shutdown may not be fully implemented\n");
+ netapi_Log("netapi: WARNING shutdown may not be fully implemented\n");
if (p->master ==NETAPI_SYS_MASTER)
{
/* close nwal */
netapi_closeHeap(h, netapi_get_global()->nwal_context.pa2sa_heap);
netapi_closeHeap(h, netapi_get_global()->nwal_context.sa2pa_heap);
+ /* Un-configure rules for execption packet handling */
+ netapi_netcpCfgExceptions(p,
+ NETCP_CFG_ALL_EXCEPTIONS,
+ NETCP_CFG_ACTION_DISCARD,
+ (NETCP_CFG_ROUTE_HANDLE_T) NULL);
//loop over registered heaps
for(i=0;i<TUNE_NETAPI_MAX_HEAPS;i++)
{
if (p->createdHeaps[i]) {netapi_closeHeap(h,p->createdHeaps[i]);p->createdHeaps[i]=NULL;}
}
- netapi_cleanup_at_start(); //clear 1st 50 not-specified queues..
+ netapip_cleanupAtStart(); //clear 1st 50 not-specified queues..
hplib_vmTeardown();
}
free(p);
return;
}
-
-/********************************************************************
-* FUNCTION PURPOSE: NETAPI internal function to gracefully cleanup when startup
-* issue occurs.
- ********************************************************************
- * DESCRIPTION: NETAPI internal function to gracefully cleanup when startup
-* issue occurs.
- ********************************************************************/
-void netapi_err_teardown() { netapi_cleanup_at_start(); exit(-99); }
-
-
-/***************************************************************************
-* FUNCTION PURPOSE: NETAPI internal function for virtual memory allocation.
- ***************************************************************************
- * DESCRIPTION: NETAPI internal function for virtual memory allocation.
- **************************************************************************/
-
-static uint8_t* netapiSharedMemoryMalloc(uint32_t size)
-{
-return (uint8_t *)hplib_vmMemAlloc(size +netapi_global.cfg.def_heap_extra_size , 128, 0);
-}
-
-/********************************************************************
-* FUNCTION PURPOSE: NETAPI internal function for virtual memory free.
- ********************************************************************
- * DESCRIPTION: NETAPI internal function for virtual memory free.
- ********************************************************************/
-static void netapiSharedMemoryFree(uint8_t* ptr, uint32_t size)
-{
- /* Do Nothing. */
- printf(">netapi Unexpected. need to provide a free () for some reason!! \n");
- return;
-}
-
-/********************************************************************
-* FUNCTION PURPOSE: NETAPI internal function system initialization
- ********************************************************************
- * DESCRIPTION: NETAPI internal function system initialization
- ********************************************************************/
-static int system_init(NETAPI_HANDLE_T * handle)
-{
- int32_t result;
- Pktlib_HeapHandle sharedHeapHandle;
- Pktlib_HeapHandle controlRxHeapHandle,controlTxHeapHandle;
- Pktlib_HeapCfg heapCfg;
- int32_t errCode;
- int count=0;
-
-#ifdef NETAPI_USE_DDR
- /* Init attributes for DDR */
- netapi_VM_MempoolAttr[0].attr = HPLIB_ATTR_KM_CACHED0;
- netapi_VM_MempoolAttr[0].phys_addr = 0;
- netapi_VM_MempoolAttr[0].size = 0;
-
- /* Init attributes for un-cached MSMC */
- netapi_VM_MempoolAttr[1].attr = HPLIB_ATTR_UN_CACHED;
- netapi_VM_MempoolAttr[1].phys_addr = CSL_MSMC_SRAM_REGS;
- netapi_VM_MempoolAttr[1].size = TUNE_NETAPI_PERM_MEM_SZ;
-#else
- netapi_VM_MempoolAttr[1].attr = HPLIB_ATTR_KM_CACHED0;
- netapi_VM_MempoolAttr[1].phys_addr = 0;
- netapi_VM_MempoolAttr[1].size = 0;
-
- /* Init attributes for un-cached MSMC */
- netapi_VM_MempoolAttr[0].attr = HPLIB_ATTR_UN_CACHED;
- netapi_VM_MempoolAttr[0].phys_addr = CSL_MSMC_SRAM_REGS;
- netapi_VM_MempoolAttr[0].size = TUNE_NETAPI_PERM_MEM_SZ;
-#endif
- /* initialize all the memory we are going to use
- - chunk for buffers, descriptors
- - memory mapped peripherals we use, such as QMSS, PA, etc */
- result = hplib_vmInit(&netapi_VM_VirtAddr[0], 2, &netapi_VM_MempoolAttr[0]);
-
- /* TODO: at this point, we need to create the QM regions which need to moved out of the above
- netapi_VM_memory_setup() call, also need to move out the SA context stuff */
-
- if (result == hplib_OK) printf(">netapi: system init - memory set up OK\n");
- else {printf(">netap: system init - memory set up failed\n"); return -1;}
-
-
-#ifdef NETAPI_ENABLE_SECURITY
-#define SEC_CONTEXT_SZ 384 //not tunable
-/* allocate 2x number of tunnels since we need one for inflow and one for data mode */
- netapi_VM_SaContextVaddr = hplib_vmMemAlloc((TUNE_NETAPI_MAX_NUM_IPSEC_CHANNELS*2 *
- SEC_CONTEXT_SZ), 128, 0);
- if (!netapi_VM_SaContextVaddr)
- {
- printf(">netapi ERROR: Failed to map SA context memory region\n");
- return (-1);
- }
- printf(">hplib VM_SaContext: Memory mapped/allocated at address %p.\n", netapi_VM_SaContextVaddr);
-
-#else
- netapi_VM_SaContextVaddr= (char *) NULL;
-#endif
-
-/* TODO: the QM regions is application specific and needs to be moved since number of regions created is appliction specific, put this in system_init */
- /* (3) Allocate 2 QM regions from continguous chunk above */
- netapi_VM_QMemGlobalDescRam =
- (void *)hplib_vmMemAlloc((TUNE_NETAPI_NUM_GLOBAL_DESC *
- TUNE_NETAPI_DESC_SIZE),
- 128, 0);
-
- netapi_VM_QMemLocalDescRam =
- (void *)hplib_vmMemAlloc((TUNE_NETAPI_NUM_LOCAL_DESC *
- TUNE_NETAPI_DESC_SIZE),
- 128, 0);
- printf("netapi local desc region=%x global desc region=%x\n", netapi_VM_QMemLocalDescRam, netapi_VM_QMemGlobalDescRam);
-
- //get timer running
-#ifdef CORTEX_A8
- netapi_init_timer();
-#endif
- printf("system_init: returned from netapi_init_timer\n");
-
- /* Initialize Queue Manager Sub System */
- result = netapi_init_qm (netapi_global.cfg.def_max_descriptors);
-
- if (result != 1)
- {
- printf("system_init: returned from netapi_init_qm with failure\n");
- return -1;
- }
-
- /* Start the QMSS. */
- if (netapi_start_qm() != 1)
- {
- printf("system_init: returned from netapi_start_qm with failure\n");
- return -1;
- }
-
-
- //clean our old junk in 1st bunch of queues that will be allocated to us
- netapi_cleanup_at_start();
- printf("system_init: returned from netapi_cleanup_at_start\n");
- /* Initialize the global descriptor memory region. */
- result= netapi_qm_setup_mem_region(
- netapi_global.cfg.def_tot_descriptors_for_us,
- SIZE_SHARED_DESC,
- (unsigned int *) netapi_VM_QMemGlobalDescRam,
- NETAPI_GLOBAL_REGION);
- if(result <0) {printf(">netapi; can't setup QM shared region\n"); return -1;}
-
-printf(">system_init: returned from netapi_qm_setup_mem_region\n");
-#if 0 //todo setup 2nd region
-/* Initialize the local memory region configuration. */
- result= netapi_qm_setup_mem_region(
- NUM_HOST_DESC,
- SIZE_LOCAL_DESC,
- netapi_VM_QMemLocalDescRam,
- NETAPI_LOCAL_REGION);
- if(result <0) {printf("can't setup local region\n"); return -1;}
-#endif
- /* Initialize CPPI CPDMA */
-
- result = netapi_init_cppi ();
- printf(">system_init: returned from netapi_init_cppi\n");
- if (result != 1)
- {
- printf (">netapi: Error initializing CPPI SubSystem error code : %d\n",result);
- return -1;
- }
-
- /* CPPI and Queue Manager are initialized. */
- printf (">netapi: Queue Manager and CPPI are initialized.\n");
-
- /* create main pkt heap */
- /* Initialize the Shared Heaps. */
- Pktlib_sharedHeapInit();
- printf(">system_init: returned from Pktlib_sharedHeapInit\n");
- /* Populate the heap interface table. */
- netapi_pktlib_ifTable.data_malloc = netapiSharedMemoryMalloc;
- netapi_pktlib_ifTable.data_free = netapiSharedMemoryFree;
-
- /* Initialize the heap configuration. */
- memset ((void *)&heapCfg, 0, sizeof(Pktlib_HeapCfg));
- /* Populate the heap configuration */
- heapCfg.name = "netapi";
- heapCfg.memRegion = NETAPI_GLOBAL_REGION;
- heapCfg.sharedHeap = 1;
- heapCfg.useStarvationQueue = 0;
- heapCfg.dataBufferSize = netapi_global.cfg.def_heap_buf_size;
- heapCfg.numPkts = netapi_global.cfg.def_heap_n_descriptors;
- heapCfg.numZeroBufferPackets= netapi_global.cfg.def_heap_n_zdescriptors;
- heapCfg.heapInterfaceTable.data_malloc = netapi_pktlib_ifTable.data_malloc;
- heapCfg.heapInterfaceTable.data_free = netapi_pktlib_ifTable.data_free;
- heapCfg.dataBufferPktThreshold = 0;
- heapCfg.zeroBufferPktThreshold = 0;
-
- /* Create Shared Heap with specified configuration. */
- sharedHeapHandle = Pktlib_createHeap(&heapCfg, &errCode);
- printf(">system_init: returned from Pktlib_createHeap1\n");
- //todo -> cleanup on failure
- if (!sharedHeapHandle) { printf(">'netapi' heap create failed, Error Code: %d\n",errCode); return -1;}
- handle->netcp_heap= sharedHeapHandle;
-
-
- /* Update for Control */
- heapCfg.name = "netapi_control_rx";
- heapCfg.sharedHeap = 1;
- heapCfg.dataBufferSize = TUNE_NETAPI_CONFIG_MAX_CTL_RXTX_BUF_SIZE;
- heapCfg.numPkts = TUNE_NETAPI_CONFIG_NUM_CTL_RX_BUF;
- heapCfg.numZeroBufferPackets= 0;
-
- controlRxHeapHandle = Pktlib_createHeap(&heapCfg, &errCode);
- printf(">system_init: returned from Pktlib_createHeap2\n");
- //todo -> cleanup on failure
- if (!controlRxHeapHandle) { printf(">netapi -'netapi_control_rx' heap create failed, Error Code: %d\n",errCode); return -1;}
- handle->netcp_control_rx_heap= controlRxHeapHandle;
-
-
- heapCfg.name = "netapi_control_tx";
- heapCfg.numPkts = TUNE_NETAPI_CONFIG_NUM_CTL_TX_BUF;
-
- controlTxHeapHandle = Pktlib_createHeap(&heapCfg, &errCode);
- printf(">system_init: returned from Pktlib_createHeap3\n");
- //todo -> cleanup on failure
- if (!controlTxHeapHandle) { printf(">netapi -'netapi_control_tx' heap create failed, Error Code: %d\n",errCode); return -1;}
- handle->netcp_control_tx_heap= controlTxHeapHandle;
-
- /* now NWAL */
- result = netapi_init_nwal(
- NETAPI_GLOBAL_REGION,
- &netapi_pktlib_ifTable,
- &netapi_global.nwal_context,
- &netapi_global.cfg);
- if (result<0) {printf(">netapi init_nwal() failed\n"); return -1; }
- printf("system_init: returned from netapi_init_nwal\n");
- /* start NWAL */
-
-
- /* Common Initialization for all cores */
- while(count < TUNE_NETAPI_MAX_NUM_TRANS)
- {
- netapi_global.nwal_context.transInfos[count].transId = count;
- count++;
- }
- result = netapi_start_nwal(sharedHeapHandle,
- controlRxHeapHandle,
- controlTxHeapHandle,
- &handle->nwal_local,
- &netapi_global.cfg,
- &netapi_global.nwal_context);
- if (result<0) {printf("netapi start_nwal() failed\n"); return -1; }
- printf("system_init: returned from netapi_start_nwal\n");
- return 0;
-}
-
-/*************************************************************
- ******************MISC INTERNAL******************************
-**************************************************************/
-
/***********************************************************************
-* FUNCTION PURPOSE: NETAPI internal function to poll the internal heaps
-* and any application created heaps that have been registered
-* with NETAPI instance.
+* FUNCTION PURPOSE: API is used to poll for NETCP configuration response messages.
************************************************************************
-* DESCRIPTION: The poll function checks the garbage collection queue associated
-* with the heap and returnsdescriptors and buffers when appropriate
-* to the main free queue.
+* DESCRIPTION: This API is used to poll the netapi internal heaps and any
+ * application-created heaps that have been registered with
+ * the netapi instance. The poll function checks the garbage collection
+ * queue associated with the heap and returns descriptors and buffers
+ * when appropriate to the main free queue.
***********************************************************************/
void netapi_pollHeapGarbage(NETAPI_T h)
{
}
/****************************************************************************
-* FUNCTION PURPOSE: NETAPI internal function which poll NETCP control queue
-* for responses
+* FUNCTION PURPOSE: API is used to poll for NETCP configuration response messages.
****************************************************************************
-* DESCRIPTION: NETAPI internal function which poll NETCP control queue
-* for responses
+* DESCRIPTION: This API is used to poll the netapi internal heaps and any
+ * application-created heaps that have been registered with the
+ * netapi instance. The poll function checks the garbage collection
+ * queue associated with the heap and returns descriptors and buffers
+ * when appropriate to the main free queue.
***************************************************************************/
void netapi_netcpPoll(NETAPI_T p)
{
nwal_pollCtl( ((NETAPI_GLOBAL_T *) (n->global))->nwal_context.nwalInstHandle,NULL,NULL);
}
-/****************************************************************
- *****************Cleanup Functions******************************
-*****************************************************************/
-
-/****************************************************************************
-* FUNCTION PURPOSE: NETAPI internal function which performs clean for linux user space
- ****************************************************************************
- * DESCRIPTION: NETAPI internal function which performs clean for linux user space
- ***************************************************************************/
-void netapi_zapQ(int queueNum)
-{
- char * descPtr;
- int i;
- if (!queueNum) return;
- for (i=0;;i+=1 )
- {
- /* Pop descriptor from source queue */
- if ((descPtr = (char *)pktio_mQmssQueuePopRaw(queueNum)) == NULL)
- {
- break;
- }
- else {/*printf("netapi qzap in play\n");*/}
- }
- if(i) printf(">netapi: @recovery - %d descriptors cleaned from qn %d\n",i, queueNum);
-}
-
-//defensive: clean out stuff hanging around
-//
-// open a bunch of free queues and zap them
-#define NQUEUES2CLEAR 35
-static Qmss_QueueHnd tempQH[NQUEUES2CLEAR];
-static void netapi_cleanup_at_start(void)
-{
-int i;
-uint8_t isAllocated;
-
-for(i=0;i<NQUEUES2CLEAR;i++)
-{
- tempQH[i] = Qmss_queueOpen(Qmss_QueueType_GENERAL_PURPOSE_QUEUE,
- QMSS_PARAM_NOT_SPECIFIED, &isAllocated);
- netapi_zapQ(tempQH[i]);
-}
-
-for(i=0;i<NQUEUES2CLEAR;i++)
-{
- Qmss_queueClose(tempQH[i]);
-}
-
-}
-
-/****************************************************************************
-* FUNCTION PURPOSE: NETAPI internal function to display internal heap stats.
- ****************************************************************************
- * DESCRIPTION: NETAPI internal function to display internal heap stats.
- ***************************************************************************/
-void netapi_dump_internal_heap_stats(void)
-{
- Pktlib_HeapStats pktLibHeapStats;
- Pktlib_getHeapStats(netapi_get_global()->nwal_context.pa2sa_heap,&pktLibHeapStats);
- printf("PA2SA(ingress) stats> #free=%d #zb=%d #garbage=%d\n", pktLibHeapStats.numFreeDataPackets,
- pktLibHeapStats.numZeroBufferPackets, pktLibHeapStats.numPacketsinGarbage);
- printf(" > #dataBufThreshStatus=%d #dataBufStarvCounter=%d #zBufThreshStatus=%d #zBufStarvCounter=%d \n",
- pktLibHeapStats.dataBufferThresholdStatus,pktLibHeapStats.dataBufferStarvationCounter,
- pktLibHeapStats.zeroDataBufferThresholdStatus, pktLibHeapStats.zeroDataBufferStarvationCounter);
-#if 0
-Pktlib_getHeapStats(netapi_get_global()->nwal_context.pa2saTX_heap,&pktLibHeapStats);
-printf("PA2SA(egress) stats> #free=%d #zb=%d #garbage=%d\n", pktLibHeapStats.numFreeDataPackets,
- pktLibHeapStats.numZeroBufferPackets, pktLibHeapStats.numPacketsinGarbage);
-printf(" > #dataBufThreshStatus=%d #dataBufStarvCounter=%d #zBufThreshStatus=%d #zBufStarvCounter=%d \n",
- pktLibHeapStats.dataBufferThresholdStatus,pktLibHeapStats.dataBufferStarvationCounter,
- pktLibHeapStats.zeroDataBufferThresholdStatus, pktLibHeapStats.zeroDataBufferStarvationCounter);
-#endif
- Pktlib_getHeapStats(netapi_get_global()->nwal_context.sa2pa_heap,&pktLibHeapStats);
- printf("SA2PA stats> #free=%d #zb=%d #garbage=%d\n", pktLibHeapStats.numFreeDataPackets,
- pktLibHeapStats.numZeroBufferPackets, pktLibHeapStats.numPacketsinGarbage);
- printf(" > #dataBufThreshStatus=%d #dataBufStarvCounter=%d #zBufThreshStatus=%d #zBufStarvCounter=%d \n",
- pktLibHeapStats.dataBufferThresholdStatus,pktLibHeapStats.dataBufferStarvationCounter,
- pktLibHeapStats.zeroDataBufferThresholdStatus, pktLibHeapStats.zeroDataBufferStarvationCounter);
-
-}
-
-
-
-
-
-
-