patch 'test/ipsec: fix build with GCC 12' has been queued to stable release 20.11.6

Xueming Li xuemingl at nvidia.com
Wed Jul 20 10:20:38 CEST 2022


Hi,

FYI, your patch has been queued to stable release 20.11.6

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 07/22/22. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/steevenlee/dpdk

This queued commit can be viewed at:
https://github.com/steevenlee/dpdk/commit/df7022dae82dc77ba99c5bb3a3e5d29b219aa51b

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From df7022dae82dc77ba99c5bb3a3e5d29b219aa51b Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand at redhat.com>
Date: Thu, 16 Jun 2022 11:33:20 +0200
Subject: [PATCH] test/ipsec: fix build with GCC 12
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit 6e108b6a7c0c0699e6304f7b5706736b34d32607 ]

GCC 12 raises the following warning:

In function ‘_mm256_loadu_si256’,
    inlined from ‘rte_mov32’ at
        ../lib/eal/x86/include/rte_memcpy.h:319:9,
    inlined from ‘rte_mov128’ at
        ../lib/eal/x86/include/rte_memcpy.h:344:2,
    inlined from ‘rte_memcpy_generic’ at
        ../lib/eal/x86/include/rte_memcpy.h:438:4,
    inlined from ‘rte_memcpy’ at
        ../lib/eal/x86/include/rte_memcpy.h:882:10,
    inlined from ‘setup_test_string.constprop’ at
        ../app/test/test_ipsec.c:572:4:
/usr/lib/gcc/x86_64-redhat-linux/12/include/avxintrin.h:929:10: error:
    array subscript ‘__m256i_u[3]’ is partly outside array bounds of
    ‘const char[108]’ [-Werror=array-bounds]
  929 |   return *__P;
      |          ^~~~
../app/test/test_ipsec.c: In function ‘setup_test_string.constprop’:
../app/test/test_ipsec.c:539:12: note: at offset 96 into object
    ‘null_plain_data’ of size 108
  539 | const char null_plain_data[] =
      |            ^~~~~~~~~~~~~~~

Add a hint so that the compiler understands the copied data is within
the passed string boundaries.

Bugzilla ID: 848
Fixes: 05fe65eb66b2 ("test/ipsec: introduce functional test")

Signed-off-by: David Marchand <david.marchand at redhat.com>
---
 app/test/test_ipsec.c | 35 ++++++++++++++++++++++-------------
 1 file changed, 22 insertions(+), 13 deletions(-)

diff --git a/app/test/test_ipsec.c b/app/test/test_ipsec.c
index fc77539bc7..39531ff667 100644
--- a/app/test/test_ipsec.c
+++ b/app/test/test_ipsec.c
@@ -544,12 +544,14 @@ struct rte_ipv4_hdr ipv4_outer  = {
 };
 
 static struct rte_mbuf *
-setup_test_string(struct rte_mempool *mpool,
-		const char *string, size_t len, uint8_t blocksize)
+setup_test_string(struct rte_mempool *mpool, const char *string,
+	size_t string_len, size_t len, uint8_t blocksize)
 {
 	struct rte_mbuf *m = rte_pktmbuf_alloc(mpool);
 	size_t t_len = len - (blocksize ? (len % blocksize) : 0);
 
+	RTE_VERIFY(len <= string_len);
+
 	if (m) {
 		memset(m->buf_addr, 0, m->buf_len);
 		char *dst = rte_pktmbuf_append(m, t_len);
@@ -1355,7 +1357,8 @@ test_ipsec_crypto_outb_burst_null_null(int i)
 	/* Generate input mbuf data */
 	for (j = 0; j < num_pkts && rc == 0; j++) {
 		ut_params->ibuf[j] = setup_test_string(ts_params->mbuf_pool,
-			null_plain_data, test_cfg[i].pkt_sz, 0);
+			null_plain_data, sizeof(null_plain_data),
+			test_cfg[i].pkt_sz, 0);
 		if (ut_params->ibuf[j] == NULL)
 			rc = TEST_FAILED;
 		else {
@@ -1473,7 +1476,8 @@ test_ipsec_inline_crypto_inb_burst_null_null(int i)
 			/* Generate test mbuf data */
 			ut_params->obuf[j] = setup_test_string(
 				ts_params->mbuf_pool,
-				null_plain_data, test_cfg[i].pkt_sz, 0);
+				null_plain_data, sizeof(null_plain_data),
+				test_cfg[i].pkt_sz, 0);
 			if (ut_params->obuf[j] == NULL)
 				rc = TEST_FAILED;
 		}
@@ -1541,16 +1545,17 @@ test_ipsec_inline_proto_inb_burst_null_null(int i)
 
 	/* Generate inbound mbuf data */
 	for (j = 0; j < num_pkts && rc == 0; j++) {
-		ut_params->ibuf[j] = setup_test_string(
-			ts_params->mbuf_pool,
-			null_plain_data, test_cfg[i].pkt_sz, 0);
+		ut_params->ibuf[j] = setup_test_string(ts_params->mbuf_pool,
+			null_plain_data, sizeof(null_plain_data),
+			test_cfg[i].pkt_sz, 0);
 		if (ut_params->ibuf[j] == NULL)
 			rc = TEST_FAILED;
 		else {
 			/* Generate test mbuf data */
 			ut_params->obuf[j] = setup_test_string(
 				ts_params->mbuf_pool,
-				null_plain_data, test_cfg[i].pkt_sz, 0);
+				null_plain_data, sizeof(null_plain_data),
+				test_cfg[i].pkt_sz, 0);
 			if (ut_params->obuf[j] == NULL)
 				rc = TEST_FAILED;
 		}
@@ -1650,7 +1655,8 @@ test_ipsec_inline_crypto_outb_burst_null_null(int i)
 	/* Generate test mbuf data */
 	for (j = 0; j < num_pkts && rc == 0; j++) {
 		ut_params->ibuf[j] = setup_test_string(ts_params->mbuf_pool,
-			null_plain_data, test_cfg[i].pkt_sz, 0);
+			null_plain_data, sizeof(null_plain_data),
+			test_cfg[i].pkt_sz, 0);
 		if (ut_params->ibuf[0] == NULL)
 			rc = TEST_FAILED;
 
@@ -1728,15 +1734,17 @@ test_ipsec_inline_proto_outb_burst_null_null(int i)
 	/* Generate test mbuf data */
 	for (j = 0; j < num_pkts && rc == 0; j++) {
 		ut_params->ibuf[j] = setup_test_string(ts_params->mbuf_pool,
-			null_plain_data, test_cfg[i].pkt_sz, 0);
+			null_plain_data, sizeof(null_plain_data),
+			test_cfg[i].pkt_sz, 0);
 		if (ut_params->ibuf[0] == NULL)
 			rc = TEST_FAILED;
 
 		if (rc == 0) {
 			/* Generate test tunneled mbuf data for comparison */
 			ut_params->obuf[j] = setup_test_string(
-					ts_params->mbuf_pool,
-					null_plain_data, test_cfg[i].pkt_sz, 0);
+				ts_params->mbuf_pool, null_plain_data,
+				sizeof(null_plain_data), test_cfg[i].pkt_sz,
+				0);
 			if (ut_params->obuf[j] == NULL)
 				rc = TEST_FAILED;
 		}
