]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - keystone-rtos/netapi.git/commitdiff
This commit adds the following:
authorTinku Mannan <tmannan@ti.com>
Fri, 22 Feb 2013 14:29:49 +0000 (09:29 -0500)
committerTinku Mannan <tmannan@ti.com>
Fri, 22 Feb 2013 14:29:49 +0000 (09:29 -0500)
1. Changes to FLOW API
2. changes to tie switch port to mac address
3. Fix for INFLOW mode of operation

ti/runtime/netapi/netcp_cfg.h
ti/runtime/netapi/src/netapi_init.c
ti/runtime/netapi/src/netapi_loc.h
ti/runtime/netapi/src/netapi_sec.c
ti/runtime/netapi/src/netcp_cfg.c
ti/runtime/netapi/src/pktio.c

index 2e7c4503e8d901be39589025ec6c2cd66b0feca6..cf2b159e3639ad33a0bd91025446b7094f65c110 100755 (executable)
@@ -60,6 +60,7 @@
 typedef struct NETCP_CFG_FLOW_Tag
 {
     int flowid;         /**< flow id*/
+    int dma_engine;     /**< dma engine (QMSS, NETCP)*/
 } NETCP_CFG_FLOW_T;
 
 
@@ -351,6 +352,69 @@ typedef uint32_t NETCP_CFG_EXCEPTION_PKT_T;
 
 
 
