DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>,
	Konstantin Ananyev <konstantin.ananyev@huawei.com>,
	Vladimir Medvedkin <vladimir.medvedkin@intel.com>
Subject: [PATCH] app/test: use memcpy in ipsec test
Date: Fri, 29 May 2026 08:46:51 -0700	[thread overview]
Message-ID: <20260529154651.128372-1-stephen@networkplumber.org> (raw)

This test has tables of data that get copied with rte_memcpy.
But when compiled without always inline the compiler gets confused
by the inlining of rte_memcpy and thinks that it is possible for AVX
code to reference past the input data.

Workaround is to use memcpy() which is better for this test anyway
since regular memcpy has more static checking from compiler and
analyzers.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 app/test/test_ipsec.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/app/test/test_ipsec.c b/app/test/test_ipsec.c
index 139c1e8dec..b5a430996d 100644
--- a/app/test/test_ipsec.c
+++ b/app/test/test_ipsec.c
@@ -10,7 +10,6 @@
 #include <rte_hexdump.h>
 #include <rte_mbuf.h>
 #include <rte_malloc.h>
-#include <rte_memcpy.h>
 #include <rte_cycles.h>
 #include <rte_bus_vdev.h>
 #include <rte_ip.h>
@@ -559,7 +558,7 @@ setup_test_string(struct rte_mempool *mpool, const char *string,
 			return NULL;
 		}
 		if (string != NULL)
-			rte_memcpy(dst, string, t_len);
+			memcpy(dst, string, t_len);
 		else
 			memset(dst, 0, t_len);
 	}
@@ -604,22 +603,22 @@ setup_test_string_tunneled(struct rte_mempool *mpool, const char *string,
 	/* copy outer IP and ESP header */
 	ipv4_outer.total_length = rte_cpu_to_be_16(t_len);
 	ipv4_outer.packet_id = rte_cpu_to_be_16(seq);
-	rte_memcpy(dst, &ipv4_outer, sizeof(ipv4_outer));
+	memcpy(dst, &ipv4_outer, sizeof(ipv4_outer));
 	dst += sizeof(ipv4_outer);
 	m->l3_len = sizeof(ipv4_outer);
-	rte_memcpy(dst, &esph, sizeof(esph));
+	memcpy(dst, &esph, sizeof(esph));
 	dst += sizeof(esph);
 
 	if (string != NULL) {
 		/* copy payload */
-		rte_memcpy(dst, string, len);
+		memcpy(dst, string, len);
 		dst += len;
 		/* copy pad bytes */
-		rte_memcpy(dst, esp_pad_bytes, RTE_MIN(padlen,
+		memcpy(dst, esp_pad_bytes, RTE_MIN(padlen,
 			sizeof(esp_pad_bytes)));
 		dst += padlen;
 		/* copy ESP tail header */
-		rte_memcpy(dst, &espt, sizeof(espt));
+		memcpy(dst, &espt, sizeof(espt));
 	} else
 		memset(dst, 0, t_len);
 
-- 
2.53.0


             reply	other threads:[~2026-05-29 15:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-29 15:46 Stephen Hemminger [this message]
2026-05-29 16:42 ` [PATCH] app/test: use memcpy in ipsec test Konstantin Ananyev
2026-05-29 20:45   ` Morten Brørup
2026-05-29 22:52     ` Stephen Hemminger
2026-05-30  5:31       ` Morten Brørup
2026-05-29 22:58     ` Stephen Hemminger
2026-05-30  5:36       ` Morten Brørup
2026-06-02 19:36 ` [EXTERNAL] " Akhil Goyal

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=20260529154651.128372-1-stephen@networkplumber.org \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=konstantin.ananyev@huawei.com \
    --cc=vladimir.medvedkin@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