summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: dd54c75)
raw | patch | inline | side by side (parent: dd54c75)
author | Tinku Mannan <tmannan@ti.com> | |
Tue, 16 Apr 2013 20:36:25 +0000 (16:36 -0400) | ||
committer | Tinku Mannan <tmannan@ti.com> | |
Tue, 16 Apr 2013 20:36:25 +0000 (16:36 -0400) |
Fixed mapping of threads to configured cpu sets.
index ee8462643706f05a9594d1732b747d65d58d07c7..ab77fcc0596aa6789d4f704d806ad615b941473d 100755 (executable)
- memory mapped peripherals we use, such as QMSS, PA, etc */
result = hplib_vmInit(&netapi_VM_VirtAddr[0], 2, &netapi_VM_MempoolAttr[0]);
- /* TODO: at this point, we need to create the QM regions which need to moved out of the above
- netapi_VM_memory_setup() call, also need to move out the SA context stuff */
- if (result == hplib_OK) netapi_Log("netapi: system init - memory set up OK\n");
- else {netapi_Log(">netap: system init - memory set up failed\n"); return -1;}
+ if (result == hplib_OK) netapi_Log("netapip_systemInit: - memory set up OK\n");
+ else {netapi_Log("netapip_systemInit: - memory set up failed\n"); return -1;}
#ifdef NETAPI_ENABLE_SECURITY
SEC_CONTEXT_SZ), 128, 0);
if (!netapi_VM_SaContextVaddr)
{
- netapi_Log("netapi ERROR: Failed to map SA context memory region\n");
+ netapi_Log("netapip_systemInit: Failed to map SA context memory region\n");
return (-1);
}
- netapi_Log(">hplib VM_SaContext: Memory mapped/allocated at address %p.\n", netapi_VM_SaContextVaddr);
+ netapi_Log("netapip_systemInit: SA Memory mapped/allocated at address %p.\n", netapi_VM_SaContextVaddr);
#else
netapi_VM_SaContextVaddr= (char *) NULL;
(void *)hplib_vmMemAlloc((TUNE_NETAPI_NUM_LOCAL_DESC *
TUNE_NETAPI_DESC_SIZE),
128, 0);
- netapi_Log("netapi local desc region=%x global desc region=%x\n", netapi_VM_QMemLocalDescRam, netapi_VM_QMemGlobalDescRam);
+ netapi_Log("netapip_systemInit: desc region=%x global desc region=%x\n", netapi_VM_QMemLocalDescRam, netapi_VM_QMemGlobalDescRam);
//get timer running
#ifdef CORTEX_A8
TUNE_NETAPI_DESC_SIZE,
(unsigned int *) netapi_VM_QMemGlobalDescRam,
TUNE_NETAPI_QM_GLOBAL_REGION);
- if(result <0) {netapi_Log("netapi; can't setup QM shared region\n"); return -1;}
+ if(result <0) {netapi_Log("netapip_systemInit: can't setup QM shared region\n"); return -1;}
netapi_Log("netapip_systemInit: returned from netapip_qmSetupMemRegion\n");
#if 0 //todo setup 2nd region
index 43a1db965f4eb51e3e6c792741506c0e303bcfb9..bd066a2b9995cd557f9abd4d32badd3b5cf3d776 100755 (executable)
/* 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)
#ifdef netTest_MULTI_THREAD
int coreid=Osal_nwalGetProcId(); //who we are(thread local)
- //int coreid = our_core;
#else
int coreid=0;
#endif
#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);
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);
/* 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 */
diff --git a/ti/runtime/netapi/test/net_test_max_params.c b/ti/runtime/netapi/test/net_test_max_params.c
index 405993c3a5bbba1cb3b2c61ac03a0619cdb86e5f..980a78d38d52c61117c133a6d53ca052994d79ca 100755 (executable)
/* 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 */
index a002618527a16cb2b6486b191bf220578cacffd7..67d752e70c4b481f8fcf77a60d5686e6c400c576 100755 (executable)
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;
+ 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;
+ 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
/***************************************
/* 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)
diff --git a/ti/runtime/netapi/test/net_test_thread_utils.c b/ti/runtime/netapi/test/net_test_thread_utils.c
index 91346435053e18d953058b6bb2ffb00c5fef4152..e695641ad2d5689ca5b7c23a05803132b5bf5b7f 100755 (executable)
for (i = 0; i < num_sp_threads; i++)
{
if (pthread_create( &sp_threads[i], NULL, (void*)slow_path_thread,
- (void *) netTestCfg.sp_thread_num[i]))
+ (void *) i))
{
perror( "pthread_create" );
exit(1);
for (i = 0; i < num_fp_threads; i++)
{
if (pthread_create( &fp_threads[i], NULL, (void*)fast_path_thread,
- (void *) netTestCfg.fp_thread_num[i]))
+ (void *) i))
{
perror( "pthread_create" );
exit(1);
index 1d5ac0aa99da2b25d3a67f7f095a6ec0cc238729..4d5b4fc09ef4dc758aad68373b1719128c9db8ff 100755 (executable)
-netTestStats_T stats[TUNE_NETAPI_NUM_CORES];
+netTestStats_T stats[NET_TEST_MAX_SP_THREAD + NET_TEST_MAX_FP_THREAD +1];
paSysStats_t netcp_stats;
}
void netTest_utilsStatsCb(NETAPI_T h, paSysStats_t* pPaStats)
{
-uint32_t numFreeDataPackets;
-uint32_t numZeroBufferPackets;
-uint32_t numPacketsinGarbage;
-Pktlib_HeapStats pktLibHeapStats;
-int i;
-unsigned long long bcpp;
-unsigned long long bcpp_noc;
-unsigned long long bcpp_app;
-unsigned long long bcpp_tx;
-unsigned long long npL;
-unsigned long long cyclesL;
-unsigned long long ccyclesL; //cache cycles
-unsigned long long tmp_npL[TUNE_NETAPI_NUM_CORES];
-unsigned long long tmp_cyclesL[TUNE_NETAPI_NUM_CORES];
-unsigned long long tmp_ccyclesL[TUNE_NETAPI_NUM_CORES]; //cache cycles
-NETAPI_SA_STATS_T netapi_sa_stats;
-
- for (i=0;i < TUNE_NETAPI_NUM_CORES;i++)
+ uint32_t numFreeDataPackets;
+ uint32_t numZeroBufferPackets;
+ uint32_t numPacketsinGarbage;
+ Pktlib_HeapStats pktLibHeapStats;
+ int i,j;
+ unsigned long long bcpp;
+ unsigned long long bcpp_noc;
+ unsigned long long bcpp_app;
+ unsigned long long bcpp_tx;
+ unsigned long long npL;
+ unsigned long long cyclesL;
+ unsigned long long ccyclesL; //cache cycles
+ unsigned long long tmp_npL[TUNE_NETAPI_NUM_CORES];
+ unsigned long long tmp_cyclesL[TUNE_NETAPI_NUM_CORES];
+ unsigned long long tmp_ccyclesL[TUNE_NETAPI_NUM_CORES]; //cache cycles
+ NETAPI_SA_STATS_T netapi_sa_stats;
+
+ uint8_t num_threads = netTestCfg.num_fp_threads;
+ for (j= 0;j < num_threads;j++)
{
- printf("Per Core Statistics for CORE %d\n", i);
+ if (netTestCfg.fp_thread_num[j] == 0)
+ continue;
+ i = netTestCfg.fp_thread_num[j];
+ printf("Per THREAD Statistics for Thread %d\n", netTestCfg.fp_thread_num[j]);;
printf(">*****stats @ %lld (#cbs%d) \n", hplib_mUtilGetTimestamp(),stats[i].n_stats_cb);
printf(">itx=%d rx=%d tx=%d bad=%d slow=%d \n>rx_class0=%d rx_class1=%d rx_class2=%dsecRx=%d\t"
"secPRX=%d sb_rx=%d sb_tx=%d auth_ok=%d sec_tx=%d min_rx=%d min_tx=%d fragPkt=%d, exceptionPktOther=%d\n",
stats[i].secp_rx, stats[i].sb_rx, stats[i].sb_tx, stats[i].n_auth_ok,
stats[i].sec_tx, stats[i].rx_min, stats[i].tx_min, stats[i].exceptionPktsFrag, stats[i].exceptionPktsOther);
printf(">if rx stats: %d %d %d\n",stats[i].if_rx[0],stats[i].if_rx[1],stats[i].if_rx[2]);
- printf(">core rx stats: %d \n",stats[i].core_rx);
+ printf(">thread rx stats: %d \n",stats[i].core_rx);
if (stats[i].rx && stats[i].tx)
printf("decrypt time per packet(avg): %lu, encrypt time per packet(avg): %lu\n",
if (strlen(&pConfig->fp[i][0]))
{
netTestCfg.num_fp_threads++;
- netTest_utilParseThreadConfig(&pConfig->fp[i][0],(uint8_t*)&netTestCfg.fp_proc_start[i], (uint8_t*)&netTestCfg.fp_proc_end);
+ netTest_utilParseThreadConfig(&pConfig->fp[i][0],
+ (uint8_t*)&netTestCfg.fp_proc_start[i],
+ (uint8_t*)&netTestCfg.fp_proc_end[i]);
+ printf("netTest_utilParseThreadParams: fp start[%d]: %d, fp end[%d]: %d\n",
+ i,
+ netTestCfg.fp_proc_start[i],
+ i,
+ netTestCfg.fp_proc_end[i]);
}
if (strlen(&pConfig->fp_thread_num[i][0]))
{
if (strlen(&pConfig->sp[i][0]))
{
netTestCfg.num_sp_threads++;
- netTest_utilParseThreadConfig(&pConfig->sp[i][0],(uint8_t*)&netTestCfg.sp_proc_start[i], (uint8_t*)&netTestCfg.sp_proc_end);
+ netTest_utilParseThreadConfig(&pConfig->sp[i][0],
+ (uint8_t*)&netTestCfg.sp_proc_start[i],
+ (uint8_t*)&netTestCfg.sp_proc_end[i]);
}
if (strlen(&pConfig->sp_thread_num[i][0]))
{