aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorChristophe Milard <christophe.milard@linaro.org>2016-04-14 11:56:08 +0200
committerMaxim Uvarov <maxim.uvarov@linaro.org>2016-05-23 15:06:58 +0300
commitbe0c128ccc69427182a20ea943e441abad8519f2 (patch)
treee28df65bcb90066a2d279b21a62f4082b96c8ed3 /test
parentd4e4c62b8e8b0ae47f2f4174ca5bfecb4426be17 (diff)
performance: odp_l2fwd: using agnostic function for ODP threads
odp_l2fwd is changed to use the implementation agnostic ODP thread create and join functions, from helpers. odp_l2fwd is hence no longer aware on how the odpthread is implemented. Signed-off-by: Christophe Milard <christophe.milard@linaro.org> Reviewed-by: Brian Brooks <brian.brooks@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'test')
-rw-r--r--test/performance/odp_l2fwd.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/test/performance/odp_l2fwd.c b/test/performance/odp_l2fwd.c
index 8b8347590..9a8d578f8 100644
--- a/test/performance/odp_l2fwd.c
+++ b/test/performance/odp_l2fwd.c
@@ -296,7 +296,7 @@ static inline int event_queue_send(odp_queue_t queue, odp_packet_t *pkt_tbl,
*
* @param arg thread arguments of type 'thread_args_t *'
*/
-static void *run_worker_sched_mode(void *arg)
+static int run_worker_sched_mode(void *arg)
{
odp_event_t ev_tbl[MAX_PKT_BURST];
odp_packet_t pkt_tbl[MAX_PKT_BURST];
@@ -398,7 +398,7 @@ static void *run_worker_sched_mode(void *arg)
/* Make sure that latest stat writes are visible to other threads */
odp_mb_full();
- return NULL;
+ return 0;
}
/**
@@ -406,7 +406,7 @@ static void *run_worker_sched_mode(void *arg)
*
* @param arg thread arguments of type 'thread_args_t *'
*/
-static void *run_worker_plain_queue_mode(void *arg)
+static int run_worker_plain_queue_mode(void *arg)
{
int thr;
int pkts;
@@ -497,7 +497,7 @@ static void *run_worker_plain_queue_mode(void *arg)
/* Make sure that latest stat writes are visible to other threads */
odp_mb_full();
- return NULL;
+ return 0;
}
/**
@@ -505,7 +505,7 @@ static void *run_worker_plain_queue_mode(void *arg)
*
* @param arg thread arguments of type 'thread_args_t *'
*/
-static void *run_worker_direct_mode(void *arg)
+static int run_worker_direct_mode(void *arg)
{
int thr;
int pkts;
@@ -591,7 +591,7 @@ static void *run_worker_direct_mode(void *arg)
/* Make sure that latest stat writes are visible to other threads */
odp_mb_full();
- return NULL;
+ return 0;
}
/**
@@ -1287,7 +1287,7 @@ static void gbl_args_init(args_t *args)
*/
int main(int argc, char *argv[])
{
- odph_linux_pthread_t thread_tbl[MAX_WORKERS];
+ odph_odpthread_t thread_tbl[MAX_WORKERS];
odp_pool_t pool;
int i;
int cpu;
@@ -1300,7 +1300,7 @@ int main(int argc, char *argv[])
int ret;
stats_t *stats;
int if_count;
- void *(*thr_run_func)(void *);
+ int (*thr_run_func)(void *);
odp_instance_t instance;
/* Init ODP before calling anything else */
@@ -1435,7 +1435,7 @@ int main(int argc, char *argv[])
cpu = odp_cpumask_first(&cpumask);
for (i = 0; i < num_workers; ++i) {
odp_cpumask_t thd_mask;
- odph_linux_thr_params_t thr_params;
+ odph_odpthread_params_t thr_params;
memset(&thr_params, 0, sizeof(thr_params));
thr_params.start = thr_run_func;
@@ -1447,8 +1447,8 @@ int main(int argc, char *argv[])
odp_cpumask_zero(&thd_mask);
odp_cpumask_set(&thd_mask, cpu);
- odph_linux_pthread_create(&thread_tbl[i], &thd_mask,
- &thr_params);
+ odph_odpthreads_create(&thread_tbl[i], &thd_mask,
+ &thr_params);
cpu = odp_cpumask_next(&cpumask, cpu);
}
@@ -1470,7 +1470,8 @@ int main(int argc, char *argv[])
exit_threads = 1;
/* Master thread waits for other threads to exit */
- odph_linux_pthread_join(thread_tbl, num_workers);
+ for (i = 0; i < num_workers; ++i)
+ odph_odpthreads_join(&thread_tbl[i]);
free(gbl_args->appl.if_names);
free(gbl_args->appl.if_str);