aboutsummaryrefslogtreecommitdiff
path: root/test/performance/odp_sched_pktio.c
diff options
context:
space:
mode:
authorMatias Elo <matias.elo@nokia.com>2021-10-11 16:37:51 +0300
committerGitHub <noreply@github.com>2021-10-11 16:37:51 +0300
commit50c7b605b97474d26fcf600b4061968e3543b45b (patch)
treebb5541aab05c99d762a054a9f1fe64cd002d7f86 /test/performance/odp_sched_pktio.c
parent54ca03915ddf070a3c67f6a3c89f442c202a1adb (diff)
parentec77bf59d3407278625c28a8d47c3dab9627a91f (diff)
Merge ODP v1.32.0.0v1.32.0.0_DPDK_19.11
Merge ODP linux-generic v1.32.0.0 into ODP-DPDK.
Diffstat (limited to 'test/performance/odp_sched_pktio.c')
-rw-r--r--test/performance/odp_sched_pktio.c51
1 files changed, 28 insertions, 23 deletions
diff --git a/test/performance/odp_sched_pktio.c b/test/performance/odp_sched_pktio.c
index cbdbdf4aa..589b58d97 100644
--- a/test/performance/odp_sched_pktio.c
+++ b/test/performance/odp_sched_pktio.c
@@ -1396,45 +1396,50 @@ static void destroy_timers(test_global_t *test_global)
odp_timer_pool_destroy(timer_pool);
}
-static void start_workers(odph_odpthread_t thread[],
+static void start_workers(odph_thread_t thread[],
test_global_t *test_global)
{
int i;
odp_cpumask_t cpumask;
- odph_odpthread_params_t param;
+ odph_thread_common_param_t thr_common;
+ odph_thread_param_t thr_param[MAX_WORKERS];
int num = test_global->opt.num_worker;
- memset(&param, 0, sizeof(odph_odpthread_params_t));
+ odp_cpumask_zero(&cpumask);
- if (test_global->opt.timeout_us)
- param.start = worker_thread_timers;
- else if (test_global->opt.pipe_stages)
- param.start = worker_thread_pipeline;
- else
- param.start = worker_thread_direct;
-
- param.thr_type = ODP_THREAD_WORKER;
- param.instance = test_global->instance;
-
- memset(thread, 0, num * sizeof(odph_odpthread_t));
+ odph_thread_common_param_init(&thr_common);
+ thr_common.instance = test_global->instance;
+ thr_common.cpumask = &cpumask;
for (i = 0; i < num; i++) {
- odp_cpumask_zero(&cpumask);
odp_cpumask_set(&cpumask, test_global->worker_cpu[i]);
test_global->worker_arg[i].worker_id = i;
test_global->worker_arg[i].test_global_ptr = test_global;
- param.arg = &test_global->worker_arg[i];
- odph_odpthreads_create(&thread[i], &cpumask, &param);
+ odph_thread_param_init(&thr_param[i]);
+
+ if (!i) {
+ if (test_global->opt.timeout_us)
+ thr_param[0].start = worker_thread_timers;
+ else if (test_global->opt.pipe_stages)
+ thr_param[0].start = worker_thread_pipeline;
+ else
+ thr_param[0].start = worker_thread_direct;
+ } else {
+ thr_param[i].start = thr_param[0].start;
+ }
+
+ thr_param[i].arg = &test_global->worker_arg[i];
+ thr_param[i].thr_type = ODP_THREAD_WORKER;
}
+
+ memset(thread, 0, num * sizeof(odph_thread_t));
+ odph_thread_create(thread, &thr_common, thr_param, num);
}
-static void wait_workers(odph_odpthread_t thread[], test_global_t *test_global)
+static void wait_workers(odph_thread_t thread[], test_global_t *test_global)
{
- int i;
-
- for (i = 0; i < test_global->opt.num_worker; ++i)
- odph_odpthreads_join(&thread[i]);
+ odph_thread_join(thread, test_global->opt.num_worker);
}
int main(int argc, char *argv[])
@@ -1444,7 +1449,7 @@ int main(int argc, char *argv[])
odp_shm_t shm;
odp_time_t t1 = ODP_TIME_NULL, t2 = ODP_TIME_NULL;
odph_helper_options_t helper_options;
- odph_odpthread_t thread[MAX_WORKERS];
+ odph_thread_t thread[MAX_WORKERS];
test_options_t test_options;
int ret = 0;