]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - keystone-rtos/netapi.git/blobdiff - ti/runtime/netapi/test/net_test.c
Update for crash and compilation fix for latest in the branch
[keystone-rtos/netapi.git] / ti / runtime / netapi / test / net_test.c
index e3bcd93af9ee6d94f5e35f33322cc211864e51b6..ba5c75dca9b59e342dd102b408367856ba97026a 100755 (executable)
@@ -106,6 +106,9 @@ int pktloopback=TUNE_NETAPI_NWAL_ENABLE_PASS_LOOPBACK;
 nwalTxPSCmdInfo_t   flowPSCmdInfo;
 nwal_RetValue       nwalRetVal;
 
+/* Local Per Process default resourcese maintained at NWAL */
+nwalLocCxtInfo_t    nwalLocCxt;
+
 //this device: 10.0.0.100, mac 0x,01,02,03,04,05  and .. 0x6
 
 //test packet, setup for loopback (so dest is ourself)
@@ -1042,7 +1045,21 @@ if (flag)
            meta_tx.appCtxId = (nwal_AppId)netapi_timing_start();
            meta.u.tx_sb_meta=&meta_tx;
 
-#ifdef NET_TEST_ENABLE_SIDE_BAND_LOW_LEVEL_API            
+#ifdef NET_TEST_ENABLE_SIDE_BAND_LOW_LEVEL_API
+           /* Use the command label which was cached during create time
+            * Update the Queue to receive output packet from SA to the local 
+            * core Queue. Below information can be saved by application in 
+            * per process context to avoid API overhead per packet
+            * Application can use below rxSbSaQ for polling packets back from
+            * SA
+            */
+           nwalRetVal =  
+           nwal_getLocCxtInfo(PKTIO_GET_NWAL_INSTANCE(netcp_sb_tx_chan),
+                                                      &nwalLocCxt);
+           if(nwalRetVal == nwal_OK)
+           {
+                p_sa_info->tx_dmPSCmdInfo.rxSbSaQ = nwalLocCxt.rxSbSaQ;
+           }
            nwal_mCmdDMUpdate(tip,
                               &p_sa_info->tx_dmPSCmdInfo,
                               meta_tx.appCtxId,
@@ -1426,7 +1443,21 @@ Cppi_HostDesc*          pPloadDesc;
 
            /* post it to netcp sb tx channel*/
            meta2.u.tx_sb_meta=&meta_tx;
-#ifdef NET_TEST_ENABLE_SIDE_BAND_LOW_LEVEL_API            
+#ifdef NET_TEST_ENABLE_SIDE_BAND_LOW_LEVEL_API
+           /* Use the command label which was cached during create time
+            * Update the Queue to receive output packet from SA to the local 
+            * core Queue. Below information can be saved by application in 
+            * per process context to avoid API overhead per packet
+            * Application can use below rxSbSaQ for polling packets back from
+            * SA
+            */
+           nwalRetVal =  
+           nwal_getLocCxtInfo(PKTIO_GET_NWAL_INSTANCE(netcp_sb_tx_chan),
+                                                      &nwalLocCxt);
+           if(nwalRetVal == nwal_OK)
+           {
+                p_sa_info->rx_dmPSCmdInfo.rxSbSaQ = nwalLocCxt.rxSbSaQ;
+           }
             nwal_mCmdDMUpdate(tip,
                               &p_sa_info->rx_dmPSCmdInfo,
                               meta_tx.appCtxId,
@@ -1440,7 +1471,7 @@ Cppi_HostDesc*          pPloadDesc;
                               meta_tx.pAad);
              pPloadDesc = Pktlib_getDescFromPacket(tip);
              pPloadDesc = Qmss_osalConvertDescVirtToPhy(pPloadDesc);
-             Qmss_queuePushDescSizeRaw(p_sa_info->tx_dmPSCmdInfo.txQueue,
+             Qmss_queuePushDescSizeRaw(p_sa_info->rx_dmPSCmdInfo.txQueue,
                                        pPloadDesc,
                                        NWAL_DESC_SIZE);
 
@@ -2548,7 +2579,7 @@ netcp_cfgCreateMacInterface(
 if (err) {printf("addmac0 failed %d\n",err); exit(1); } 
 
 //attach an IP to this interface
-ip_rule0=netcp_addIp(
+ip_rule0=netcp_cfgAddIp(
                   netapi_handle,
                   0,
                   nwal_IPV4,
@@ -2571,7 +2602,7 @@ netcp_cfgCreateMacInterface(
 if (err) {printf("addmac1 failed %d\n",err); exit(1); }
 
 //attach an IP to this interface
-ip_rule1=netcp_addIp(
+ip_rule1=netcp_cfgAddIp(
                   netapi_handle,
                   1,
                   nwal_IPV4,