diff options
author | Jere Leppänen <jere.leppanen@nokia.com> | 2021-08-13 13:17:51 +0300 |
---|---|---|
committer | Petri Savolainen <petri.savolainen@nokia.com> | 2021-09-30 11:10:11 +0300 |
commit | 4afbff3323cf1d2f88e51eb6133cbc9c335bc0d7 (patch) | |
tree | 0911a73efd0a5812329181a8160e2d8e457e7b54 /test/performance/odp_ipsec.c | |
parent | 654273013d21c3d4fb9ba7070f2195833aa23e94 (diff) |
use odph_thread_create() instead of odph_odpthreads_create()
Use the newer odph_thread_create() and odph_thread_join() functions in
examples and tests instead of the deprecated odph_odpthreads_create()
and odph_odpthreads_join().
Signed-off-by: Jere Leppänen <jere.leppanen@nokia.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
Diffstat (limited to 'test/performance/odp_ipsec.c')
-rw-r--r-- | test/performance/odp_ipsec.c | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/test/performance/odp_ipsec.c b/test/performance/odp_ipsec.c index 40591092a..04788995e 100644 --- a/test/performance/odp_ipsec.c +++ b/test/performance/odp_ipsec.c @@ -1027,7 +1027,9 @@ int main(int argc, char *argv[]) char cpumaskstr[ODP_CPUMASK_STR_SIZE]; int num_workers = 1; odph_helper_options_t helper_options; - odph_odpthread_t thr[num_workers]; + odph_thread_t thread_tbl[num_workers]; + odph_thread_common_param_t thr_common; + odph_thread_param_t thr_param; odp_instance_t instance; odp_init_t init_param; odp_ipsec_capability_t ipsec_capa; @@ -1164,20 +1166,22 @@ int main(int argc, char *argv[]) printf("Run in sync mode\n"); } - memset(thr, 0, sizeof(thr)); - if (cargs.alg_config) { - odph_odpthread_params_t thr_param; - - memset(&thr_param, 0, sizeof(thr_param)); - thr_param.start = run_thr_func; - thr_param.arg = &thr_arg; - thr_param.thr_type = ODP_THREAD_WORKER; - thr_param.instance = instance; + odph_thread_common_param_init(&thr_common); + thr_common.instance = instance; + thr_common.cpumask = &cpumask; + thr_common.share_param = 1; if (cargs.schedule) { - odph_odpthreads_create(&thr[0], &cpumask, &thr_param); - odph_odpthreads_join(&thr[0]); + odph_thread_param_init(&thr_param); + thr_param.start = run_thr_func; + thr_param.arg = &thr_arg; + thr_param.thr_type = ODP_THREAD_WORKER; + + memset(thread_tbl, 0, sizeof(thread_tbl)); + odph_thread_create(thread_tbl, &thr_common, &thr_param, num_workers); + + odph_thread_join(thread_tbl, num_workers); } else { run_measure_one_config(&cargs, cargs.alg_config); } |