From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 29019428C6; Tue, 4 Apr 2023 12:52:33 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7984241141; Tue, 4 Apr 2023 12:52:32 +0200 (CEST) Received: from mail-vs1-f46.google.com (mail-vs1-f46.google.com [209.85.217.46]) by mails.dpdk.org (Postfix) with ESMTP id 6AE8B40A7E; Tue, 4 Apr 2023 12:52:31 +0200 (CEST) Received: by mail-vs1-f46.google.com with SMTP id d2so28013383vso.9; Tue, 04 Apr 2023 03:52:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680605551; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=m2hZ8TVv52imusL7e8A68qReM9MJgTCJV/Jr/iTzcsA=; b=L54saFCwGo8A4wMFR7wfWhO8MM0fa62SAQ/R9JAVbKUGfpViIoDTcHkFCOyBfANuHP LfCPG8qDXhHM/wiK1bInaXv5+HY27vgXq9EUwAXS55Rx3rnVgQ0vtUh83HUAm2ZY2+go FVB3U/okppewmnoSL5nEa/HgiVH8s1F/Gz1U3V8oFKne5oMeWyAVDkGt/ZBg8ax6Eadb /bx/JmIU+z5L4k6R/jlV2ThOTku9HCpagd/BgjI1kAQlMnp4jc7tRG/7O5UyoFK4z8az YvnIR7pPk/AR2cvun5rZuyp/FPm4kwlzzl1Ujf3YmS5w/PeSmurQ7fPW6zq1VuE9EDbN v2QQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680605551; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=m2hZ8TVv52imusL7e8A68qReM9MJgTCJV/Jr/iTzcsA=; b=nP8Lohkp4BsLalexydI82PQqeP+C1SCdv/qSiFrH+N5dyYlus0Ird423JoWahgfLgS SqH9UjMsJWo4uk6ni7Ej8wLAxf4tA3Xz1cv10ETyhsGLLZ3H585DUtVHPIeOfk9+6QN8 O5OInHaGCqE1GaG8BVQOyPyvCR+80c7VCadsrGZTJx/1eEZS9PEAoaroBfnxDdAsPixs a8ngPCmSeXOcX60QYLfwUDd1+WTY39gceWkQYnM7x+WMQFPTAtVCMWBm0V0nuxjbsuOq 2g2nuB0ArwU9vMVdbdIyqchdDxQMZn5PYaQDNAZPW0UklhmZ7r2yPRxl9GrAzYSnOOjA 1OIg== X-Gm-Message-State: AAQBX9eDda4bNtK8EipdAuToff4lWRhlsFna7It/Lliq8VLkLZHgWnTy HUVemFdymuR1SZhQgPRfT8MBTmxXaNDhmT9sYkY= X-Google-Smtp-Source: AKy350bQ58CwO5o0tZPLxNfy+8q3vxVRPW41dojy4Q/kuYc80Xx7tUs3DDocqqJpODlaXSAJRH+QnJRGqng9lQT+UTs= X-Received: by 2002:a67:c01c:0:b0:411:f6d4:1be9 with SMTP id v28-20020a67c01c000000b00411f6d41be9mr1849145vsi.5.1680605550411; Tue, 04 Apr 2023 03:52:30 -0700 (PDT) MIME-Version: 1.0 References: <90fb5b328eda4c7f83cfb11998ba32a01935ff8e.1679375813.git.sthotton@marvell.com> In-Reply-To: <90fb5b328eda4c7f83cfb11998ba32a01935ff8e.1679375813.git.sthotton@marvell.com> From: Jerin Jacob Date: Tue, 4 Apr 2023 16:22:04 +0530 Message-ID: Subject: Re: [PATCH v2] eventdev/timer: fix timeout event wait behavior To: Shijith Thotton Cc: erik.g.carrillo@intel.com, jerinj@marvell.com, dev@dpdk.org, pbhagavatula@marvell.com, stable@dpdk.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Tue, Mar 21, 2023 at 10:51=E2=80=AFAM Shijith Thotton wrote: > > Improved the accuracy and consistency of timeout event wait behavior by > refactoring it. Previously, the delay function used for waiting could be > inaccurate, leading to inconsistent results. This commit updates the > wait behavior to use a timeout-based approach, enabling the wait for the > exact number of timer ticks before proceeding. > > The new function timeout_event_dequeue mimics the behavior of the tested > systems closely. It dequeues timer expiry events until either the > expected number of events have been dequeued or the specified time has > elapsed. The WAIT_TICKS macro defines the waiting behavior based on the > type of timer being used (software or hardware). > > Fixes: d1f3385d0076 ("test: add event timer adapter auto-test") > > Signed-off-by: Shijith Thotton > --- > v2: > - Updated commit message and added fixed tag. Erik, Could you review this? > > app/test/test_event_timer_adapter.c | 169 +++++++++++----------------- > 1 file changed, 68 insertions(+), 101 deletions(-) > > diff --git a/app/test/test_event_timer_adapter.c b/app/test/test_event_ti= mer_adapter.c > index 5e7feec1c7..510bebcf86 100644 > --- a/app/test/test_event_timer_adapter.c > +++ b/app/test/test_event_timer_adapter.c > @@ -57,9 +57,10 @@ static uint64_t global_bkt_tck_ns; > static uint64_t global_info_bkt_tck_ns; > static volatile uint8_t arm_done; > > -#define CALC_TICKS(tks) \ > - ceil((double)(tks * global_bkt_tck_ns) / global_info_bkt_tck_ns) > +#define CALC_TICKS(tks) ceil((double)((tks) * global_bkt_tck_ns) / globa= l_info_bkt_tck_ns) > > +/* Wait double timeout ticks for software and an extra tick for hardware= */ > +#define WAIT_TICKS(tks) (using_services ? 2 * (tks) : tks + 1) > > static bool using_services; > static uint32_t test_lcore1; > @@ -441,10 +442,31 @@ timdev_teardown(void) > rte_mempool_free(eventdev_test_mempool); > } > > +static inline uint16_t > +timeout_event_dequeue(struct rte_event *evs, uint64_t nb_evs, uint64_t t= icks) > +{ > + uint16_t ev_cnt =3D 0; > + uint64_t end_cycle; > + > + if (using_services && nb_evs =3D=3D MAX_TIMERS) > + ticks =3D 2 * ticks; > + > + end_cycle =3D rte_rdtsc() + ticks * global_bkt_tck_ns * rte_get_t= sc_hz() / 1E9; > + > + while (ev_cnt < nb_evs && rte_rdtsc() < end_cycle) { > + ev_cnt +=3D rte_event_dequeue_burst(evdev, TEST_PORT_ID, = &evs[ev_cnt], nb_evs, 0); > + rte_pause(); > + } > + > + return ev_cnt; > +} > + > static inline int > test_timer_state(void) > { > struct rte_event_timer *ev_tim; > + const uint64_t max_ticks =3D 100; > + uint64_t ticks, wait_ticks; > struct rte_event ev; > const struct rte_event_timer tim =3D { > .ev.op =3D RTE_EVENT_OP_NEW, > @@ -455,11 +477,10 @@ test_timer_state(void) > .state =3D RTE_EVENT_TIMER_NOT_ARMED, > }; > > - > rte_mempool_get(eventdev_test_mempool, (void **)&ev_tim); > *ev_tim =3D tim; > ev_tim->ev.event_ptr =3D ev_tim; > - ev_tim->timeout_ticks =3D CALC_TICKS(120); > + ev_tim->timeout_ticks =3D CALC_TICKS(max_ticks + 20); > > TEST_ASSERT_EQUAL(rte_event_timer_arm_burst(timdev, &ev_tim, 1), = 0, > "Armed timer exceeding max_timeout."); > @@ -467,8 +488,9 @@ test_timer_state(void) > "Improper timer state set expected %d returned %d= ", > RTE_EVENT_TIMER_ERROR_TOOLATE, ev_tim->state); > > + ticks =3D 10; > ev_tim->state =3D RTE_EVENT_TIMER_NOT_ARMED; > - ev_tim->timeout_ticks =3D CALC_TICKS(10); > + ev_tim->timeout_ticks =3D CALC_TICKS(ticks); > > TEST_ASSERT_EQUAL(rte_event_timer_arm_burst(timdev, &ev_tim, 1), = 1, > "Failed to arm timer with proper timeout."); > @@ -477,14 +499,15 @@ test_timer_state(void) > RTE_EVENT_TIMER_ARMED, ev_tim->state); > > if (!using_services) > - rte_delay_us(20); > + wait_ticks =3D 2 * ticks; > else > - rte_delay_us(1000 + 200); > - TEST_ASSERT_EQUAL(rte_event_dequeue_burst(evdev, 0, &ev, 1, 0), 1= , > - "Armed timer failed to trigger."); > + wait_ticks =3D ticks; > + > + TEST_ASSERT_EQUAL(timeout_event_dequeue(&ev, 1, WAIT_TICKS(wait_t= icks)), 1, > + "Armed timer failed to trigger."); > > ev_tim->state =3D RTE_EVENT_TIMER_NOT_ARMED; > - ev_tim->timeout_ticks =3D CALC_TICKS(90); > + ev_tim->timeout_ticks =3D CALC_TICKS(max_ticks - 10); > TEST_ASSERT_EQUAL(rte_event_timer_arm_burst(timdev, &ev_tim, 1), = 1, > "Failed to arm timer with proper timeout."); > TEST_ASSERT_EQUAL(rte_event_timer_cancel_burst(timdev, &ev_tim, 1= ), > @@ -1208,8 +1231,9 @@ stat_inc_reset_ev_enq(void) > int ret, i, n; > int num_evtims =3D MAX_TIMERS; > struct rte_event_timer *evtims[num_evtims]; > - struct rte_event evs[BATCH_SIZE]; > + struct rte_event evs[num_evtims]; > struct rte_event_timer_adapter_stats stats; > + uint64_t ticks =3D 5; > const struct rte_event_timer init_tim =3D { > .ev.op =3D RTE_EVENT_OP_NEW, > .ev.queue_id =3D TEST_QUEUE_ID, > @@ -1217,7 +1241,7 @@ stat_inc_reset_ev_enq(void) > .ev.priority =3D RTE_EVENT_DEV_PRIORITY_NORMAL, > .ev.event_type =3D RTE_EVENT_TYPE_TIMER, > .state =3D RTE_EVENT_TIMER_NOT_ARMED, > - .timeout_ticks =3D CALC_TICKS(5), // expire in .5 sec > + .timeout_ticks =3D CALC_TICKS(ticks), /**< expire in .5 s= ec */ > }; > > ret =3D rte_mempool_get_bulk(eventdev_test_mempool, (void **)evti= ms, > @@ -1242,31 +1266,12 @@ stat_inc_reset_ev_enq(void) > "succeeded =3D %d, rte_errno =3D %s", > num_evtims, ret, rte_strerror(rte_errno)); > > - rte_delay_ms(1000); > - > -#define MAX_TRIES num_evtims > - int sum =3D 0; > - int tries =3D 0; > - bool done =3D false; > - while (!done) { > - sum +=3D rte_event_dequeue_burst(evdev, TEST_PORT_ID, evs= , > - RTE_DIM(evs), 10); > - if (sum >=3D num_evtims || ++tries >=3D MAX_TRIES) > - done =3D true; > - > - rte_delay_ms(10); > - } > - > - TEST_ASSERT_EQUAL(sum, num_evtims, "Expected %d timer expiry even= ts, " > - "got %d", num_evtims, sum); > - > - TEST_ASSERT(tries < MAX_TRIES, "Exceeded max tries"); > - > - rte_delay_ms(100); > + n =3D timeout_event_dequeue(evs, RTE_DIM(evs), WAIT_TICKS(ticks))= ; > + TEST_ASSERT_EQUAL(n, num_evtims, "Expected %d timer expiry events= , got %d", > + num_evtims, n); > > /* Make sure the eventdev is still empty */ > - n =3D rte_event_dequeue_burst(evdev, TEST_PORT_ID, evs, RTE_DIM(e= vs), > - 10); > + n =3D timeout_event_dequeue(evs, 1, WAIT_TICKS(1)); > > TEST_ASSERT_EQUAL(n, 0, "Dequeued unexpected number of timer expi= ry " > "events from event device"); > @@ -1303,6 +1308,7 @@ event_timer_arm(void) > struct rte_event_timer_adapter *adapter =3D timdev; > struct rte_event_timer *evtim =3D NULL; > struct rte_event evs[BATCH_SIZE]; > + uint64_t ticks =3D 5; > const struct rte_event_timer init_tim =3D { > .ev.op =3D RTE_EVENT_OP_NEW, > .ev.queue_id =3D TEST_QUEUE_ID, > @@ -1310,7 +1316,7 @@ event_timer_arm(void) > .ev.priority =3D RTE_EVENT_DEV_PRIORITY_NORMAL, > .ev.event_type =3D RTE_EVENT_TYPE_TIMER, > .state =3D RTE_EVENT_TIMER_NOT_ARMED, > - .timeout_ticks =3D CALC_TICKS(5), // expire in .5 sec > + .timeout_ticks =3D CALC_TICKS(ticks), /**< expire in .5 s= ec */ > }; > > rte_mempool_get(eventdev_test_mempool, (void **)&evtim); > @@ -1337,10 +1343,7 @@ event_timer_arm(void) > TEST_ASSERT_EQUAL(rte_errno, EALREADY, "Unexpected rte_errno valu= e " > "after arming already armed timer"); > > - /* Let timer expire */ > - rte_delay_ms(1000); > - > - n =3D rte_event_dequeue_burst(evdev, TEST_PORT_ID, evs, RTE_DIM(e= vs), 0); > + n =3D timeout_event_dequeue(evs, RTE_DIM(evs), WAIT_TICKS(ticks))= ; > TEST_ASSERT_EQUAL(n, 1, "Failed to dequeue expected number of exp= iry " > "events from event device"); > > @@ -1360,6 +1363,7 @@ event_timer_arm_double(void) > struct rte_event_timer_adapter *adapter =3D timdev; > struct rte_event_timer *evtim =3D NULL; > struct rte_event evs[BATCH_SIZE]; > + uint64_t ticks =3D 5; > const struct rte_event_timer init_tim =3D { > .ev.op =3D RTE_EVENT_OP_NEW, > .ev.queue_id =3D TEST_QUEUE_ID, > @@ -1367,7 +1371,7 @@ event_timer_arm_double(void) > .ev.priority =3D RTE_EVENT_DEV_PRIORITY_NORMAL, > .ev.event_type =3D RTE_EVENT_TYPE_TIMER, > .state =3D RTE_EVENT_TIMER_NOT_ARMED, > - .timeout_ticks =3D CALC_TICKS(5), // expire in .5 sec > + .timeout_ticks =3D CALC_TICKS(ticks), /**< expire in .5 s= ec */ > }; > > rte_mempool_get(eventdev_test_mempool, (void **)&evtim); > @@ -1387,10 +1391,7 @@ event_timer_arm_double(void) > TEST_ASSERT_EQUAL(rte_errno, EALREADY, "Unexpected rte_errno valu= e " > "after double-arm"); > > - /* Let timer expire */ > - rte_delay_ms(600); > - > - n =3D rte_event_dequeue_burst(evdev, TEST_PORT_ID, evs, RTE_DIM(e= vs), 0); > + n =3D timeout_event_dequeue(evs, RTE_DIM(evs), WAIT_TICKS(ticks))= ; > TEST_ASSERT_EQUAL(n, 1, "Dequeued incorrect number of expiry even= ts - " > "expected: 1, actual: %d", n); > > @@ -1417,6 +1418,7 @@ event_timer_arm_expiry(void) > .ev.event_type =3D RTE_EVENT_TYPE_TIMER, > .state =3D RTE_EVENT_TIMER_NOT_ARMED, > }; > + uint64_t ticks =3D 30; > > rte_mempool_get(eventdev_test_mempool, (void **)&evtim); > if (evtim =3D=3D NULL) { > @@ -1426,7 +1428,7 @@ event_timer_arm_expiry(void) > > /* Set up an event timer */ > *evtim =3D init_tim; > - evtim->timeout_ticks =3D CALC_TICKS(30), // expire in 3 secs > + evtim->timeout_ticks =3D CALC_TICKS(ticks); /**< expire in 3 secs= */ > evtim->ev.event_ptr =3D evtim; > > ret =3D rte_event_timer_arm_burst(adapter, &evtim, 1); > @@ -1435,17 +1437,10 @@ event_timer_arm_expiry(void) > TEST_ASSERT_EQUAL(evtim->state, RTE_EVENT_TIMER_ARMED, "Event " > "timer in incorrect state"); > > - rte_delay_ms(2999); > - > - n =3D rte_event_dequeue_burst(evdev, TEST_PORT_ID, evs, RTE_DIM(e= vs), 0); > + n =3D timeout_event_dequeue(evs, RTE_DIM(evs), ticks - 1); > TEST_ASSERT_EQUAL(n, 0, "Dequeued unexpected timer expiry event")= ; > > - /* Delay 100 ms to account for the adapter tick window - should l= et us > - * dequeue one event > - */ > - rte_delay_ms(100); > - > - n =3D rte_event_dequeue_burst(evdev, TEST_PORT_ID, evs, RTE_DIM(e= vs), 0); > + n =3D timeout_event_dequeue(evs, RTE_DIM(evs), WAIT_TICKS(1)); > TEST_ASSERT_EQUAL(n, 1, "Dequeued incorrect number (%d) of timer = " > "expiry events", n); > TEST_ASSERT_EQUAL(evs[0].event_type, RTE_EVENT_TYPE_TIMER, > @@ -1477,6 +1472,7 @@ event_timer_arm_rearm(void) > .ev.event_type =3D RTE_EVENT_TYPE_TIMER, > .state =3D RTE_EVENT_TIMER_NOT_ARMED, > }; > + uint64_t ticks =3D 1; > > rte_mempool_get(eventdev_test_mempool, (void **)&evtim); > if (evtim =3D=3D NULL) { > @@ -1486,7 +1482,7 @@ event_timer_arm_rearm(void) > > /* Set up a timer */ > *evtim =3D init_tim; > - evtim->timeout_ticks =3D CALC_TICKS(1); // expire in 0.1 sec > + evtim->timeout_ticks =3D CALC_TICKS(ticks); /**< expire in 0.1 se= c */ > evtim->ev.event_ptr =3D evtim; > > /* Arm it */ > @@ -1494,10 +1490,7 @@ event_timer_arm_rearm(void) > TEST_ASSERT_EQUAL(ret, 1, "Failed to arm event timer: %s\n", > rte_strerror(rte_errno)); > > - /* Add 100ms to account for the adapter tick window */ > - rte_delay_ms(100 + 100); > - > - n =3D rte_event_dequeue_burst(evdev, TEST_PORT_ID, evs, RTE_DIM(e= vs), 0); > + n =3D timeout_event_dequeue(evs, RTE_DIM(evs), WAIT_TICKS(ticks))= ; > TEST_ASSERT_EQUAL(n, 1, "Failed to dequeue expected number of exp= iry " > "events from event device"); > > @@ -1514,10 +1507,7 @@ event_timer_arm_rearm(void) > TEST_ASSERT_EQUAL(ret, 1, "Failed to arm event timer: %s\n", > rte_strerror(rte_errno)); > > - /* Add 100ms to account for the adapter tick window */ > - rte_delay_ms(100 + 100); > - > - n =3D rte_event_dequeue_burst(evdev, TEST_PORT_ID, evs, RTE_DIM(e= vs), 0); > + n =3D timeout_event_dequeue(evs, RTE_DIM(evs), WAIT_TICKS(ticks))= ; > TEST_ASSERT_EQUAL(n, 1, "Failed to dequeue expected number of exp= iry " > "events from event device"); > > @@ -1539,7 +1529,8 @@ event_timer_arm_max(void) > int ret, i, n; > int num_evtims =3D MAX_TIMERS; > struct rte_event_timer *evtims[num_evtims]; > - struct rte_event evs[BATCH_SIZE]; > + struct rte_event evs[num_evtims]; > + uint64_t ticks =3D 5; > const struct rte_event_timer init_tim =3D { > .ev.op =3D RTE_EVENT_OP_NEW, > .ev.queue_id =3D TEST_QUEUE_ID, > @@ -1547,7 +1538,7 @@ event_timer_arm_max(void) > .ev.priority =3D RTE_EVENT_DEV_PRIORITY_NORMAL, > .ev.event_type =3D RTE_EVENT_TYPE_TIMER, > .state =3D RTE_EVENT_TIMER_NOT_ARMED, > - .timeout_ticks =3D CALC_TICKS(5), // expire in .5 sec > + .timeout_ticks =3D CALC_TICKS(ticks), /**< expire in .5 s= ec */ > }; > > ret =3D rte_mempool_get_bulk(eventdev_test_mempool, (void **)evti= ms, > @@ -1567,31 +1558,12 @@ event_timer_arm_max(void) > "succeeded =3D %d, rte_errno =3D %s", > num_evtims, ret, rte_strerror(rte_errno)); > > - rte_delay_ms(1000); > - > -#define MAX_TRIES num_evtims > - int sum =3D 0; > - int tries =3D 0; > - bool done =3D false; > - while (!done) { > - sum +=3D rte_event_dequeue_burst(evdev, TEST_PORT_ID, evs= , > - RTE_DIM(evs), 10); > - if (sum >=3D num_evtims || ++tries >=3D MAX_TRIES) > - done =3D true; > - > - rte_delay_ms(10); > - } > - > - TEST_ASSERT_EQUAL(sum, num_evtims, "Expected %d timer expiry even= ts, " > - "got %d", num_evtims, sum); > - > - TEST_ASSERT(tries < MAX_TRIES, "Exceeded max tries"); > - > - rte_delay_ms(100); > + n =3D timeout_event_dequeue(evs, RTE_DIM(evs), WAIT_TICKS(ticks))= ; > + TEST_ASSERT_EQUAL(n, num_evtims, "Expected %d timer expiry events= , got %d", > + num_evtims, n); > > /* Make sure the eventdev is still empty */ > - n =3D rte_event_dequeue_burst(evdev, TEST_PORT_ID, evs, RTE_DIM(e= vs), > - 10); > + n =3D timeout_event_dequeue(evs, 1, WAIT_TICKS(1)); > > TEST_ASSERT_EQUAL(n, 0, "Dequeued unexpected number of timer expi= ry " > "events from event device"); > @@ -1711,6 +1683,7 @@ event_timer_cancel(void) > .ev.event_type =3D RTE_EVENT_TYPE_TIMER, > .state =3D RTE_EVENT_TIMER_NOT_ARMED, > }; > + uint64_t ticks =3D 30; > > rte_mempool_get(eventdev_test_mempool, (void **)&evtim); > if (evtim =3D=3D NULL) { > @@ -1728,7 +1701,7 @@ event_timer_cancel(void) > /* Set up a timer */ > *evtim =3D init_tim; > evtim->ev.event_ptr =3D evtim; > - evtim->timeout_ticks =3D CALC_TICKS(30); // expire in 3 sec > + evtim->timeout_ticks =3D CALC_TICKS(ticks); /**< expire in 3 sec = */ > > /* Check that cancelling an inited but unarmed timer fails */ > ret =3D rte_event_timer_cancel_burst(adapter, &evtim, 1); > @@ -1752,10 +1725,8 @@ event_timer_cancel(void) > TEST_ASSERT_EQUAL(evtim->state, RTE_EVENT_TIMER_CANCELED, > "evtim in incorrect state"); > > - rte_delay_ms(3000); > - > /* Make sure that no expiry event was generated */ > - n =3D rte_event_dequeue_burst(evdev, TEST_PORT_ID, evs, RTE_DIM(e= vs), 0); > + n =3D timeout_event_dequeue(evs, RTE_DIM(evs), WAIT_TICKS(ticks))= ; > TEST_ASSERT_EQUAL(n, 0, "Dequeued unexpected timer expiry event\n= "); > > rte_mempool_put(eventdev_test_mempool, evtim); > @@ -1778,8 +1749,8 @@ event_timer_cancel_double(void) > .ev.priority =3D RTE_EVENT_DEV_PRIORITY_NORMAL, > .ev.event_type =3D RTE_EVENT_TYPE_TIMER, > .state =3D RTE_EVENT_TIMER_NOT_ARMED, > - .timeout_ticks =3D CALC_TICKS(5), // expire in .5 sec > }; > + uint64_t ticks =3D 30; > > rte_mempool_get(eventdev_test_mempool, (void **)&evtim); > if (evtim =3D=3D NULL) { > @@ -1790,7 +1761,7 @@ event_timer_cancel_double(void) > /* Set up a timer */ > *evtim =3D init_tim; > evtim->ev.event_ptr =3D evtim; > - evtim->timeout_ticks =3D CALC_TICKS(30); // expire in 3 sec > + evtim->timeout_ticks =3D CALC_TICKS(ticks); /**< expire in 3 sec = */ > > ret =3D rte_event_timer_arm_burst(adapter, &evtim, 1); > TEST_ASSERT_EQUAL(ret, 1, "Failed to arm event timer: %s\n", > @@ -1812,10 +1783,8 @@ event_timer_cancel_double(void) > TEST_ASSERT_EQUAL(rte_errno, EALREADY, "Unexpected rte_errno valu= e " > "after double-cancel: rte_errno =3D %d", rte_er= rno); > > - rte_delay_ms(3000); > - > /* Still make sure that no expiry event was generated */ > - n =3D rte_event_dequeue_burst(evdev, TEST_PORT_ID, evs, RTE_DIM(e= vs), 0); > + n =3D timeout_event_dequeue(evs, RTE_DIM(evs), WAIT_TICKS(ticks))= ; > TEST_ASSERT_EQUAL(n, 0, "Dequeued unexpected timer expiry event\n= "); > > rte_mempool_put(eventdev_test_mempool, evtim); > @@ -1973,9 +1942,7 @@ test_timer_ticks_remaining(void) > rte_delay_ms(100); > } > > - rte_delay_ms(100); > - > - TEST_ASSERT_EQUAL(rte_event_dequeue_burst(evdev, 0, &ev, 1, 0), 1= , > + TEST_ASSERT_EQUAL(timeout_event_dequeue(&ev, 1, WAIT_TICKS(1)), 1= , > "Armed timer failed to trigger."); > TEST_ASSERT_EQUAL(ev_tim->state, RTE_EVENT_TIMER_NOT_ARMED, > "Improper timer state set expected %d returned = %d", > -- > 2.25.1 >