diff options
author | Petri Savolainen <petri.savolainen@nokia.com> | 2015-10-30 11:25:00 +0200 |
---|---|---|
committer | Maxim Uvarov <maxim.uvarov@linaro.org> | 2015-11-03 16:36:13 +0300 |
commit | 96a558c4c6aa81e53c0672670fed08a176067aea (patch) | |
tree | fc7ae72d06baaa4737e2075cd1bad6d2b4bd1b18 | |
parent | ac4d1b97deb4682a090111043a9515ee829cf2bc (diff) |
test: l2fwd: start pktios after worker thread create
More controlled startup sequence:
* Create and configure pktios
* Create and start workers
* Enable packet rx and tx
Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com>
Reviewed-by: Nicolas Morey-Chaisemartin <nmorey@kalray.eu>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
-rw-r--r-- | test/performance/odp_l2fwd.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/test/performance/odp_l2fwd.c b/test/performance/odp_l2fwd.c index 69b67a045..5830a0221 100644 --- a/test/performance/odp_l2fwd.c +++ b/test/performance/odp_l2fwd.c @@ -541,15 +541,8 @@ int main(int argc, char *argv[]) /* Save interface destination port */ gbl_args->dst_port[i] = find_dest_port(i); - - ret = odp_pktio_start(pktio); - if (ret) { - LOG_ERR("Error: unable to start %s\n", - gbl_args->appl.if_names[i]); - exit(EXIT_FAILURE); - } - } + gbl_args->pktios[i] = ODP_PKTIO_INVALID; memset(thread_tbl, 0, sizeof(thread_tbl)); @@ -580,6 +573,17 @@ int main(int argc, char *argv[]) cpu = odp_cpumask_next(&cpumask, cpu); } + /* Start packet receive and transmit */ + for (i = 0; i < gbl_args->appl.if_count; ++i) { + pktio = gbl_args->pktios[i]; + ret = odp_pktio_start(pktio); + if (ret) { + LOG_ERR("Error: unable to start %s\n", + gbl_args->appl.if_names[i]); + exit(EXIT_FAILURE); + } + } + ret = print_speed_stats(num_workers, stats, gbl_args->appl.time, gbl_args->appl.accuracy); free(stats); |