From: Naga Harish K S V <s.v.naga.harish.k@intel.com>
To: jerinj@marvell.com
Cc: dev@dpdk.org, erik.g.carrillo@intel.com,
pbhagavatula@marvell.com, sthotton@marvell.com
Subject: [PATCH v7 3/3] test/event: update periodic event timer tests
Date: Wed, 14 Sep 2022 10:33:19 -0500 [thread overview]
Message-ID: <20220914153319.1887248-3-s.v.naga.harish.k@intel.com> (raw)
In-Reply-To: <20220914153319.1887248-1-s.v.naga.harish.k@intel.com>
This patch updates the software timer adapter tests to
configure and use periodic event timers.
Signed-off-by: Naga Harish K S V <s.v.naga.harish.k@intel.com>
---
app/test/test_event_timer_adapter.c | 41 ++++++++++++++++++++++++++---
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
next prev parent reply other threads:[~2022-09-14 15:33 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-03 16:25 [PATCH 1/4] eventdev/timer: add periodic event timer support Naga Harish K S V
2022-08-03 16:25 ` [PATCH 4/4] test/event: update periodic event timer tests Naga Harish K S V
2022-08-10 7:07 ` [PATCH v2 1/4] eventdev/timer: add periodic event timer support Naga Harish K S V
2022-08-10 7:07 ` [PATCH v2 4/4] test/event: update periodic event timer tests Naga Harish K S V
2022-08-10 19:55 ` [PATCH v2 1/4] eventdev/timer: add periodic event timer support Carrillo, Erik G
2022-08-11 15:43 ` Naga Harish K, S V
2022-08-11 15:36 ` [PATCH v3 " Naga Harish K S V
2022-08-11 15:36 ` [PATCH v3 4/4] test/event: update periodic event timer tests Naga Harish K S V
2022-08-11 19:22 ` [PATCH v3 1/4] eventdev/timer: add periodic event timer support Carrillo, Erik G
2022-08-12 16:10 ` Naga Harish K, S V
2022-08-12 16:07 ` [PATCH v4 " Naga Harish K S V
2022-08-12 16:07 ` [PATCH v4 4/4] test/event: update periodic event timer tests Naga Harish K S V
2022-08-18 13:13 ` Carrillo, Erik G
2022-08-18 13:06 ` [PATCH v4 1/4] eventdev/timer: add periodic event timer support Carrillo, Erik G
2022-09-14 5:08 ` [PATCH v5 " Naga Harish K S V
2022-09-14 5:08 ` [PATCH v5 2/4] timer: fix function to stop all timers Naga Harish K S V
2022-09-14 5:08 ` [PATCH v5 3/4] test/event: update periodic event timer tests Naga Harish K S V
2022-09-14 5:08 ` [PATCH v5 4/4] doc: remove deprication notice Naga Harish K S V
2022-09-14 5:15 ` [PATCH v5 1/4] eventdev/timer: add periodic event timer support Naga Harish K S V
2022-09-14 5:15 ` [PATCH v5 2/4] timer: fix function to stop all timers Naga Harish K S V
2022-09-14 5:15 ` [PATCH v5 3/4] test/event: update periodic event timer tests Naga Harish K S V
2022-09-14 5:15 ` [PATCH v5 4/4] doc: remove deprecation notice Naga Harish K S V
2022-09-14 12:41 ` Jerin Jacob
2022-09-14 13:54 ` Naga Harish K, S V
2022-09-14 13:51 ` [PATCH v6 1/3] eventdev/timer: add periodic event timer support Naga Harish K S V
2022-09-14 13:51 ` [PATCH v6 2/3] timer: fix function to stop all timers Naga Harish K S V
2022-09-14 13:51 ` [PATCH v6 3/3] test/event: update periodic event timer tests Naga Harish K S V
2022-09-14 15:24 ` [PATCH v6 1/3] eventdev/timer: add periodic event timer support Jerin Jacob
2022-09-14 16:43 ` Naga Harish K, S V
2022-09-14 15:33 ` [PATCH v7 " Naga Harish K S V
2022-09-14 15:33 ` [PATCH v7 2/3] timer: fix function to stop all timers Naga Harish K S V
2022-09-15 6:41 ` Jerin Jacob
2022-09-16 4:40 ` Naga Harish K, S V
2022-10-05 12:59 ` Thomas Monjalon
2022-09-26 5:21 ` Naga Harish K, S V
2022-09-14 15:33 ` Naga Harish K S V [this message]
2022-09-15 6:43 ` [PATCH v7 3/3] test/event: update periodic event timer tests Jerin Jacob
2022-09-15 6:40 ` [PATCH v7 1/3] eventdev/timer: add periodic event timer support Jerin Jacob
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220914153319.1887248-3-s.v.naga.harish.k@intel.com \
--to=s.v.naga.harish.k@intel.com \
--cc=dev@dpdk.org \
--cc=erik.g.carrillo@intel.com \
--cc=jerinj@marvell.com \
--cc=pbhagavatula@marvell.com \
--cc=sthotton@marvell.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).