From 41f27795bb947c9aa1d02e0c8a2688af2a3197ba Mon Sep 17 00:00:00 2001 From: Pavan Nikhilesh Date: Sun, 7 Mar 2021 01:56:58 +0530 Subject: [PATCH] test/event: fix timeout accuracy Round timeout ticks when converting from nanoseconds, this prevents loss of accuracy and deviation from requested timeout value. Fixes: d1f3385d0076 ("test: add event timer adapter auto-test") Cc: stable@dpdk.org Signed-off-by: Pavan Nikhilesh Acked-by: Erik Gabriel Carrillo --- app/test/test_event_timer_adapter.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/test/test_event_timer_adapter.c b/app/test/test_event_timer_adapter.c index ad3f4dcc20..b536ddef40 100644 --- a/app/test/test_event_timer_adapter.c +++ b/app/test/test_event_timer_adapter.c @@ -3,6 +3,8 @@ * Copyright(c) 2017-2018 Intel Corporation. */ +#include + #include #include #include @@ -46,7 +48,7 @@ static uint64_t global_info_bkt_tck_ns; static volatile uint8_t arm_done; #define CALC_TICKS(tks) \ - ((tks * global_bkt_tck_ns) / global_info_bkt_tck_ns) + ceil((double)(tks * global_bkt_tck_ns) / global_info_bkt_tck_ns) static bool using_services; -- 2.20.1