+/**
+ *  @ingroup cfg_structures
+ *  @brief NETCP flow configuration information.
+ *  @details This structure is used to define key parameters for the receive flow to be created.
+ *           These include the flow index to use (or can be left un-specified), the dma_index
+ *           (specifying out of which CPPI DMA engine the flow should be allocated),
+ *           the receive offset (the byte offset into each buffer where received data should be placed),
+ *           and the drop policy for the DMA channel to use if there is no free buffer available (drop or block)
+ *
+ */
+typedef struct NETCP_CFG_FLOW_CONFIG_Tag
+{
+   int              flow_index;     /**< flow index to use or NETAPI_NETCP_FLOW_INDEX_ANY */
+/**
+ * @def NETAPI_NETCP_FLOW_INDEX_ANY
+ * @ingroup cfg_constants
+ *      This define is used to let NETAPI pick the flow index to use(for flow_index field)
+ */
+#define NETAPI_NETCP_FLOW_INDEX_ANY  CPPI_PARAM_NOT_SPECIFIED
+
+   int              dma_index;      /**< allocate flow out of which DMA */
+/**
+ * @def NETAPI_DMA_INFRASTRUCTURE
+ * @ingroup cfg_constants
+ *      This define is used specify a flow in the QMSS CPPI DMA (for dma_index field)
+ */
+#define NETAPI_DMA_INFRASTRUCTURE 0
+/**
+ * @def NETAPI_DMA_NETCP
+ * @ingroup cfg_constants
+ *      This define us usee specify a flow in the NETCP CPPI DMA (for dma_index field)
+ */
+#define NETAPI_DMA_NETCP 1
+
+   int              recv_offset;    /**< start of packet offset */
+
+   int              block;          /**< TRUE => DMA will wait for free descriptor if heap(s) are empty.
+                                         FALSE => DMA will discard */
+/**
+ * @def NETAPI_FLOW_DROP
+ * @ingroup cfg_constants
+ *      This define is used to indicate that the flow should institute a Block policy.
+ *      This means that the DMA should wait for a free descriptor/buffer to come available if
+ *      the free poll is empty (for the block field)
+ */
+#define NETAPI_FLOW_BLOCK 1
+/**
+ * @def NETAPI_FLOW_DROP
+ * @ingroup cfg_constants
+ *      This define us used to indicate that the flow should institute a Drop policy.
+ *      This means that the DMA should NOT wait for a free descriptor/buffer to come available
+ *      if the free poll is empty. The transfer will be aborted and the data will dropped (for block field)
+ */
+#define NETAPI_FLOW_DROP 0
+
+   PKTIO_HANDLE_T * p_dest_q;       /**<destination queue for this flow (may be overwrritten by source DMA) */
+} NETCP_CFG_FLOW_CONFIG_T;
+
+
+
+
+
+
 /**
  *  @ingroup cfg_functions
  *  @brief netapi_netcpCfgAddFlow   API to add a flow
@@ -360,7 +424,7 @@ typedef uint32_t NETCP_CFG_EXCEPTION_PKT_T;
  *  @param[in]  n    number of Pktlib_HeapHandle
  *  @param[in]  handles[]   Handles to Pktlib_HeapHandle
  *  @param[in]  sizes[]     must be <= heap corresponding heap size-recv_offset-any desired tail room
- *  @param[in]  recv_offset   bytes to save in front of packet
+ *  @param[in]  p_cfg   @ref NETCP_CFG_FLOW_CONFIG_T
  *  @param[out] err     pointer to error return
  *  @retval     NETCP flow handle, @ref NETCP_CFG_FLOW_HANDLE_T
  *  @pre       @ref netapi_init
@@ -369,7 +433,7 @@ NETCP_CFG_FLOW_HANDLE_T netapi_netcpCfgAddFlow(NETAPI_T h,
                                             int n, 
                                             Pktlib_HeapHandle handles[],
                                             int sizes[],
-                                            int recv_offset,
+                                            NETCP_CFG_FLOW_CONFIG_T * p_cfg,
                                             int * err );
 
 /**
index ea257fd4ff04e8ddb42385c272a863b14d0f6ec6..b346ff21511ec05c6e6f4563824586a6b2950a87 100755 (executable)
@@ -455,10 +455,11 @@ int netapip_startNwal(Pktlib_HeapHandle pkt_heap,
     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;
index f35483ea7fd1d104aa9dbde0225a0918192802b3..51bc44e25ff32b6af9377e582019760f99f1ef9e 100755 (executable)
@@ -251,21 +251,21 @@ int netapip_qmSetupMemRegion(
 
 
 //nwal callbacks
-void netapi_NWALRxPktCallback(uint32_t          appCookie,
+void netapip_pktioNWALRxPktCallback(uint32_t          appCookie,
                               uint16_t          numPkts,
                               nwalRxPktInfo_t*  pPktInfo,
                               uint64_t          timestamp,
                               nwal_Bool_t*      pFreePkt);
 
-void netapi_NWALCmdCallBack (nwal_AppId        appHandle,
+void netapip_netcpCfgNWALCmdCallBack (nwal_AppId        appHandle,
                           uint16_t            trans_id,
                           nwal_RetValue     ret);
 
-void netapi_NWALCmdPaStatsReply (nwal_AppId        appHandle,
+void netapip_netcpCfgNWALCmdPaStatsReply (nwal_AppId        appHandle,
                               nwal_TransID_t    trans_id,
                               paSysStats_t      *stats);
 
-void netapi_NWALSBPktCallback     (uint32_t            appCookie,
+void netapip_pktioNWALSBPktCallback     (uint32_t            appCookie,
                                 uint16_t             numPkts,
                                 nwalDmRxPayloadInfo_t*  pDmRxPktInfo,
                                 nwal_Bool_t*        pFreePkt);
index 08c90ae23ff98eaf14fa8c33cdd949c817e5b85f..a46d6625d7d13bd8160eb79490a6d29b737adc46 100755 (executable)
@@ -72,7 +72,32 @@ NETCP_CFG_SA_T netapi_secAddSA(NETAPI_T h,
     uint32_t    swInfo0;
     uint32_t    swInfo1;
 
-    nwalCreateSAParams_t    createParam;
+    nwalCreateSAParams_t    createParam =
+    {
+        /* mac handle */
+        NULL,  //to be filled in
+        4,
+        /*nwalSaIpSecParam_t */
+            {
+                0,/* validParams */
+                nwal_SA_MODE_TUNNEL,  //update from input
+                64,/* replayWindow */\
+                NWAL_SA_DIR_INBOUND,
+                0,
+                0,
+                NWAL_SA_AALG_HMAC_SHA1,/* update from input */
+                NWAL_SA_EALG_AES_CTR,  /* update from input */
+                { 0x00},      /* remMacAddr:  NA */
+                12,             /* update from input, mac size */
+                NWAL_MATCH_ACTION_CONTINUE_NEXT_ROUTE,/* Continue parsing to next route for match */
+                NWAL_NEXT_ROUTE_FAIL_ACTION_HOST,/* For next route fail action by default is route to host */
+                CPPI_PARAM_NOT_SPECIFIED,         /* Use default flow configured to NWAL  if packet is routed to host */
+                QMSS_PARAM_NOT_SPECIFIED          /* Use default queue configured to NWAL if packet is routed to host */
+           },
+           /* nwalSaIpSecKeyParams_t */
+           {0}
+    };
+
 
     void * mac_handle = netapip_netcpCfgGetMacHandle(&netapi_get_global()->nwal_context,iface_no);
     *perr =0;
