X-Git-Url: https://git.ti.com/gitweb?p=keystone-rtos%2Fnetapi.git;a=blobdiff_plain;f=ti%2Fruntime%2Fnetapi%2Ftest%2Fnet_test_loopback.c;h=d85a8f1b9db31dd3f2aa9f37f89f8f7527eb6a6b;hp=2dac9a251fe0656427ee383f0b73ef65cc781a3a;hb=f4f0b8fe1db2939c4ec631e59d3aa34a2953fdb6;hpb=eeb317cea6bcad86202e180c26f8d3447604c41f diff --git a/ti/runtime/netapi/test/net_test_loopback.c b/ti/runtime/netapi/test/net_test_loopback.c index 2dac9a2..d85a8f1 100755 --- a/ti/runtime/netapi/test/net_test_loopback.c +++ b/ti/runtime/netapi/test/net_test_loopback.c @@ -73,6 +73,7 @@ extern netTestStats_T stats[TUNE_NETAPI_NUM_CORES]; extern paSysStats_t netcp_stats; extern Rm_ServiceHandle *rmClientServiceHandle; +hplib_spinLock_T net_test_thread_lock; netTestConfig_t netTestCfg; @@ -1067,13 +1068,16 @@ void fast_path_thread(uint32_t index) } hplib_utilSetupThread(thread_num, &cpu_set, hplib_spinLock_Type_LOL); #endif + hplib_mSpinLockLock(&net_test_thread_lock); worker_nh[thread_num]=netapi_init(NETAPI_CORE_MASTER,NULL); if (worker_nh[thread_num] == NULL) { printf("fast_path_thread: netapi_init failure, exiting\n"); + hplib_mSpinLockUnlock(&net_test_thread_lock); exit(1); } + hplib_mSpinLockUnlock(&net_test_thread_lock); /* open netcp default RX channels*/ rx_chan = netapi_pktioOpen(worker_nh[thread_num], NETCP_RX, (PKTIO_CB) recv_cb, &netcp_rx_cfg, &err); @@ -1146,6 +1150,7 @@ int main(int argc, char **argv) printf("main: initRm() returned error\n"); exit(1); } + hplib_mSpinLockInit(&net_test_thread_lock ); our_netapi_default_cfg.rmHandle = rmClientServiceHandle; memset(&config_file, 0, sizeof(netTestConfigFile_t)); memset(&netTestCfg, 0, sizeof(netTestConfig_t));