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 E09F2A00C5; Thu, 15 Sep 2022 08:43:32 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D44804021D; Thu, 15 Sep 2022 08:43:32 +0200 (CEST) Received: from mail-qt1-f172.google.com (mail-qt1-f172.google.com [209.85.160.172]) by mails.dpdk.org (Postfix) with ESMTP id B13EE40156 for ; Thu, 15 Sep 2022 08:43:31 +0200 (CEST) Received: by mail-qt1-f172.google.com with SMTP id f26so10371364qto.11 for ; Wed, 14 Sep 2022 23:43:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=df/m50lhilXVpYWfujfTjMRYn8BwMeXIyCKv9nxVhCo=; b=B9AOtlH0knXNwT0AiH4uDfeyPImVRkHvKOHshyU+SXCD5r3etecurXAFG3GqKUajjT QGPOlAfd3HgqvKmpRlu0XQoP1zfSJ9Op7h82g2WNpG1vD7PTO/ETfhbUnulSfKtlWp2o yfSH0UT8P1tr6nJWrLsIiiOP2nbuhyzmfV8poroeNi0MJmMoM81D2Ji8XfXQ5rhmrg6c 2g72mha8iTmc1LCHrKlM/2UuWixVckypH9Y6mZtSNSc8wsXm//9Yh4eCsFHvSBq0aCPY fpaqyyuWKcoRJvVJfipjEmxcaRW7qvStwQY7ikO6g1THuitf8d4Tvrr1pE8ZGyPlf3uw EdpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=df/m50lhilXVpYWfujfTjMRYn8BwMeXIyCKv9nxVhCo=; b=YHQdDiC1RqE8Dq+lYm2q5RzHGsnUZ7WwnbTsslyv8wbAtergi0JAJxXRxd3owX+krm /Y6LBgrwKklyL/sSRgx6Ws0PB+Nv3h2Icra/7nFG7hDEsp3F01aaHCMh3LvTph1Vbdle RX0nuou3KZRYtzRujbu9tSllVGN7Sz6sSHuMfHjVOYmWEEKpvcS/hHT8lqUBUza5uxmY s3T9abcP+Oapc76NfHwuw4RwTuR3pVJ2FFy701eeXFDDjl8vLvizQ/BCtSVWfCZkyf4b jQkPwjV7LxuIS+hg+GHBNRoxo7eA+Z+FdzQsREX3sVao5JumfTjP6vYAKrW1BkmKDVXu JKIg== X-Gm-Message-State: ACgBeo0Pisw0xj/5F3iFgwHsfr29RZgFhe7Nv2s2IQHaGNibkTrsxpM5 K71KHFhNI6dVBkpVAbSpKIJngAOJJjNGMsyHxes= X-Google-Smtp-Source: AA6agR6eRrjJL/X/e0xvKX2ZmkEslAmhXHw2/NTl3+rcsjpMiMn7fLpA49/PjDbM/Wkxac57b5fSY7jv7uIfl97Dmas= X-Received: by 2002:ac8:5852:0:b0:343:7e74:d83b with SMTP id h18-20020ac85852000000b003437e74d83bmr35347942qth.458.1663224211033; Wed, 14 Sep 2022 23:43:31 -0700 (PDT) MIME-Version: 1.0 References: <20220914135147.1846550-1-s.v.naga.harish.k@intel.com> <20220914153319.1887248-1-s.v.naga.harish.k@intel.com> <20220914153319.1887248-3-s.v.naga.harish.k@intel.com> In-Reply-To: <20220914153319.1887248-3-s.v.naga.harish.k@intel.com> From: Jerin Jacob Date: Thu, 15 Sep 2022 12:13:05 +0530 Message-ID: Subject: Re: [PATCH v7 3/3] test/event: update periodic event timer tests To: Naga Harish K S V Cc: jerinj@marvell.com, dev@dpdk.org, erik.g.carrillo@intel.com, pbhagavatula@marvell.com, sthotton@marvell.com Content-Type: text/plain; charset="UTF-8" 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 Wed, Sep 14, 2022 at 9:03 PM Naga Harish K S V wrote: > > This patch updates the software timer adapter tests to > configure and use periodic event timers. > > Signed-off-by: Naga Harish K S V > --- > app/test/test_event_timer_adapter.c | 41 ++++++++++++++++++++++++++--- Applied 1/3 and 3/3 to dpdk-next-net-eventdev/for-main. Thanks > 1 file changed, 37 insertions(+), 4 deletions(-) > > diff --git a/app/test/test_event_timer_adapter.c b/app/test/test_event_timer_adapter.c > index d6170bb589..654c412836 100644 > --- a/app/test/test_event_timer_adapter.c > +++ b/app/test/test_event_timer_adapter.c > @@ -386,11 +386,22 @@ timdev_setup_msec(void) > static int > timdev_setup_msec_periodic(void) > { > + uint32_t caps = 0; > + uint64_t max_tmo_ns; > + > uint64_t flags = RTE_EVENT_TIMER_ADAPTER_F_ADJUST_RES | > RTE_EVENT_TIMER_ADAPTER_F_PERIODIC; > > + TEST_ASSERT_SUCCESS(rte_event_timer_adapter_caps_get(evdev, &caps), > + "failed to get adapter capabilities"); > + > + if (caps & RTE_EVENT_TIMER_ADAPTER_CAP_INTERNAL_PORT) > + max_tmo_ns = 0; > + else > + max_tmo_ns = 180 * NSECPERSEC; > + > /* Periodic mode with 100 ms resolution */ > - return _timdev_setup(0, NSECPERSEC / 10, flags); > + return _timdev_setup(max_tmo_ns, NSECPERSEC / 10, flags); > } > > static int > @@ -409,7 +420,7 @@ timdev_setup_sec_periodic(void) > RTE_EVENT_TIMER_ADAPTER_F_PERIODIC; > > /* Periodic mode with 1 sec resolution */ > - return _timdev_setup(0, NSECPERSEC, flags); > + return _timdev_setup(180 * NSECPERSEC, NSECPERSEC, flags); > } > > static int > @@ -561,12 +572,23 @@ test_timer_arm(void) > static inline int > test_timer_arm_periodic(void) > { > + uint32_t caps = 0; > + uint32_t timeout_count = 0; > + > TEST_ASSERT_SUCCESS(_arm_timers(1, MAX_TIMERS), > "Failed to arm timers"); > /* With a resolution of 100ms and wait time of 1sec, > * there will be 10 * MAX_TIMERS periodic timer triggers. > */ > - TEST_ASSERT_SUCCESS(_wait_timer_triggers(1, 10 * MAX_TIMERS, 0), > + TEST_ASSERT_SUCCESS(rte_event_timer_adapter_caps_get(evdev, &caps), > + "failed to get adapter capabilities"); > + > + if (caps & RTE_EVENT_TIMER_ADAPTER_CAP_INTERNAL_PORT) > + timeout_count = 10; > + else > + timeout_count = 9; > + > + TEST_ASSERT_SUCCESS(_wait_timer_triggers(1, timeout_count * MAX_TIMERS, 0), > "Timer triggered count doesn't match arm count"); > return TEST_SUCCESS; > } > @@ -649,12 +671,23 @@ test_timer_arm_burst(void) > static inline int > test_timer_arm_burst_periodic(void) > { > + uint32_t caps = 0; > + uint32_t timeout_count = 0; > + > TEST_ASSERT_SUCCESS(_arm_timers_burst(1, MAX_TIMERS), > "Failed to arm timers"); > /* With a resolution of 100ms and wait time of 1sec, > * there will be 10 * MAX_TIMERS periodic timer triggers. > */ > - TEST_ASSERT_SUCCESS(_wait_timer_triggers(1, 10 * MAX_TIMERS, 0), > + TEST_ASSERT_SUCCESS(rte_event_timer_adapter_caps_get(evdev, &caps), > + "failed to get adapter capabilities"); > + > + if (caps & RTE_EVENT_TIMER_ADAPTER_CAP_INTERNAL_PORT) > + timeout_count = 10; > + else > + timeout_count = 9; > + > + TEST_ASSERT_SUCCESS(_wait_timer_triggers(1, timeout_count * MAX_TIMERS, 0), > "Timer triggered count doesn't match arm count"); > > return TEST_SUCCESS; > -- > 2.25.1 >