@@ -97,10 +122,7 @@ NETCP_CFG_SA_T netapi_secAddSA(NETAPI_T h,
     *p_data_mode_handle= NULL;  
     *p_inflow_mode_handle= NULL;
 
-    /* Initialize defaults, can be updated from inputs to API */
-    memset(&createParam, 0, sizeof(nwalCreateSAParams_t));
-    createParam.saIpSecParam.appRxPktFlowId = CPPI_PARAM_NOT_SPECIFIED;
-    createParam.saIpSecParam.appRxPktQueue = QMSS_PARAM_NOT_SPECIFIED;
+
 
     if (inflow_mode & NETAPI_SEC_SA_INFLOW)
     {
index 1d03194d823cf55da42f775564704b662247a3d3..604d1bf2a809469532bfc580d7024f1333b77783 100755 (executable)
@@ -373,11 +373,13 @@ static void netapip_netcpCfgDeleteFlow(NETAPI_NWAL_GLOBAL_CONTEXT_T *p,
  ********************************************************************/
 static NETCP_CFG_FLOW_HANDLE_T netapip_netcpCfgInsertFlow(NETAPI_NWAL_GLOBAL_CONTEXT_T *p,
                                                           int slot,
+                                                          int dma_engine,
                                                           void * handle)
 {
     p->flows[slot].in_use=1;
     p->flows[slot].handle = handle;
     p->flows[slot].flow.flowid  = Cppi_getFlowId(handle);
+    p->flows[slot].flow.dma_engine  = dma_engine;
         return (NETCP_CFG_FLOW_HANDLE_T) &p->flows[slot].flow;
 }
 
@@ -389,6 +391,7 @@ static NETCP_CFG_FLOW_HANDLE_T netapip_netcpCfgInsertFlow(NETAPI_NWAL_GLOBAL_CON
  ********************************************************************/
 static int netapip_netcpCfgFindFlow(NETAPI_NWAL_GLOBAL_CONTEXT_T *p,
                                     int flowid,  
+                                    int dma_engine,
                                     void ** handle) 
 {
     int i;
@@ -396,7 +399,9 @@ static int netapip_netcpCfgFindFlow(NETAPI_NWAL_GLOBAL_CONTEXT_T *p,
     hplib_mSpinLockLock(&netapi_netcp_cfg_lock);
     for(i=0;i<TUNE_NETAPI_MAX_FLOWS;i++)
     {
-        if ((p->flows[i].in_use)&&(p->flows[i].flow.flowid == flowid))
+       if ((p->flows[i].in_use)&&
+           (p->flows[i].flow.flowid == flowid)&&
+           (p->flows[i].flow.dma_engine == dma_engine))
         {
             *handle = p->flows[i].handle;
             hplib_mSpinLockUnlock(&netapi_netcp_cfg_lock);
@@ -757,7 +762,11 @@ NETCP_CFG_MACIF_T  netapi_netcpCfgCreateMacInterface(NETAPI_T  h,
     /* set up MacInfo */
     memcpy(&MacInfo.macAddr,p_mac,6); 
     /* todo: vlan */
-    MacInfo.ifNum = switch_port;  /* todo: check for 0/1 relative*/
+    if (switch_port)
+    {
+       MacInfo.validParams =NWAL_SET_MAC_VALID_PARAM_IFNUM ;
+        MacInfo.ifNum = switch_port;  /* */
+    }
 
     if (route != NULL)
     {
@@ -1049,14 +1058,14 @@ static NETCP_CFG_IP_T  netapip_netcpCfgAddIpInternal(NETAPI_T  h,
  ********************************************************************
  * DESCRIPTION:  API to Add IP to MAC interface
  ********************************************************************/
-NETCP_CFG_IP_T  netapi_netcpCfgAddIp(NETAPI_T  h,
-                                     int  iface_no,
-                                     nwal_IpType ipType,
-                                     nwalIpAddr_t  * ip_addr,
-                                     nwalIpOpt_t * ip_qualifiers,
+NETCP_CFG_IP_T  netapi_netcpCfgAddIp(NETAPI_T                  h,
+                                     int                       iface_no,
+                                     nwal_IpType               ipType,
+                                     nwalIpAddr_t*             ip_addr,
+                                     nwalIpOpt_t*              ip_qualifiers,
                                      NETCP_CFG_ROUTE_HANDLE_T  route,  //NULL for default
-                                     void * user_data,
-                                     int * err)
+                                     void*                     user_data,
+                                     int*                      err)
 {
     return netapip_netcpCfgAddIpInternal(h, iface_no, ipType, ip_addr, 
                                          ip_qualifiers, route, user_data,err, 1);
@@ -1162,13 +1171,13 @@ static void netapip_netcpCfgDelIpInternal(NETAPI_T h,
  ********************************************************************
  * DESCRIPTION:  API  to detach IP from MAC interface
  ********************************************************************/
-void netapi_netcpCfgDelIp(NETAPI_T h,
-                          int iface_no,  
-                          nwal_IpType ipType,
-                          nwalIpAddr_t  * ip_addr,
-                          nwalIpOpt_t * ip_qualifiers,
-                          NETCP_CFG_IP_T  ip_rule_id,
-                          int *err)
+void netapi_netcpCfgDelIp(NETAPI_T              h,
+                          int                   iface_no,
+                          nwal_IpType           ipType,
+                          nwalIpAddr_t*         ip_addr,
+                          nwalIpOpt_t*          ip_qualifiers,
+                          NETCP_CFG_IP_T        ip_rule_id,
+                          int*                  err)
 {
     netapip_netcpCfgDelIpInternal( h, iface_no, ipType,
                   ip_addr, ip_qualifiers, ip_rule_id,
@@ -1182,12 +1191,12 @@ void netapi_netcpCfgDelIp(NETAPI_T h,
  ********************************************************************
  * DESCRIPTION:  API to attach a classifier rule to NETCP
  ********************************************************************/
-NETCP_CFG_CLASS_T netapi_netcpCfgAddClass(NETAPI_T h,
-                                          NETCP_CFG_CLASSIFIER_T *p_class,
-                                          NETCP_CFG_ROUTE_HANDLE_T route,
-                                          int action, 
-                                          void * user_data, 
-                                          int * err)
+NETCP_CFG_CLASS_T netapi_netcpCfgAddClass(NETAPI_T                  h,
+                                          NETCP_CFG_CLASSIFIER_T*   p_class,
+                                          NETCP_CFG_ROUTE_HANDLE_T  route,
+                                          int                       action, 
+                                          void*                     user_data, 
+                                          int*                      err)
 {
     NETAPI_HANDLE_T * n = (NETAPI_HANDLE_T *) h;
     void * l3_handle=NULL;  //ip handle
@@ -1394,9 +1403,9 @@ return -1;
  ********************************************************************
  * DESCRIPTION:  API to delete a preconfigured classifier
  ********************************************************************/
-void netapi_netcpCfgDelClass(NETAPI_T h,
-                             NETCP_CFG_CLASS_T classId,
-                             int *err)
+void netapi_netcpCfgDelClass(NETAPI_T           h,
+                             NETCP_CFG_CLASS_T  classId,
+                             int*               err)
 {
     NETAPI_HANDLE_T * n = (NETAPI_HANDLE_T *) h;
     void * L4_handle;  //class handle -> L4
@@ -1485,12 +1494,12 @@ ERR_netapi_netcpCfgDelClass:
  ********************************************************************/
 /*--------------flow management--------*/
 // ADD A Flow
-NETCP_CFG_FLOW_HANDLE_T netapi_netcpCfgAddFlow(NETAPI_T h,
-                                               int n,
-                                               Pktlib_HeapHandle handles[],
-                                               int sizes[],
-                                               int byte_offset,
-                                               int * err )
+NETCP_CFG_FLOW_HANDLE_T netapi_netcpCfgAddFlow(NETAPI_T                 h,
+                                               int                      n,
+                                               Pktlib_HeapHandle        handles[],
+                                               int                      sizes[],
+                                               NETCP_CFG_FLOW_CONFIG_T* p_cfg,
+                                               int*                     err )
 {
     Cppi_RxFlowCfg  rxFlowCfg;
     Uint8           isAlloc;
@@ -1502,6 +1511,11 @@ NETCP_CFG_FLOW_HANDLE_T netapi_netcpCfgAddFlow(NETAPI_T h,
     NETCP_CFG_FLOW_HANDLE_T retVal;
 
     *err= 0;  /* ok */
+    if (!p_cfg)
+    {
+        *err= NETAPI_ERR_BAD_INPUT;
+        return NULL;
+    }
     //get a slot to save new flow
     slot = netapip_netcpCfgFindFlowSlot(&netapi_get_global()->nwal_context);
     if (slot<0) { *err= NETAPI_ERR_NOMEM;  return NULL; }
@@ -1530,13 +1544,13 @@ NETCP_CFG_FLOW_HANDLE_T netapi_netcpCfgAddFlow(NETAPI_T h,
     }
 
     /* Configure Rx flow */
-    rxFlowCfg.flowIdNum      = CPPI_PARAM_NOT_SPECIFIED;
-    rxFlowCfg.rx_dest_qnum   = 100;   //DANGEROUS>  TODO PUT VALID Q HERE
-    rxFlowCfg.rx_dest_qmgr   = 0;
-    rxFlowCfg.rx_sop_offset  = byte_offset;
+    rxFlowCfg.flowIdNum      = p_cfg->flow_index;/*CPPI_PARAM_NOT_SPECIFIED*/;
+    rxFlowCfg.rx_dest_qnum   = pktio_get_q(p_cfg->p_dest_q);
+    rxFlowCfg.rx_dest_qmgr   = Qmss_getQueueNumber(rxFlowCfg.rx_dest_qnum).qMgr; 
+    rxFlowCfg.rx_sop_offset  = p_cfg->recv_offset;
     rxFlowCfg.rx_ps_location = Cppi_PSLoc_PS_IN_DESC;
     rxFlowCfg.rx_desc_type   = Cppi_DescType_HOST;
-    rxFlowCfg.rx_error_handling = 0;
+    rxFlowCfg.rx_error_handling = p_cfg->block;
 
     rxFlowCfg.rx_psinfo_present = 1;
     rxFlowCfg.rx_einfo_present  = 1;
@@ -1550,39 +1564,47 @@ NETCP_CFG_FLOW_HANDLE_T netapi_netcpCfgAddFlow(NETAPI_T h,
     rxFlowCfg.rx_size_thresh1_en = rxBufSize[2] ? 1 : 0;
     rxFlowCfg.rx_size_thresh2_en = rxBufSize[3] ? 1 : 0;
 
-    rxFlowCfg.rx_dest_tag_lo_sel = 0;
+  if (p_cfg->dma_index==NETAPI_DMA_NETCP )
+    rxFlowCfg.rx_dest_tag_lo_sel =0;
+  else
+    rxFlowCfg.rx_dest_tag_lo_sel = 0x4;
     rxFlowCfg.rx_dest_tag_hi_sel = 0;
     rxFlowCfg.rx_src_tag_lo_sel  = 0;
     rxFlowCfg.rx_src_tag_hi_sel  = 0;
 
     rxFlowCfg.rx_fdq1_qnum = rxBufQ[1];
-    rxFlowCfg.rx_fdq1_qmgr = 0;
+    rxFlowCfg.rx_fdq1_qmgr = (rxBufQ[1] ? Qmss_getQueueNumber(rxBufQ[1]).qMgr: 0);
     rxFlowCfg.rx_fdq2_qnum = rxBufQ[2];
-
-    rxFlowCfg.rx_fdq2_qmgr = 0;
+    rxFlowCfg.rx_fdq2_qmgr = (rxBufQ[2] ? Qmss_getQueueNumber(rxBufQ[2]).qMgr: 0);
     rxFlowCfg.rx_fdq3_qnum = rxBufQ[3];
-
-    rxFlowCfg.rx_fdq3_qmgr = 0;
+    rxFlowCfg.rx_fdq3_qmgr = (rxBufQ[3] ? Qmss_getQueueNumber(rxBufQ[3]).qMgr: 0);
 
     rxFlowCfg.rx_size_thresh0 = rxBufSize[1] ? rxBufSize[0] : 0;
     rxFlowCfg.rx_size_thresh1 = rxBufSize[2] ? rxBufSize[1] : 0;
     rxFlowCfg.rx_size_thresh2 = rxBufSize[3] ? rxBufSize[2] : 0;
 
     rxFlowCfg.rx_fdq0_sz0_qnum = rxBufQ[0];
-    rxFlowCfg.rx_fdq0_sz0_qmgr = 0;
+    rxFlowCfg.rx_fdq0_sz0_qmgr =  (rxBufQ[0] ? Qmss_getQueueNumber(rxBufQ[0]).qMgr: 0);
     rxFlowCfg.rx_fdq0_sz1_qnum = rxBufQ[1];
-    rxFlowCfg.rx_fdq0_sz1_qmgr = 0;
+    rxFlowCfg.rx_fdq0_sz1_qmgr =  (rxBufQ[1] ? Qmss_getQueueNumber(rxBufQ[1]).qMgr:0);
     rxFlowCfg.rx_fdq0_sz2_qnum = rxBufQ[2];
-    rxFlowCfg.rx_fdq0_sz2_qmgr = 0;
+    rxFlowCfg.rx_fdq0_sz2_qmgr =  (rxBufQ[2] ? Qmss_getQueueNumber(rxBufQ[2]).qMgr:0);
     rxFlowCfg.rx_fdq0_sz3_qnum = rxBufQ[3];
-    rxFlowCfg.rx_fdq0_sz3_qmgr = 0;
-
+    rxFlowCfg.rx_fdq0_sz3_qmgr =  (rxBufQ[3] ? Qmss_getQueueNumber(rxBufQ[3]).qMgr:0);
     {
         //todo: replace this with a nwal call to get global cntx info
         Cppi_CpDmaInitCfg cpdmaCfg;
+        Cppi_Handle cppiHnd;
         memset(&cpdmaCfg,0,sizeof(Cppi_CpDmaInitCfg));
-        cpdmaCfg.dmaNum   = Cppi_CpDma_PASS_CPDMA;
-        FlowHnd = Cppi_configureRxFlow (Cppi_open (&cpdmaCfg), &rxFlowCfg, &isAlloc);
+        cpdmaCfg.dmaNum   = (p_cfg->dma_index==NETAPI_DMA_NETCP ) ?Cppi_CpDma_PASS_CPDMA: Cppi_CpDma_QMSS_CPDMA;
+        cppiHnd= Cppi_open (&cpdmaCfg);
+        if (cppiHnd == NULL)
+        {
+              netapip_netcpCfgDeleteFlow(&netapi_get_global()->nwal_context, slot);
+              *err= NETAPI_ERR_NORES;
+              return NULL;
+        }
+        FlowHnd = Cppi_configureRxFlow (cppiHnd, &rxFlowCfg, &isAlloc);
     }
     if (FlowHnd == NULL)
     {
@@ -1592,9 +1614,13 @@ NETCP_CFG_FLOW_HANDLE_T netapi_netcpCfgAddFlow(NETAPI_T h,
     }
 
     //update slot
-    retVal = netapip_netcpCfgInsertFlow(&netapi_get_global()->nwal_context, slot, (void*) FlowHnd);
-    netapi_Log("netcp_cfg:  flow %d created\n",  ((NETCP_CFG_FLOW_T *) retVal)->flowid);
-    return ( retVal);
+    retVal = netapip_netcpCfgInsertFlow(&netapi_get_global()->nwal_context,
+                                        slot,
+                                        p_cfg->dma_index,
+                                        (void*) FlowHnd);
+    netapi_Log(">netcp cfg:  flow %d created in dma index %d\n",
+        ((NETCP_CFG_FLOW_T *) retVal)->flowid, p_cfg->dma_index);
+    return (retVal);
 }
 
 /********************************************************************
@@ -1602,24 +1628,29 @@ NETCP_CFG_FLOW_HANDLE_T netapi_netcpCfgAddFlow(NETAPI_T h,
  ********************************************************************
  * DESCRIPTION:  API to delete a flow
  ********************************************************************/
-void netapi_netcpCfgDelFlow(NETAPI_T ,
-                            NETCP_CFG_FLOW_HANDLE_T f , 
-                            int * err)
+void netapi_netcpCfgDelFlow(NETAPI_T                h,
+                            NETCP_CFG_FLOW_HANDLE_T f,
+                            int*                    err)
 {
     int slot;
     void * handle;
     *err=0;
     /* find entry */
-    slot = netapip_netcpCfgFindFlow(&netapi_get_global()->nwal_context, ((NETCP_CFG_FLOW_T *) f) ->flowid, &handle);
+        slot = netapip_netcpCfgFindFlow(&netapi_get_global()->nwal_context,
+                     ((NETCP_CFG_FLOW_T *) f) ->flowid,
+                     ((NETCP_CFG_FLOW_T *) f) ->dma_engine,
+                     &handle);
     if (slot<0)
     {
-        *err = NETAPI_ERR_BAD_INPUT; 
+        *err = NETAPI_ERR_BAD_INPUT;
         return;
     }
 
     Cppi_closeRxFlow( (Cppi_FlowHnd) handle);
     netapip_netcpCfgDeleteFlow(&netapi_get_global()->nwal_context, slot);
-    netapi_Log("netcp_cfg:  flow %d deleted\n",  ((NETCP_CFG_FLOW_T *) f)->flowid);
+    netapi_Log(">netcp cfg:  flow %d (dma index %d) deleted\n",
+                ((NETCP_CFG_FLOW_T *) f)->flowid,
+                ((NETCP_CFG_FLOW_T *) f)->dma_engine);
     return;
 }
 
@@ -1628,10 +1659,10 @@ void netapi_netcpCfgDelFlow(NETAPI_T h ,
  ******************************************************************************
  * DESCRIPTION:  API to configure NETCP with global rules for exception packet handling
  *****************************************************************************/
-NETCP_CFG_EXCEPTION_PKT_T netapi_netcpCfgExceptions(NETAPI_T h,
-                                                    int exception_id ,
-                                                    nwal_matchAction_t action,
-                                                    NETCP_CFG_ROUTE_HANDLE_T p_route)
+NETCP_CFG_EXCEPTION_PKT_T netapi_netcpCfgExceptions(NETAPI_T                    h,
+                                                    int                         exception_id,
+                                                    nwal_matchAction_t          action,
+                                                    NETCP_CFG_ROUTE_HANDLE_T    p_route)
 {
     nwalCtlInfo_t   ctrl;
     NETAPI_HANDLE_T * n = (NETAPI_HANDLE_T *) h;
@@ -1676,7 +1707,7 @@ NETCP_CFG_EXCEPTION_PKT_T netapi_netcpCfgExceptions(NETAPI_T h,
  ********************************************************************
  * DESCRIPTION:  NETAPI internal function, NETCP command reply callback
  ********************************************************************/
-void netapi_NWALCmdCallBack(nwal_AppId        appHandle,
+void netapip_netcpCfgNWALCmdCallBack(nwal_AppId        appHandle,
                             uint16_t            trans_id,
                             nwal_RetValue     ret)
 {
@@ -1694,7 +1725,7 @@ void netapi_NWALCmdCallBack(nwal_AppId        appHandle,
 
     if(ret != nwal_OK)
     {
-        netapi_Log ("netcp_cfg : netapi_NWALCmdCallBack returned Error Code %d for trans_id %d\n",
+        netapi_Log ("netcp_cfg : netapip_netcpCfgNWALCmdCallBack returned Error Code %d for trans_id %d\n",
                     ret, trans_id);
         // update error code that is fialed  in p_trans */
         //todo: atomic inc
@@ -1790,7 +1821,7 @@ void netapi_NWALCmdCallBack(nwal_AppId        appHandle,
  ********************************************************************
  * DESCRIPTION:  NETAPI internal function, PA stats reply callback
  ********************************************************************/
-void netapi_NWALCmdPaStatsReply(nwal_AppId        appHandle,
+void netapip_netcpCfgNWALCmdPaStatsReply(nwal_AppId        appHandle,
                                 nwal_TransID_t    trans_id,
                                 paSysStats_t      *stats)
 {
index 5e8e61bff2611864618630ef0e1eb6e3f661e687..64cb4ed9cc01c83995af7a1c57ad2349e5ec5c03 100755 (executable)
@@ -940,12 +940,12 @@ int netapi_pktioPollAll(NETAPI_T  handle,
 
 
 /**********************************************************************
- * FUNCTION PURPOSE:  Callback that gets registered with NWAL for packet reception
+ * FUNCTION PURPOSE:  Internal Callback that gets registered with NWAL for packet reception
  **********************************************************************
  * DESCRIPTION:  Callback that gets registered with NWAL for packet reception
  * appCookie is the pktio handle 
  **********************************************************************/
-void netapi_NWALRxPktCallback(uint32_t            appCookie,
+void netapip_pktioNWALRxPktCallback(uint32_t            appCookie,
                               uint16_t             numPkts,
                               nwalRxPktInfo_t*    pPktInfo,
                               uint64_t            timestamp,
@@ -971,12 +971,12 @@ void netapi_NWALRxPktCallback(uint32_t            appCookie,
 
 
 /**********************************************************************
- * FUNCTION PURPOSE:  Callback that gets registered with NWAL for crypto reception
+ * FUNCTION PURPOSE:  Internal Callback that gets registered with NWAL for crypto reception
  **********************************************************************
  * DESCRIPTION:  Callback that gets registered with NWAL for crypto reception,
  * appCookie is the pktio handle 
  **********************************************************************/
-void netapi_NWALSBPktCallback(uint32_t            appCookie,
+void netapip_pktioNWALSBPktCallback(uint32_t            appCookie,
                               uint16_t             numPkts,
                               nwalDmRxPayloadInfo_t*  pDmRxPktInfo,
                               nwal_Bool_t*        pFreePkt)