Skip to content

Commit

Permalink
test: sched_pktio: remove unnecessary delay first tick
Browse files Browse the repository at this point in the history
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 <pbhagavatula@marvell.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
  • Loading branch information
PavanNikhilesh committed Aug 23, 2023
1 parent 9dd86d4 commit aad6ad2
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions test/performance/odp_sched_pktio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -1532,23 +1527,23 @@ 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,
test_global->opt.num_worker + 1);

start_workers(thread, test_global);

/* Synchronize pktio configuration with workers. Worker are now ready
* to process packets. */
odp_barrier_wait(&test_global->worker_start);

if (start_pktios(test_global)) {
if (start_timers(test_global)) {
test_global->stop_workers = 1;
odp_mb_full();
}

/* Synchronize pktio configuration with workers. Worker are now ready
* to process packets. */
odp_barrier_wait(&test_global->worker_start);

t1 = odp_time_local();

wait_workers(thread, test_global);
Expand Down

0 comments on commit aad6ad2

Please sign in to comment.