@@ -1805,7 +1813,8 @@ test_ipsec_lksd_proto_inb_burst_null_null(int i)
 	for (j = 0; j < num_pkts && rc == 0; j++) {
 		/* packet with sequence number 0 is invalid */
 		ut_params->ibuf[j] = setup_test_string(ts_params->mbuf_pool,
-			null_encrypted_data, test_cfg[i].pkt_sz, 0);
+			null_encrypted_data, sizeof(null_encrypted_data),
+			test_cfg[i].pkt_sz, 0);
 		if (ut_params->ibuf[j] == NULL)
 			rc = TEST_FAILED;
 	}
-- 
2.35.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-07-20 15:00:59.221975012 +0800
+++ 0009-test-ipsec-fix-build-with-GCC-12.patch	2022-07-20 15:00:58.661000577 +0800
@@ -1 +1 @@
-From 6e108b6a7c0c0699e6304f7b5706736b34d32607 Mon Sep 17 00:00:00 2001
+From df7022dae82dc77ba99c5bb3a3e5d29b219aa51b Mon Sep 17 00:00:00 2001
@@ -7,0 +8,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 6e108b6a7c0c0699e6304f7b5706736b34d32607 ]
@@ -38 +40,0 @@
-Cc: stable at dpdk.org
@@ -46 +48 @@
-index 8da025bf66..7047e17960 100644
+index fc77539bc7..39531ff667 100644
@@ -49 +51 @@
-@@ -554,12 +554,14 @@ struct rte_ipv4_hdr ipv4_outer  = {
+@@ -544,12 +544,14 @@ struct rte_ipv4_hdr ipv4_outer  = {
@@ -66 +68 @@
-@@ -1365,7 +1367,8 @@ test_ipsec_crypto_outb_burst_null_null(int i)
+@@ -1355,7 +1357,8 @@ test_ipsec_crypto_outb_burst_null_null(int i)
@@ -76 +78 @@
-@@ -1483,7 +1486,8 @@ test_ipsec_inline_crypto_inb_burst_null_null(int i)
+@@ -1473,7 +1476,8 @@ test_ipsec_inline_crypto_inb_burst_null_null(int i)
@@ -86 +88 @@
-@@ -1551,16 +1555,17 @@ test_ipsec_inline_proto_inb_burst_null_null(int i)
+@@ -1541,16 +1545,17 @@ test_ipsec_inline_proto_inb_burst_null_null(int i)
@@ -108 +110 @@
-@@ -1660,7 +1665,8 @@ test_ipsec_inline_crypto_outb_burst_null_null(int i)
+@@ -1650,7 +1655,8 @@ test_ipsec_inline_crypto_outb_burst_null_null(int i)
@@ -118 +120 @@
-@@ -1738,15 +1744,17 @@ test_ipsec_inline_proto_outb_burst_null_null(int i)
+@@ -1728,15 +1734,17 @@ test_ipsec_inline_proto_outb_burst_null_null(int i)
@@ -139 +141 @@
-@@ -1815,7 +1823,8 @@ test_ipsec_lksd_proto_inb_burst_null_null(int i)
+@@ -1805,7 +1813,8 @@ test_ipsec_lksd_proto_inb_burst_null_null(int i)


More information about the stable mailing list