summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 90b0710)
raw | patch | inline | side by side (parent: 90b0710)
author | Tinku Mannan <tmannan@ti.com> | |
Wed, 24 Apr 2013 18:11:39 +0000 (14:11 -0400) | ||
committer | Tinku Mannan <tmannan@ti.com> | |
Wed, 24 Apr 2013 18:11:39 +0000 (14:11 -0400) |
index 8df5fbbcd85fb15d3252d0a302c7c69a8db22224..c53f34301610e034499e7f3f60143e2891975256 100755 (executable)
#include <string.h>\r
#include <signal.h>\r
#include <pthread.h>\r
+#include <sched.h>\r
\r
#include "trie.h"\r
#include "string.h"\r
{\r
int err;\r
int np;\r
+cpu_set_t cpu_set;\r
+\r
+ CPU_ZERO( &cpu_set);\r
+ CPU_SET( 1, &cpu_set);\r
+ hplib_utilSetupThread(1, &cpu_set);\r
+\r
for(;!((volatile)QUIT);)\r
{\r
np = netapi_pktioPoll(rx_chan,NULL,&err);\r
int len;\r
PKTIO_METADATA_T meta = {PKTIO_META_IFDMA_TX,{0},0};\r
int np;\r
+cpu_set_t cpu_set;\r
+\r
+\r
+ CPU_ZERO( &cpu_set);\r
+ CPU_SET( 2, &cpu_set);\r
+ hplib_utilSetupThread(2, &cpu_set);\r
+\r
#ifdef INTERNAL_PACKETS\r
//generate packets internally by allocating from OurHeap (the NETAPI \r
//default) and send to receiver via ifdma pktio channel\r
Pktlib_HeapIfTable* pPktifTable;\r
Pktlib_HeapCfg heapCfg;\r
long t1, t2 ;\r
+ cpu_set_t cpu_set;\r
+\r
\r
//install signal handler for ^c\r
signal(SIGINT,netTest_utilMySig);\r
+ CPU_ZERO( &cpu_set);\r
+ CPU_SET( 0, &cpu_set);\r
+ hplib_utilSetupThread(0, &cpu_set);\r
\r
\r
/*******************************************/\r
index bd066a2b9995cd557f9abd4d32badd3b5cf3d776..87f2adfafef0fdbeaa0c27f832087675303b530b 100755 (executable)
extern netTestStats_T stats[TUNE_NETAPI_NUM_CORES];
extern paSysStats_t netcp_stats;
-#ifdef netTest_MULTI_THREAD
- cpu_set_t cpu_set;
-#endif
netTestConfig_t netTestCfg;
static netTestConfigFile_t config_file;
-char input_file_name[] = "net_test_config.txt";
-
+char input_file_name[] = "/etc/netapi/net_test_config.txt";
nwal_RetValue nwalRetVal;
Pktlib_HeapHandle ourHeap;
PKTIO_HANDLE_T *rx_chan;
PKTIO_HANDLE_T *sb_rx_chan;
+
+ cpu_set_t cpu_set;
+
thread_num = netTestCfg.sp_thread_num[index];
printf("slow_path_thread, mypid: %d, core_id %d\n", gettid(), netTestCfg.sp_thread_num[index]);
PKTIO_HANDLE_T *sb_rx_chan;
uint32_t thread_num;
+
+ cpu_set_t cpu_set;
+
CPU_ZERO( &cpu_set);
printf("fast_path_thread: settting up for thread number %d\n", netTestCfg.fp_thread_num[index]);
thread_num = netTestCfg.fp_thread_num[index];
Pktlib_HeapIfTable* pPktifTable;
FILE * fpr = NULL;
+#ifdef netTest_MULTI_THREAD
+ cpu_set_t cpu_set;
+#endif
/* install signal handler for ^c */
signal(SIGINT,netTest_utilMySig);
}
if (fpr == NULL)
{
+ printf("Cant open config file: filepath %s, %s\n", input_file_name, strerror(errno));
exit(1);
}
else
index 67d752e70c4b481f8fcf77a60d5686e6c400c576..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 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);
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);
Pktlib_HeapIfTable* pPktifTable;
FILE * fpr = NULL;
+ cpu_set_t cpu_set;
/* install signal handler for ^c */
signal(SIGINT,netTest_utilMySig);
index a771876c5f3dd44934fb7b76160f107b6563d300..8fe90af90b850dd14f6768ea424a749c10cb5553 100644 (file)
#modprobe hplibmod
#
-cat /proc/netapi
+#cat /proc/netapi
#
devmem2 0x2090804 w 0x4
+/usr/bin/net_test
#