patch 'pdump: fix build with GCC 12' has been queued to stable release 22.11.2

Xueming Li xuemingl at nvidia.com
Sun Apr 9 17:25:24 CEST 2023


Hi,

FYI, your patch has been queued to stable release 22.11.2

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/11/23. 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://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/ac849cac65a35923ffdb10e04a30ca3a67e6d5da

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From ac849cac65a35923ffdb10e04a30ca3a67e6d5da Mon Sep 17 00:00:00 2001
From: Joyce Kong <joyce.kong at arm.com>
Date: Mon, 27 Mar 2023 07:07:12 +0000
Subject: [PATCH] pdump: 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 b182466683a5c76657efb4b6b8d43e7d71979034 ]

The following warning is observed with GCC12 compilation
with release 20.11:

In function ‘__rte_ring_enqueue_elems_64’,
    inlined from ‘__rte_ring_enqueue_elems’ at
            ../lib/librte_ring/rte_ring_elem.h:225:3,
    inlined from ‘__rte_ring_do_enqueue_elem’ at
            ../lib/librte_ring/rte_ring_elem.h:424:2,
    inlined from ‘rte_ring_mp_enqueue_burst_elem’ at
            ../lib/librte_ring/rte_ring_elem.h:884:9,
    inlined from ‘rte_ring_enqueue_burst_elem’ at
            ../lib/librte_ring/rte_ring_elem.h:946:10,
    inlined from ‘rte_ring_enqueue_burst’ at
            ../lib/librte_ring/rte_ring.h:721:9,
    inlined from ‘pdump_copy’ at
            ../lib/librte_pdump/rte_pdump.c:94:13:
../lib/librte_ring/rte_ring_elem.h:162:40: warning: ‘*dup_bufs.36_42
+ _89’ may be used uninitialized [-Wmaybe-uninitialized]
  162 |                         ring[idx] = obj[i];
      |                                     ~~~^~~
../lib/librte_ring/rte_ring_elem.h:163:44: warning: ‘*dup_bufs.36_42
+ _98’ may be used uninitialized [-Wmaybe-uninitialized]
  163 |                         ring[idx + 1] = obj[i + 1];
      |                                         ~~~^~~~~~~
../lib/librte_ring/rte_ring_elem.h:164:44: warning: ‘*dup_bufs.36_42
+ _107’ may be used uninitialized [-Wmaybe-uninitialized]
  164 |                         ring[idx + 2] = obj[i + 2];
      |                                         ~~~^~~~~~~
../lib/librte_ring/rte_ring_elem.h:165:44: warning: ‘*dup_bufs.36_42
+ _116’ may be used uninitialized [-Wmaybe-uninitialized]
  165 |                         ring[idx + 3] = obj[i + 3];
      |                                         ~~~^~~~~~~
../lib/librte_ring/rte_ring_elem.h:169:42: warning: ‘*dup_bufs.36_42
+ _129’ may be used uninitialized [-Wmaybe-uninitialized]
  169 |                         ring[idx++] = obj[i++]; /* fallthrough */
      |                                       ~~~^~~~~
../lib/librte_ring/rte_ring_elem.h:171:42: warning: ‘*dup_bufs.36_42
+ _139’ may be used uninitialized [-Wmaybe-uninitialized]
  171 |                         ring[idx++] = obj[i++]; /* fallthrough */
      |                                       ~~~^~~~~
../lib/librte_ring/rte_ring_elem.h:173:42: warning: ‘*dup_bufs.36_42
+ _149’ may be used uninitialized [-Wmaybe-uninitialized]
  173 |                         ring[idx++] = obj[i++];

Actually, this is an alias warning as -O3 enables strict alias.
This patch fixes it by replacing 'dup_bufs' with '&dup_bufs[0]'
as the compiler represents them differently.

Fixes: 278f945402c5 ("pdump: add new library for packet capture")

Signed-off-by: Joyce Kong <joyce.kong at arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang at arm.com>
Acked-by: Reshma Pattan <reshma.pattan at intel.com>
Acked-by: Tyler Retzlaff <roretzla at linux.microsoft.com>
---
 lib/pdump/rte_pdump.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/pdump/rte_pdump.c b/lib/pdump/rte_pdump.c
index a81544cb57..4b7a4b3483 100644
--- a/lib/pdump/rte_pdump.c
+++ b/lib/pdump/rte_pdump.c
@@ -134,7 +134,7 @@ pdump_copy(uint16_t port_id, uint16_t queue,
 
 	__atomic_fetch_add(&stats->accepted, d_pkts, __ATOMIC_RELAXED);
 
-	ring_enq = rte_ring_enqueue_burst(ring, (void *)dup_bufs, d_pkts, NULL);
+	ring_enq = rte_ring_enqueue_burst(ring, (void *)&dup_bufs[0], d_pkts, NULL);
 	if (unlikely(ring_enq < d_pkts)) {
 		unsigned int drops = d_pkts - ring_enq;
 
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:42.258824700 +0800
+++ 0136-pdump-fix-build-with-GCC-12.patch	2023-04-09 21:45:38.819042200 +0800
@@ -1 +1 @@
-From b182466683a5c76657efb4b6b8d43e7d71979034 Mon Sep 17 00:00:00 2001
+From ac849cac65a35923ffdb10e04a30ca3a67e6d5da Mon Sep 17 00:00:00 2001
@@ -7,0 +8,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit b182466683a5c76657efb4b6b8d43e7d71979034 ]
@@ -58 +60,0 @@
-Cc: stable at dpdk.org
@@ -69 +71 @@
-index 9bc4bab4f2..53cca1034d 100644
+index a81544cb57..4b7a4b3483 100644


More information about the stable mailing list