]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - keystone-rtos/netapi.git/blobdiff - ti/runtime/netapi/test/net_test.c
Fixed issue with running and gracefully terminating net_test_router application.
[keystone-rtos/netapi.git] / ti / runtime / netapi / test / net_test.c
index 43a1db965f4eb51e3e6c792741506c0e303bcfb9..bd066a2b9995cd557f9abd4d32badd3b5cf3d776 100755 (executable)
@@ -362,8 +362,9 @@ int coreid=0;
 
             /* post it to netcp tx channel*/
             meta.u.tx_meta=&meta_tx;
+#ifdef DEBUG_DESC
             if (stats[coreid].sec_tx<20) netTest_utilDumpDescr((long *) tip, stats[coreid].sec_tx);
-
+#endif
             if ( pkt_type == netTest_IPSEC_ESP_PKT)
                 netapi_pktioSend(netcp_tx_chan_esp,tip,&meta,&err);
             else if ( pkt_type == netTest_IPSEC_AH_PKT)
@@ -540,7 +541,6 @@ void recv_cb(struct PKTIO_HANDLE_Tag * channel, Ti_Pkt* p_recv[],
 
 #ifdef netTest_MULTI_THREAD
     int coreid=Osal_nwalGetProcId();  //who we are(thread local)
-    //int coreid = our_core;
 #else
     int coreid=0;
 #endif
@@ -965,31 +965,32 @@ void teardown_netTestDSPFastPath()
 #ifdef netTest_MULTI_THREAD
 NETAPI_T worker_nh[TUNE_NETAPI_NUM_CORES];
 
-void slow_path_thread(uint32_t thread_num)
+void slow_path_thread(uint32_t index)
 {
     int err, i;;
-
+    uint32_t thread_num;
     PKTIO_HANDLE_T *rx_chan;
     PKTIO_HANDLE_T *sb_rx_chan;
 
-    printf("slow_path_thread, mypid: %d, core_id %d\n", gettid(), thread_num);
+    thread_num = netTestCfg.sp_thread_num[index];
+    printf("slow_path_thread, mypid: %d, core_id %d\n", gettid(), netTestCfg.sp_thread_num[index]);
 
     CPU_ZERO( &cpu_set);
     printf("slow_path_thread: settting up for thread number %d\n", thread_num);
 #ifdef CORTEX_A15
-    for (i = netTestCfg.sp_proc_start[thread_num]; i <= netTestCfg.sp_proc_end[thread_num];i++)
+    for (i = netTestCfg.sp_proc_start[index]; i <= netTestCfg.sp_proc_end[index];i++)
     {
         printf("slow_path_thread: setting cpu %d to cpu_set\n", i);
         CPU_SET( i, &cpu_set);
     }
-    hplib_utilSetupCore(thread_num, &cpu_set);
+    hplib_utilSetupThread(thread_num, &cpu_set);
 #else
-    for (i = netTestCfg.sp_proc_start[thread_num]; i <= netTestCfg.sp_proc_end[thread_num];i++)
+    for (i = netTestCfg.sp_proc_start[index]; i <= netTestCfg.sp_proc_end[index];i++)
     {
         printf("slow_path_thread: setting cpu %d to cpu_set\n", i);
         CPU_SET( i, &cpu_set);
     }
-    hplib_utilSetupCore(thread_num, &cpu_set);
+    hplib_utilSetupThread(thread_num, &cpu_set);
 #endif
     worker_nh[thread_num]=netapi_init(NETAPI_CORE_MASTER,NULL);
 
@@ -1012,28 +1013,33 @@ void slow_path_thread(uint32_t thread_num)
     netapi_shutdown(worker_nh[thread_num]);
 }
 
-void fast_path_thread(uint32_t thread_num)
+void fast_path_thread(uint32_t index)
 {
     int err, i;
     PKTIO_HANDLE_T *rx_chan;
     PKTIO_HANDLE_T *sb_rx_chan;
+    uint32_t thread_num;
 
     CPU_ZERO( &cpu_set);
-    printf("fast_path_thread: settting up for thread number %d\n", thread_num);
+    printf("fast_path_thread: settting up for thread number %d\n", netTestCfg.fp_thread_num[index]);
+    thread_num = netTestCfg.fp_thread_num[index];
 #ifdef CORTEX_A15
-    for (i = netTestCfg.fp_proc_start[thread_num]; i <= netTestCfg.fp_proc_end[thread_num];i++)
+    for (i = netTestCfg.fp_proc_start[index]; i <= netTestCfg.fp_proc_end[index];i++)
     {
+        printf("fast_path_thread: start core %d, end core %d\n",
+                netTestCfg.fp_proc_start[index],
+                netTestCfg.fp_proc_end[index]);
         printf("fast_path_thread: setting cpu %d to cpu_set\n", i);
         CPU_SET( i, &cpu_set);
     }
-    hplib_utilSetupCore(thread_num, &cpu_set);
+    hplib_utilSetupThread(thread_num, &cpu_set);
 #else
-    for (i = netTestCfg.fp_proc_start[thread_num]; i <= netTestCfg.fp_proc_end[thread_num];i++)
+    for (i = netTestCfg.fp_proc_start[index]; i <= netTestCfg.fp_proc_end[index];i++)
     {
         printf("fast_path_thread: setting cpu %d to cpu_set\n", i);
         CPU_SET( i, &cpu_set);
     }
-    hplib_utilSetupCore(thread_num, &cpu_set);
+    hplib_utilSetupThread(thread_num, &cpu_set);
 #endif
     worker_nh[thread_num]=netapi_init(NETAPI_CORE_MASTER,NULL);
 
@@ -1134,7 +1140,7 @@ int main(int argc, char **argv)
     /* assign main net_test thread to run on core 0 */
     CPU_ZERO( &cpu_set);
     CPU_SET( 0, &cpu_set);
-    hplib_utilSetupCore(0, &cpu_set);
+    hplib_utilSetupThread(0, &cpu_set);
 #endif
 
     /* create netapi */