From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>,
Reshma Pattan <reshma.pattan@intel.com>
Subject: [PATCH] test: allow latencystat of zero
Date: Wed, 6 Aug 2025 09:41:35 -0700 [thread overview]
Message-ID: <20250806164152.187460-1-stephen@networkplumber.org> (raw)
When test is running on emulated hardware, the performance counters
(TSC) maybe emulated and return the same value. So allow a
latency of zero, even though it should not happen IRL.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
app/test/test_latencystats.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/app/test/test_latencystats.c b/app/test/test_latencystats.c
index 676a99d385..ad0237ce78 100644
--- a/app/test/test_latencystats.c
+++ b/app/test/test_latencystats.c
@@ -192,9 +192,7 @@ static int test_latency_packet_forward(void)
}
TEST_ASSERT(values[4].value > 0, "No samples taken");
- TEST_ASSERT(values[0].value > 0, "Min latency should not be zero");
- TEST_ASSERT(values[1].value > 0, "Avg latency should not be zero");
- TEST_ASSERT(values[2].value > 0, "Max latency should not be zero");
+
TEST_ASSERT(values[0].value < values[1].value, "Min latency > Avg latency");
TEST_ASSERT(values[0].value < values[2].value, "Min latency > Max latency");
TEST_ASSERT(values[1].value < values[2].value, "Avg latency > Max latency");
--
2.47.2
reply other threads:[~2025-08-06 16:41 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20250806164152.187460-1-stephen@networkplumber.org \
--to=stephen@networkplumber.org \
--cc=dev@dpdk.org \
--cc=reshma.pattan@intel.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).