[dpdk-stable] patch 'net/bnx2x: fix build with GCC 11' has been queued to stable release 20.11.2

Xueming Li xuemingl at nvidia.com
Sat Jun 12 01:03:52 CEST 2021


Hi,

FYI, your patch has been queued to stable release 20.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 06/14/21. 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/84c5ec250561c8493c270d928f02bb4f2d226ecd

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 84c5ec250561c8493c270d928f02bb4f2d226ecd Mon Sep 17 00:00:00 2001
From: Ferruh Yigit <ferruh.yigit at intel.com>
Date: Tue, 11 May 2021 14:14:33 +0100
Subject: [PATCH] net/bnx2x: fix build with GCC 11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: Luca Boccassi <bluca at debian.org>

[ upstream commit ab70be7e2d971dd0238da10322ac19209917b8ca ]

Reproduced with '--buildtype=debugoptimized' config,
compiler version: gcc (GCC) 12.0.0 20210509 (experimental)

Build error:
In file included from ../drivers/net/bnx2x/bnx2x.c:16:
../drivers/net/bnx2x/bnx2x.c: In function ‘bnx2x_hc_ack_sb’:
../drivers/net/bnx2x/bnx2x.h:1528:35:
         warning: ‘igu_ack’ is used uninitialized [-Wuninitialized]
 #define REG_WR32(sc, offset, val) bnx2x_reg_write32(sc, (offset), val)
                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../drivers/net/bnx2x/bnx2x.h:1531:33:
	note: in expansion of macro ‘REG_WR32’
 1531 | #define REG_WR(sc, offset, val) REG_WR32(sc, offset, val)
      |                                 ^~~~~~~~
../drivers/net/bnx2x/bnx2x.h:1916:9: note: in expansion of macro ‘REG_WR’
 1916 |         REG_WR(sc, hc_addr, *val);
      |         ^~~~~~
../drivers/net/bnx2x/bnx2x.h:1905:33: note: ‘igu_ack’ declared here
 1905 |         struct igu_ack_register igu_ack;
      |                                 ^~~~~~~

REG_WR32 requires 'uint32_t', use union instead of cast to 'uint32_t'.

Bugzilla ID: 692
Fixes: 38dff79ba736 ("net/bnx2x: update HSI")

Signed-off-by: Ferruh Yigit <ferruh.yigit at intel.com>
Acked-by: Kevin Traynor <ktraynor at redhat.com>
---
 drivers/net/bnx2x/bnx2x.h | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/net/bnx2x/bnx2x.h b/drivers/net/bnx2x/bnx2x.h
index 69cc1430a4..8b3f807eb6 100644
--- a/drivers/net/bnx2x/bnx2x.h
+++ b/drivers/net/bnx2x/bnx2x.h
@@ -1902,18 +1902,19 @@ bnx2x_hc_ack_sb(struct bnx2x_softc *sc, uint8_t sb_id, uint8_t storm,
 {
 	uint32_t hc_addr = (HC_REG_COMMAND_REG + SC_PORT(sc) * 32 +
 			COMMAND_REG_INT_ACK);
-	struct igu_ack_register igu_ack;
-	uint32_t *val = NULL;
+	union {
+		struct igu_ack_register igu_ack;
+		uint32_t val;
+	} val;
 
-	igu_ack.status_block_index = index;
-	igu_ack.sb_id_and_flags =
+	val.igu_ack.status_block_index = index;
+	val.igu_ack.sb_id_and_flags =
 		((sb_id << IGU_ACK_REGISTER_STATUS_BLOCK_ID_SHIFT) |
 		 (storm << IGU_ACK_REGISTER_STORM_ID_SHIFT) |
 		 (update << IGU_ACK_REGISTER_UPDATE_INDEX_SHIFT) |
 		 (op << IGU_ACK_REGISTER_INTERRUPT_MODE_SHIFT));
 
-	val = (uint32_t *)&igu_ack;
-	REG_WR(sc, hc_addr, *val);
+	REG_WR(sc, hc_addr, val.val);
 
 	/* Make sure that ACK is written */
 	mb();
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-06-12 06:54:00.110626000 +0800
+++ 0138-net-bnx2x-fix-build-with-GCC-11.patch	2021-06-12 06:53:56.590000000 +0800
@@ -1 +1 @@
-From ab70be7e2d971dd0238da10322ac19209917b8ca Mon Sep 17 00:00:00 2001
+From 84c5ec250561c8493c270d928f02bb4f2d226ecd Mon Sep 17 00:00:00 2001
@@ -7,0 +8,3 @@
+Cc: Luca Boccassi <bluca at debian.org>
+
+[ upstream commit ab70be7e2d971dd0238da10322ac19209917b8ca ]
@@ -34 +36,0 @@
-Cc: stable at dpdk.org
@@ -43 +45 @@
-index e13ab15574..80d19cbfd6 100644
+index 69cc1430a4..8b3f807eb6 100644


More information about the stable mailing list