index ea257fd4ff04e8ddb42385c272a863b14d0f6ec6..69934e7d51adc28cd6e9974de552e73e3693d206 100755 (executable)
result = Qmss_insertMemoryRegion (&memInfo);
if (result < QMSS_SOK)
{
- netapi_Log (">function setup_qm_region: Qmss_insertMemoryRegion returned error code %d\n", result);
- return (-1);
+ netapi_Log ("netapip_qmSetupMemRegion: Qmss_insertMemoryRegion returned error code %d\n", result);
+ return (-1);
}
return 1;
-
}
/********************************************************************
result = Qmss_start();
if (result != QMSS_SOK)
{
- netapi_Log (">start_qm: Qmss_start failed with error code %d\n", result);
+ netapi_Log ("netapip_startQm: Qmss_start failed with error code %d\n", result);
return (-1);
}
return 1;
#define NETAPI_NWAL_CONFIG_BUFSIZE_PA_BUF1 128 * TUNE_NETAPI_MAX_NUM_MAC
uint8_t paBuf1[NETAPI_NWAL_CONFIG_BUFSIZE_PA_BUF1]ALIGN(CACHE_LINESZ);
-//#define NETAPI_NWAL_CONFIG_BUFSIZE_PA_BUF2 768
-//#define NETAPI_NWAL_CONFIG_BUFSIZE_PA_BUF2 6144
-#define NETAPI_NWAL_CONFIG_BUFSIZE_PA_BUF2 12288
+#define NETAPI_NWAL_CONFIG_BUFSIZE_PA_BUF2 13824
uint8_t paBuf2[NETAPI_NWAL_CONFIG_BUFSIZE_PA_BUF2]ALIGN(CACHE_LINESZ);
/* Memory used for SA LLD global Handle */
-#define NETAPI_NWAL_CONFIG_BUFSIZE_SA_LLD_HANDLE 384
+#define NETAPI_NWAL_CONFIG_BUFSIZE_SA_LLD_HANDLE 512
uint8_t salldHandle[NETAPI_NWAL_CONFIG_BUFSIZE_SA_LLD_HANDLE]ALIGN(CACHE_LINESZ);
#if 0 //need to alloc this since we need phy addr also
@@ -230,6 +227,16 @@ uint8_t saContext[NETAPI_NWAL_CONFIG_BUFSIZE_SA_CONTEXT_PER_CHAN * TUNE_NETAPI_M
#define NETAPI_NWAL_CONFIG_BUFSIZE_SA_LLD_HANDLE_PER_CHAN 512
uint8_t salldChanHandle[NETAPI_NWAL_CONFIG_BUFSIZE_SA_LLD_HANDLE_PER_CHAN * TUNE_NETAPI_MAX_NUM_IPSEC_CHANNELS*2]ALIGN(CACHE_LINESZ);
+
+/********************************************************************
+* FUNCTION PURPOSE: NETAPI internal function to gracefully cleanup when startup
+* issue occurs.
+ ********************************************************************
+ * DESCRIPTION: NETAPI internal function to gracefully cleanup when startup
+* issue occurs.
+ ********************************************************************/
+void netapipErrTeardown() { netapip_cleanupAtStart(); exit(-99); }
+
/********************************************************************
* FUNCTION PURPOSE: Internal NETAPI function to initialize NWAL subsystem
********************************************************************
Pktlib_createHeap(&heapCfg, &errCode);
if(nwalGlobCfg.pa2SaBufPool.bufPool[0].heapHandle == NULL)
{
- netapi_Log (">Pktlib_createHeap:Heap Creation Failed for PA to SA Buffer Pool , Error Code: %d\n",errCode);
- netapi_err_teardown();
+ netapi_Log ("netapip_initNwal: Pktlib_createHeap:Heap Creation Failed for PA to SA Buffer Pool, Error Code: %d\n",
+ errCode);
+ netapipErrTeardown();
return -1;
}
Pktlib_createHeap(&heapCfg, &errCode);
if(nwalGlobCfg.sa2PaBufPool.bufPool[0].heapHandle == NULL)
{
- netapi_Log (">Pktlib_createHeap:Heap Creation Failed for SA to PA Buffer Pool , Error Code: %d\n",errCode);
- netapi_err_teardown();
+ netapi_Log ("netapip_initNwal: Pktlib_createHeap:Heap Creation Failed for SA to PA Buffer Pool, Error Code: %d\n",
+ errCode);
+ netapipErrTeardown();
return -1;
}
aligns);
if(nwalRetVal != nwal_OK)
{
- netapi_Log ("netapi: init_nwal - nwal_getBufferReq Failed %d\n", nwalRetVal);
+ netapi_Log ("netapip_initNwal: nwal_getBufferReq Failed %d\n", nwalRetVal);
return nwal_FALSE;
}
bases[nwal_BUF_INDEX_INT_HANDLES] = (uint32_t *)Osal_nwalLocToGlobAddr((uint32_t)nwalHandleMem);
if(NWAL_CHAN_HANDLE_SIZE < sizes[nwal_BUF_INDEX_INT_HANDLES])
{
- netapi_Log("one\n");
/* Resize Memory */
while(1);
}
if((NETAPI_NWAL_CONFIG_BUFSIZE_PA_BUF0) < sizes[nwal_BUF_INDEX_PA_LLD_BUF0])
{
/* Resize Memory */
- netapi_Log("two\n");
while(1);
}
count++;
bases[nwal_BUF_INDEX_PA_LLD_BUF1] = (uint32_t *)Osal_nwalLocToGlobAddr((uint32_t)paBuf1);
- netapi_Log("NETAPI_NWAL_CONFIG_BUFSIZE_PA_BUF1 %d, size[nwal_BUF_INDEX_PA_LLD_BUF1] %d\n",
- NETAPI_NWAL_CONFIG_BUFSIZE_PA_BUF1, sizes[nwal_BUF_INDEX_PA_LLD_BUF1]);
if((NETAPI_NWAL_CONFIG_BUFSIZE_PA_BUF1) < sizes[nwal_BUF_INDEX_PA_LLD_BUF1])
{
- netapi_Log("NETAPI_NWAL_CONFIG_BUFSIZE_PA_BUF1 %d, size[nwal_BUF_INDEX_PA_LLD_BUF1] %d\n",
- NETAPI_NWAL_CONFIG_BUFSIZE_PA_BUF1, sizes[nwal_BUF_INDEX_PA_LLD_BUF1]);
/* Resize Memory */
while(1);
}
bases[nwal_BUF_INDEX_PA_LLD_BUF2] = (uint32_t *)Osal_nwalLocToGlobAddr((uint32_t)paBuf2);
if((NETAPI_NWAL_CONFIG_BUFSIZE_PA_BUF2) < sizes[nwal_BUF_INDEX_PA_LLD_BUF2])
{
- netapi_Log("four\n");
/* Resize Memory */
while(1);
}
bases[nwal_BUF_INDEX_SA_LLD_HANDLE] = (uint32_t *)Osal_nwalLocToGlobAddr((uint32_t)salldHandle);
if((NETAPI_NWAL_CONFIG_BUFSIZE_SA_LLD_HANDLE) < sizes[nwal_BUF_INDEX_SA_LLD_HANDLE])
{
- netapi_Log("five\n");
/* Resize Memory */
while(1);
}
if((NETAPI_NWAL_CONFIG_BUFSIZE_SA_LLD_HANDLE_PER_CHAN * TUNE_NETAPI_MAX_NUM_IPSEC_CHANNELS*2) <
sizes[nwal_BUF_INDEX_SA_LLD_CHAN_HANDLE])
{
- netapi_Log("netapip_initNwal: sizes[nwal_BUF_INDEX_SA_LLD_CHAN_HANDLE] %d\n", sizes[nwal_BUF_INDEX_SA_LLD_CHAN_HANDLE]);
/* Resize Memory */
while(1);
}
&p_nwal_context->nwalInstHandle);
if(nwalRetVal != nwal_OK)
{
- netapi_Log ("netapi: init_nwal- nwal_create Failed %d\n",nwalRetVal);
+ netapi_Log ("netapip_initNwal: nwal_create Failed %d\n",nwalRetVal);
while(1);
}
- netapi_Log("netapi: init_nwal - Global and Local Network initialization Successful \n");
+ netapi_Log("netapip_initNwal- Global and Local Network initialization Successful \n");
return 1;
}
nwalLocCfg.rxPktTailRoomSz = p_cfg->def_heap_tailroom_size;
/* Call back registration for the core */
- nwalLocCfg.pRxPktCallBack = netapi_NWALRxPktCallback;
- nwalLocCfg.pCmdCallBack = netapi_NWALCmdCallBack;
- nwalLocCfg.pPaStatsCallBack = netapi_NWALCmdPaStatsReply;
- nwalLocCfg.pRxDmCallBack= netapi_NWALSBPktCallback; //sideband mode callback
+ nwalLocCfg.pRxPktCallBack = netapip_pktioNWALRxPktCallback;
+ nwalLocCfg.pCmdCallBack = netapip_netcpCfgNWALCmdCallBack;
+ nwalLocCfg.pPaStatsCallBack = netapip_netcpCfgNWALCmdPaStatsReply;
+
+ nwalLocCfg.pRxDmCallBack= netapip_pktioNWALSBPktCallback; //sideband mode callback
/* Initialize Buffer Pool for Control packets from NetCP to Host */
nwalLocCfg.rxCtlPool.numBufPools = 1;
#endif
}
-/********************************************************************
-* 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() { netapip_cleanupAtStart(); exit(-99); }
+
/***************************************************************************
- 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) netapi_Log("netapi: system init - memory set up OK\n");
- else {netapi_Log(">netap: system init - memory set up failed\n"); return -1;}
+ if (result == hplib_OK) netapi_Log("netapip_systemInit: - memory set up OK\n");
+ else {netapi_Log("netapip_systemInit: - memory set up failed\n"); return -1;}
#ifdef NETAPI_ENABLE_SECURITY
SEC_CONTEXT_SZ), 128, 0);
if (!netapi_VM_SaContextVaddr)
{
- netapi_Log("netapi ERROR: Failed to map SA context memory region\n");
+ netapi_Log("netapip_systemInit: Failed to map SA context memory region\n");
return (-1);
}
- netapi_Log(">hplib VM_SaContext: Memory mapped/allocated at address %p.\n", netapi_VM_SaContextVaddr);
+ netapi_Log("netapip_systemInit: SA Memory mapped/allocated at address %p.\n", netapi_VM_SaContextVaddr);
#else
netapi_VM_SaContextVaddr= (char *) NULL;
since number of regions created is appliction specific, put this in netapip_systemInit */
/* (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);
+ (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);
- netapi_Log("netapi local desc region=%x global desc region=%x\n", netapi_VM_QMemLocalDescRam, netapi_VM_QMemGlobalDescRam);
+ (void *)hplib_vmMemAlloc((TUNE_NETAPI_NUM_LOCAL_DESC *
+ TUNE_NETAPI_DESC_SIZE),
+ 128, 0);
+ netapi_Log("netapip_systemInit: desc region=%x global desc region=%x\n", netapi_VM_QMemLocalDescRam, netapi_VM_QMemGlobalDescRam);
//get timer running
#ifdef CORTEX_A8
netapip_initTimer();
+ netapi_Log("netapip_systemInit: returned from netapip_initTimer\n");
#endif
- netapi_Log("netapip_systemInit: returned from netapip_initTimer\n");
/* Initialize Queue Manager Sub System */
result = netapip_initQm (netapi_global.cfg.def_max_descriptors);
TUNE_NETAPI_DESC_SIZE,
(unsigned int *) netapi_VM_QMemGlobalDescRam,
TUNE_NETAPI_QM_GLOBAL_REGION);
- if(result <0) {netapi_Log("netapi; can't setup QM shared region\n"); return -1;}
+ if(result <0) {netapi_Log("netapip_systemInit: can't setup QM shared region\n"); return -1;}
netapi_Log("netapip_systemInit: returned from netapip_qmSetupMemRegion\n");
#if 0 //todo setup 2nd region
if (!sharedHeapHandle) { netapi_Log(">'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;
{
Pktlib_HeapStats pktLibHeapStats;
Pktlib_getHeapStats(netapi_get_global()->nwal_context.pa2sa_heap,&pktLibHeapStats);
- netapi_Log("PA2SA(ingress) stats> #free=%d #zb=%d #garbage=%d\n", pktLibHeapStats.numFreeDataPackets,
+ printf("PA2SA(ingress) stats> #free=%d #zb=%d #garbage=%d\n", pktLibHeapStats.numFreeDataPackets,
pktLibHeapStats.numZeroBufferPackets, pktLibHeapStats.numPacketsinGarbage);
- netapi_Log(" > #dataBufThreshStatus=%d #dataBufStarvCounter=%d #zBufThreshStatus=%d #zBufStarvCounter=%d \n",
+ printf(" > #dataBufThreshStatus=%d #dataBufStarvCounter=%d #zBufThreshStatus=%d #zBufStarvCounter=%d \n",
pktLibHeapStats.dataBufferThresholdStatus,pktLibHeapStats.dataBufferStarvationCounter,
pktLibHeapStats.zeroDataBufferThresholdStatus, pktLibHeapStats.zeroDataBufferStarvationCounter);
#if 0
pktLibHeapStats.zeroDataBufferThresholdStatus, pktLibHeapStats.zeroDataBufferStarvationCounter);
#endif
Pktlib_getHeapStats(netapi_get_global()->nwal_context.sa2pa_heap,&pktLibHeapStats);
- netapi_Log("SA2PA stats> #free=%d #zb=%d #garbage=%d\n", pktLibHeapStats.numFreeDataPackets,
+ printf("SA2PA stats> #free=%d #zb=%d #garbage=%d\n", pktLibHeapStats.numFreeDataPackets,
pktLibHeapStats.numZeroBufferPackets, pktLibHeapStats.numPacketsinGarbage);
- netapi_Log(" > #dataBufThreshStatus=%d #dataBufStarvCounter=%d #zBufThreshStatus=%d #zBufStarvCounter=%d \n",
+ printf(" > #dataBufThreshStatus=%d #dataBufStarvCounter=%d #zBufThreshStatus=%d #zBufStarvCounter=%d \n",
pktLibHeapStats.dataBufferThresholdStatus,pktLibHeapStats.dataBufferStarvationCounter,
pktLibHeapStats.zeroDataBufferThresholdStatus, pktLibHeapStats.zeroDataBufferStarvationCounter);