<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: "IntelOne Text"; font-size: 10pt; color: rgb(0, 0, 0);" class="elementToProof">
LGTM,</div>
<div style="font-family: "IntelOne Text"; font-size: 10pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: "IntelOne Text"; font-size: 10pt; color: rgb(0, 0, 0);" class="elementToProof">
I'm not AVX-512 expert, but I think AVX-512 might expect  64-bytes alignment,.</div>
<div style="font-family: "IntelOne Text"; font-size: 10pt; color: rgb(0, 0, 0);" class="elementToProof">
As the original  ALIGNMENT_UNIT is 32, so I think the selection of offsets is no problem. </div>
<div style="font-family: "IntelOne Text"; font-size: 10pt; color: rgb(0, 0, 0);" class="elementToProof">
Maybe remove AVX-512 from the comments ? </div>
<div style="font-family: "IntelOne Text"; font-size: 10pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: "IntelOne Text"; font-size: 10pt; color: rgb(0, 0, 0);" class="elementToProof">
Regards</div>
<div style="font-family: "IntelOne Text"; font-size: 10pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: "IntelOne Text"; font-size: 10pt; color: rgb(0, 0, 0);" class="elementToProof">
Kai </div>
<div style="font-family: "IntelOne Text"; font-size: 10pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div><br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<hr style="display: inline-block; width: 98%;">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<b>From:</b> Stephen Hemminger <stephen@networkplumber.org><br>
<b>Sent:</b> Thursday, February 26, 2026 16:48<br>
<b>To:</b> dev@dpdk.org <dev@dpdk.org><br>
<b>Cc:</b> Stephen Hemminger <stephen@networkplumber.org>; Luca Boccassi <bluca@debian.org><br>
<b>Subject:</b> [PATCH] test/memcpy: reduce alignment offset coverage to fix timeout
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-size: 11pt;">The memcpy test sweeps all 32x32 src/dst alignment offset pairs which<br>
causes it to timeout on slow emulated 32-bit build environments [1].<br>
<br>
Replace with a curated set of 7 offsets {0, 1, 7, 15, 16, 17, 31}<br>
that cover the interesting alignment boundaries. This reduces the<br>
iterations from 38912 to 1862 while covering the same code paths.<br>
<br>
[1] <a data-auth="NotApplicable" class="OWAAutoLink" id="OWAda924304-6866-50fb-d3fd-14b10fce3146" href="https://build.opensuse.org/package/live_build_log/home:bluca:dpdk/dpdk/Debian_Testing/i586">
https://build.opensuse.org/package/live_build_log/home:bluca:dpdk/dpdk/Debian_Testing/i586</a><br>
<br>
Reported-by: Luca Boccassi <bluca@debian.org><br>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org><br>
---<br>
 app/test/test_memcpy.c | 20 ++++++++++++++++----<br>
 1 file changed, 16 insertions(+), 4 deletions(-)<br>
<br>
diff --git a/app/test/test_memcpy.c b/app/test/test_memcpy.c<br>
index 7273c17a06..12e491034f 100644<br>
--- a/app/test/test_memcpy.c<br>
+++ b/app/test/test_memcpy.c<br>
@@ -36,6 +36,16 @@ static size_t buf_sizes[TEST_VALUE_RANGE];<br>
 /* Data is aligned on this many bytes (power of 2) */<br>
 #define ALIGNMENT_UNIT          32<br>
 <br>
+/*<br>
+ * Subset of offsets to test. These values cover the structurally<br>
+ * interesting alignment cases for SSE/AVX/AVX512 copy paths:<br>
+ * aligned (0), off-by-one (1), partial vector (7, 15, 17),<br>
+ * vector boundaries (16, 31). Testing all 1024 src x dst<br>
+ * combinations of offsets 0..31 is unnecessary since many<br>
+ * map to the same code paths, and causes the test to timeout<br>
+ * on slow (e.g. emulated 32-bit) build environments.<br>
+ */<br>
+static const unsigned int test_offsets[] = {0, 1, 7, 15, 16, 17, 31};<br>
 <br>
 /*<br>
  * Create two buffers, and initialise one with random values. These are copied<br>
@@ -103,13 +113,15 @@ static int<br>
 func_test(void)<br>
 {<br>
         unsigned int off_src, off_dst, i;<br>
+       unsigned int n_offsets = RTE_DIM(test_offsets);<br>
         int ret;<br>
 <br>
-       for (off_src = 0; off_src < ALIGNMENT_UNIT; off_src++) {<br>
-               for (off_dst = 0; off_dst < ALIGNMENT_UNIT; off_dst++) {<br>
+       for (off_src = 0; off_src < n_offsets; off_src++) {<br>
+               for (off_dst = 0; off_dst < n_offsets; off_dst++) {<br>
                         for (i = 0; i < RTE_DIM(buf_sizes); i++) {<br>
-                               ret = test_single_memcpy(off_src, off_dst,<br>
-                                                        buf_sizes[i]);<br>
+                               ret = test_single_memcpy(test_offsets[off_src],<br>
+                                                        test_offsets[off_dst],<br>
+                                                        buf_sizes[i]);<br>
                                 if (ret != 0)<br>
                                         return -1;<br>
                         }<br>
--<br>
2.51.0<br>
<br>
</div>
</body>
</html>