aboutsummaryrefslogtreecommitdiff
path: root/test/performance/odp_sched_pktio.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/performance/odp_sched_pktio.c')
-rw-r--r--test/performance/odp_sched_pktio.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/test/performance/odp_sched_pktio.c b/test/performance/odp_sched_pktio.c
index 927d35cbd..ceaef0898 100644
--- a/test/performance/odp_sched_pktio.c
+++ b/test/performance/odp_sched_pktio.c
@@ -1081,10 +1081,10 @@ static int stop_pktios(test_global_t *test_global)
return ret;
}
-static void empty_queues(void)
+static void empty_queues(uint64_t wait_ns)
{
odp_event_t ev;
- uint64_t wait_time = odp_schedule_wait_time(ODP_TIME_SEC_IN_NS / 2);
+ uint64_t wait_time = odp_schedule_wait_time(wait_ns);
/* Drop all events from all queues */
while (1) {
@@ -1365,7 +1365,6 @@ static int start_timers(test_global_t *test_global)
static void destroy_timers(test_global_t *test_global)
{
int i, j;
- odp_event_t event;
odp_timer_t timer;
int num_pktio = test_global->opt.num_pktio;
int num_queue = test_global->opt.num_pktio_queue;
@@ -1375,6 +1374,9 @@ static void destroy_timers(test_global_t *test_global)
if (timer_pool == ODP_TIMER_POOL_INVALID)
return;
+ /* Wait any remaining timers to expire */
+ empty_queues(2000 * test_global->opt.timeout_us);
+
for (i = 0; i < num_pktio; i++) {
for (j = 0; j < num_queue; j++) {
timer = test_global->timer.timer[i][j];
@@ -1382,10 +1384,8 @@ static void destroy_timers(test_global_t *test_global)
if (timer == ODP_TIMER_INVALID)
break;
- event = odp_timer_free(timer);
-
- if (event != ODP_EVENT_INVALID)
- odp_event_free(event);
+ if (odp_timer_free(timer))
+ printf("Timer free failed: %i, %i\n", i, j);
}
}
@@ -1552,7 +1552,7 @@ int main(int argc, char *argv[])
quit:
stop_pktios(test_global);
- empty_queues();
+ empty_queues(ODP_TIME_SEC_IN_NS / 2);
close_pktios(test_global);
destroy_pipeline_queues(test_global);
destroy_timers(test_global);