From 454b43408419186e9ae67d32143725831e4b3bef Mon Sep 17 00:00:00 2001 From: Pavan Nikhilesh Date: Thu, 10 Aug 2023 20:27:40 +0530 Subject: [PATCH] test: sched_pktio: remove unnecessary delay first tick Remove unnecessary delay for the first tick as it might cause ODP_TIMER_TOO_FAR error base on the timer pool created. Reorder start_pktios with start_timers to prevent timeouts due to delays in pktio start. Signed-off-by: Pavan Nikhilesh --- test/performance/odp_sched_pktio.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/test/performance/odp_sched_pktio.c b/test/performance/odp_sched_pktio.c index b3356e2b154..6476fc4352f 100644 --- a/test/performance/odp_sched_pktio.c +++ b/test/performance/odp_sched_pktio.c @@ -26,7 +26,6 @@ #define MIN_PKT_SEG_LEN 64 #define CHECK_PERIOD 10000 #define TEST_PASSED_LIMIT 5000 -#define TIMEOUT_OFFSET_NS 1000000 #define SCHED_MODE_PARAL 1 #define SCHED_MODE_ATOMIC 2 #define SCHED_MODE_ORDER 3 @@ -1337,10 +1336,6 @@ static int start_timers(test_global_t *test_global) if (test_global->opt.timeout_us == 0) return 0; - /* Delay the first timeout so that workers have time to startup */ - timeout_tick += odp_timer_ns_to_tick(test_global->timer.timer_pool, - TIMEOUT_OFFSET_NS); - start_param.tick_type = ODP_TIMER_TICK_REL; start_param.tick = timeout_tick; @@ -1532,7 +1527,7 @@ int main(int argc, char *argv[]) if (create_timers(test_global)) goto quit; - if (start_timers(test_global)) + if (start_pktios(test_global)) goto quit; odp_barrier_init(&test_global->worker_start, @@ -1540,15 +1535,13 @@ int main(int argc, char *argv[]) start_workers(thread, test_global); + if (start_timers(test_global)) + goto quit; + /* Synchronize pktio configuration with workers. Worker are now ready * to process packets. */ odp_barrier_wait(&test_global->worker_start); - if (start_pktios(test_global)) { - test_global->stop_workers = 1; - odp_mb_full(); - } - t1 = odp_time_local(); wait_workers(thread, test_global);