index a002618527a16cb2b6486b191bf220578cacffd7..1cd895d6b91d01aca873f0a9c5662d92f25a86f4 100755 (executable)
extern int QUIT;
/* Global definitions */
-#ifdef netTest_MULTI_THREAD
- cpu_set_t cpu_set;
-#endif
netTestConfig_t netTestCfg;
static netTestConfigFile_t config_file;
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_tx_chan;
PKTIO_HANDLE_T *sb_rx_chan;
+ cpu_set_t cpu_set;
+ thread_num = netTestCfg.sp_thread_num[index];
+ printf("slow_path_thread for index %d called for thread %d\n", index, thread_num);
CPU_ZERO( &cpu_set);
#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("fast_path_thread: setting cpu %d to cpu_set\n", 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("fast_path_thread: setting cpu %d to cpu_set\n", 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);
NETAPI_HANDLE_T * n = (NETAPI_HANDLE_T *) worker_nh[thread_num];
/* open netcp RX channel */
- rx_chan = netapi_pktioOpen(worker_nh[thread_num], NETCP_RX, (PKTIO_CB) recv_cb_router, &netcp_rx_cfg, &err);
+ //rx_chan = netapi_pktioOpen(worker_nh[thread_num], NETCP_RX, (PKTIO_CB) recv_cb_router, &netcp_rx_cfg, &err);
/**************Entry point into scheduler ****/
/*********************************************/
netapi_schedRun(scheduler[thread_num], &err);
- netapi_Log(">net_test: core %d worker thread done\n",thread_num);
+ netapi_Log("slow_path_thread: core %d worker thread done\n",thread_num);
- netapi_pktioClose(rx_chan, &err);
+ //netapi_pktioClose(rx_chan, &err);
netapi_shutdown(worker_nh[thread_num]);
}
-void fast_path_thread(uint32_t thread_num)
+void fast_path_thread(uint32_t index)
{
int err,i;
+ uint32_t thread_num;
PKTIO_HANDLE_T *rx_chan;
PKTIO_HANDLE_T *sb_tx_chan;
- //PKTIO_HANDLE_T *sb_rx_chan;
+ cpu_set_t cpu_set;
+
+ thread_num = netTestCfg.fp_thread_num[index];
+ printf("fast_path_thread for index %d called for thread %d\n", index, thread_num);
+ CPU_ZERO( &cpu_set);
#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: 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);
scheduler[thread_num]->config.pollCtrlQ = FALSE;
//sleep(100000);
netapi_schedRun(scheduler[thread_num], &err);
- netapi_Log(">net_test: core %d worker thread done\n",thread_num);
+ netapi_Log("fast_path_thread: core %d worker thread done\n",thread_num);
netapi_pktioClose(rx_chan, &err);
netapi_shutdown(worker_nh[thread_num]);
-\r}
-
+}
#endif
/***************************************
Pktlib_HeapIfTable* pPktifTable;
FILE * fpr = NULL;
+ cpu_set_t cpu_set;
/* install signal handler for ^c */
signal(SIGINT,netTest_utilMySig);
/* 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 */
netapi_handle = netapi_init(NETAPI_SYS_MASTER, &our_netapi_default_cfg);
/* close pktio channels we opened via open_pktio_tx_channels() */
close_pktio_channels();
+ netapi_shutdown(netapi_handle);
}
static inline void send_it(Ti_Pkt *tip, int len, netTestSA_t * p_sec, int out_port)