Update for demonstrating RX queue configuration
authorRaghu Nambiath <rnambiath@ti.com>
Fri, 28 Sep 2012 14:11:08 +0000 (10:11 -0400)
committerRaghu Nambiath <rnambiath@ti.com>
Fri, 28 Sep 2012 14:11:08 +0000 (10:11 -0400)
ti/runtime/netapi/test/net_test.c

index e3bcd93af9ee6d94f5e35f33322cc211864e51b6..ce67fc979d10dbf3b0ced18a275bcb7e441ff1d3 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);