From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>,
Luca Boccassi <bluca@debian.org>
Subject: [PATCH] test/memcpy: reduce alignment offset coverage to fix timeout
Date: Thu, 26 Feb 2026 08:48:43 -0800 [thread overview]
Message-ID: <20260226164843.183959-1-stephen@networkplumber.org> (raw)
The memcpy test sweeps all 32x32 src/dst alignment offset pairs which
causes it to timeout on slow emulated 32-bit build environments [1].
Replace with a curated set of 7 offsets {0, 1, 7, 15, 16, 17, 31}
that cover the interesting alignment boundaries. This reduces the
iterations from 38912 to 1862 while covering the same code paths.
[1] https://build.opensuse.org/package/live_build_log/home:bluca:dpdk/dpdk/Debian_Testing/i586
Reported-by: Luca Boccassi <bluca@debian.org>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
app/test/test_memcpy.c | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
diff --git a/app/test/test_memcpy.c b/app/test/test_memcpy.c
index 7273c17a06..12e491034f 100644
--- a/app/test/test_memcpy.c
+++ b/app/test/test_memcpy.c
@@ -36,6 +36,16 @@ static size_t buf_sizes[TEST_VALUE_RANGE];
/* Data is aligned on this many bytes (power of 2) */
#define ALIGNMENT_UNIT 32
+/*
+ * Subset of offsets to test. These values cover the structurally
+ * interesting alignment cases for SSE/AVX/AVX512 copy paths:
+ * aligned (0), off-by-one (1), partial vector (7, 15, 17),
+ * vector boundaries (16, 31). Testing all 1024 src x dst
+ * combinations of offsets 0..31 is unnecessary since many
+ * map to the same code paths, and causes the test to timeout
+ * on slow (e.g. emulated 32-bit) build environments.
+ */
+static const unsigned int test_offsets[] = {0, 1, 7, 15, 16, 17, 31};
/*
* Create two buffers, and initialise one with random values. These are copied
@@ -103,13 +113,15 @@ static int
func_test(void)
{
unsigned int off_src, off_dst, i;
+ unsigned int n_offsets = RTE_DIM(test_offsets);
int ret;
- for (off_src = 0; off_src < ALIGNMENT_UNIT; off_src++) {
- for (off_dst = 0; off_dst < ALIGNMENT_UNIT; off_dst++) {
+ for (off_src = 0; off_src < n_offsets; off_src++) {
+ for (off_dst = 0; off_dst < n_offsets; off_dst++) {
for (i = 0; i < RTE_DIM(buf_sizes); i++) {
- ret = test_single_memcpy(off_src, off_dst,
- buf_sizes[i]);
+ ret = test_single_memcpy(test_offsets[off_src],
+ test_offsets[off_dst],
+ buf_sizes[i]);
if (ret != 0)
return -1;
}
--
2.51.0
next reply other threads:[~2026-02-26 16:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-26 16:48 Stephen Hemminger [this message]
2026-03-10 17:04 ` [PATCH] test/memcpy: reduce alignment offset coverage to fix timeout Ji, Kai
2026-03-17 17:01 ` Thomas Monjalon
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=20260226164843.183959-1-stephen@networkplumber.org \
--to=stephen@networkplumber.org \
--cc=bluca@debian.org \
--cc=dev@dpdk.org \
/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