patch 'net/thunderx/base: fix build with GCC 15' has been queued to stable release 24.11.2

Kevin Traynor ktraynor at redhat.com
Thu Feb 13 10:57:35 CET 2025


Hi,

FYI, your patch has been queued to stable release 24.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 02/17/25. 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/kevintraynor/dpdk-stable

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/ee7a18ee163429aeaf0a78b627c5274ff01be11d

Thanks.

Kevin

---
>From ee7a18ee163429aeaf0a78b627c5274ff01be11d Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen at networkplumber.org>
Date: Mon, 20 Jan 2025 15:23:39 -0800
Subject: [PATCH] net/thunderx/base: fix build with GCC 15
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

[ upstream commit e7133f8fb39f506dc1eef02c2927acda949ca000 ]

Gcc 15 now produces warning with the base code of Thunderx driver.
The issue is that Gcc now defaults to C23 mode, and the standards
gods have decided that the result of partial initialization of a union
is not defined for other fields.

The fix is to use an empty initializer which forces full initialization.

[2377/3224] Compiling C object drivers/net/thunderx/base/libnicvf_base.a.p/nicvf_mbox.c.o
In function ‘nicvf_mbox_send_msg_to_pf_raw’,
    inlined from ‘nicvf_mbox_send_async_msg_to_pf’ at ../drivers/net/thunderx/base/nicvf_mbox.c:70:2,
    inlined from ‘nicvf_mbox_cfg_done’ at ../drivers/net/thunderx/base/nicvf_mbox.c:468:2:
../drivers/net/thunderx/base/nicvf_mbox.c:59:17: warning: ‘mbx’ is used uninitialized [-Wuninitialized]
   59 |                 nicvf_reg_write(nic, mbx_addr, *mbx_data);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../drivers/net/thunderx/base/nicvf_mbox.c: In function ‘nicvf_mbox_cfg_done’:
../drivers/net/thunderx/base/nicvf_mbox.c:465:24: note: ‘mbx’ declared here
  465 |         struct nic_mbx mbx = { .msg = { 0 } };
      |                        ^~~
In function ‘nicvf_mbox_send_msg_to_pf_raw’,
    inlined from ‘nicvf_mbox_send_async_msg_to_pf’ at ../drivers/net/thunderx/base/nicvf_mbox.c:70:2,
    inlined from ‘nicvf_mbox_link_change’ at ../drivers/net/thunderx/base/nicvf_mbox.c:477:2:
../drivers/net/thunderx/base/nicvf_mbox.c:59:17: warning: ‘mbx’ is used uninitialized [-Wuninitialized]
   59 |                 nicvf_reg_write(nic, mbx_addr, *mbx_data);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../drivers/net/thunderx/base/nicvf_mbox.c: In function ‘nicvf_mbox_link_change’:
../drivers/net/thunderx/base/nicvf_mbox.c:474:24: note: ‘mbx’ declared here
  474 |         struct nic_mbx mbx = { .msg = { 0 } };

Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
Acked-by: David Marchand <david.marchand at redhat.com>
---
 drivers/net/thunderx/base/nicvf_mbox.c | 42 +++++++++++++-------------
 1 file changed, 21 insertions(+), 21 deletions(-)

diff --git a/drivers/net/thunderx/base/nicvf_mbox.c b/drivers/net/thunderx/base/nicvf_mbox.c
index 0e0176974d..29407f75fa 100644
--- a/drivers/net/thunderx/base/nicvf_mbox.c
+++ b/drivers/net/thunderx/base/nicvf_mbox.c
@@ -213,5 +213,5 @@ nicvf_mbox_set_mac_addr(struct nicvf *nic,
 			const uint8_t mac[NICVF_MAC_ADDR_SIZE])
 {
-	struct nic_mbx mbx = { .msg = {0} };
+	struct nic_mbx mbx = { };
 	int i;
 
@@ -227,5 +227,5 @@ int
 nicvf_mbox_config_cpi(struct nicvf *nic, uint32_t qcnt)
 {
-	struct nic_mbx mbx = { .msg = { 0 } };
+	struct nic_mbx mbx = { };
 
 	mbx.msg.msg = NIC_MBOX_MSG_CPI_CFG;
@@ -240,5 +240,5 @@ int
 nicvf_mbox_get_rss_size(struct nicvf *nic)
 {
-	struct nic_mbx mbx = { .msg = { 0 } };
+	struct nic_mbx mbx = { };
 
 	mbx.msg.msg = NIC_MBOX_MSG_RSS_SIZE;
@@ -252,5 +252,5 @@ int
 nicvf_mbox_config_rss(struct nicvf *nic)
 {
-	struct nic_mbx mbx = { .msg = { 0 } };
+	struct nic_mbx mbx = { };
 	struct nicvf_rss_reta_info *rss = &nic->rss_info;
 	size_t tot_len = rss->rss_size;
@@ -285,5 +285,5 @@ nicvf_mbox_rq_config(struct nicvf *nic, uint16_t qidx,
 		     struct pf_rq_cfg *pf_rq_cfg)
 {
-	struct nic_mbx mbx = { .msg = { 0 } };
+	struct nic_mbx mbx = { };
 
 	mbx.msg.msg = NIC_MBOX_MSG_RQ_CFG;
@@ -297,5 +297,5 @@ int
 nicvf_mbox_sq_config(struct nicvf *nic, uint16_t qidx)
 {
-	struct nic_mbx mbx = { .msg = { 0 } };
+	struct nic_mbx mbx = { };
 
 	mbx.msg.msg = NIC_MBOX_MSG_SQ_CFG;
@@ -310,5 +310,5 @@ int
 nicvf_mbox_qset_config(struct nicvf *nic, struct pf_qs_cfg *qs_cfg)
 {
-	struct nic_mbx mbx = { .msg = { 0 } };
+	struct nic_mbx mbx = { };
 
 #if NICVF_BYTE_ORDER == NICVF_BIG_ENDIAN
@@ -326,5 +326,5 @@ int
 nicvf_mbox_request_sqs(struct nicvf *nic)
 {
-	struct nic_mbx mbx = { .msg = { 0 } };
+	struct nic_mbx mbx = { };
 	size_t i;
 
@@ -347,5 +347,5 @@ int
 nicvf_mbox_rq_drop_config(struct nicvf *nic, uint16_t qidx, bool enable)
 {
-	struct nic_mbx mbx = { .msg = { 0 } };
+	struct nic_mbx mbx = { };
 	struct pf_rq_drop_cfg *drop_cfg;
 
@@ -366,5 +366,5 @@ int
 nicvf_mbox_update_hw_max_frs(struct nicvf *nic, uint16_t mtu)
 {
-	struct nic_mbx mbx = { .msg = { 0 } };
+	struct nic_mbx mbx = { };
 
 	mbx.msg.msg = NIC_MBOX_MSG_SET_MAX_FRS;
@@ -377,5 +377,5 @@ int
 nicvf_mbox_rq_sync(struct nicvf *nic)
 {
-	struct nic_mbx mbx = { .msg = { 0 } };
+	struct nic_mbx mbx = { };
 
 	/* Make sure all packets in the pipeline are written back into mem */
@@ -388,5 +388,5 @@ int
 nicvf_mbox_rq_bp_config(struct nicvf *nic, uint16_t qidx, bool enable)
 {
-	struct nic_mbx mbx = { .msg = { 0 } };
+	struct nic_mbx mbx = { };
 
 	mbx.msg.msg = NIC_MBOX_MSG_RQ_BP_CFG;
@@ -402,5 +402,5 @@ int
 nicvf_mbox_loopback_config(struct nicvf *nic, bool enable)
 {
-	struct nic_mbx mbx = { .msg = { 0 } };
+	struct nic_mbx mbx = { };
 
 	mbx.lbk.msg = NIC_MBOX_MSG_LOOPBACK;
@@ -415,5 +415,5 @@ nicvf_mbox_reset_stat_counters(struct nicvf *nic, uint16_t rx_stat_mask,
 			       uint16_t sq_stat_mask)
 {
-	struct nic_mbx mbx = { .msg = { 0 } };
+	struct nic_mbx mbx = { };
 
 	mbx.reset_stat.msg = NIC_MBOX_MSG_RESET_STAT_COUNTER;
@@ -428,5 +428,5 @@ int
 nicvf_mbox_set_link_up_down(struct nicvf *nic, bool enable)
 {
-	struct nic_mbx mbx = { .msg = { 0 } };
+	struct nic_mbx mbx = { };
 
 	mbx.lbk.msg = NIC_MBOX_MSG_SET_LINK;
@@ -440,5 +440,5 @@ int
 nicvf_mbox_change_mode(struct nicvf *nic, struct change_link_mode *cfg)
 {
-	struct nic_mbx mbx = { .msg = { 0 } };
+	struct nic_mbx mbx = { };
 
 	mbx.mode.msg = NIC_MBOX_MSG_CHANGE_MODE;
@@ -454,5 +454,5 @@ void
 nicvf_mbox_shutdown(struct nicvf *nic)
 {
-	struct nic_mbx mbx = { .msg = { 0 } };
+	struct nic_mbx mbx = { };
 
 	mbx.msg.msg = NIC_MBOX_MSG_SHUTDOWN;
@@ -463,5 +463,5 @@ void
 nicvf_mbox_cfg_done(struct nicvf *nic)
 {
-	struct nic_mbx mbx = { .msg = { 0 } };
+	struct nic_mbx mbx = { };
 
 	mbx.msg.msg = NIC_MBOX_MSG_CFG_DONE;
@@ -472,5 +472,5 @@ void
 nicvf_mbox_link_change(struct nicvf *nic)
 {
-	struct nic_mbx mbx = { .msg = { 0 } };
+	struct nic_mbx mbx = { };
 
 	mbx.msg.msg = NIC_MBOX_MSG_BGX_LINK_CHANGE;
@@ -481,5 +481,5 @@ void
 nicvf_mbox_reset_xcast(struct nicvf *nic)
 {
-	struct nic_mbx mbx = { .msg = { 0 } };
+	struct nic_mbx mbx = { };
 
 	mbx.msg.msg = NIC_MBOX_MSG_RESET_XCAST;
@@ -490,5 +490,5 @@ int
 nicvf_mbox_set_xcast(struct nicvf *nic, uint8_t  mode, uint64_t mac)
 {
-	struct nic_mbx mbx = { .msg = { 0 } };
+	struct nic_mbx mbx = { };
 
 	mbx.xcast.msg = NIC_MBOX_MSG_SET_XCAST;
-- 
2.48.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2025-02-12 17:29:35.488014849 +0000
+++ 0008-net-thunderx-base-fix-build-with-GCC-15.patch	2025-02-12 17:29:34.138944665 +0000
@@ -1 +1 @@
-From e7133f8fb39f506dc1eef02c2927acda949ca000 Mon Sep 17 00:00:00 2001
+From ee7a18ee163429aeaf0a78b627c5274ff01be11d Mon Sep 17 00:00:00 2001
@@ -8,0 +9,2 @@
+[ upstream commit e7133f8fb39f506dc1eef02c2927acda949ca000 ]
+
@@ -36,2 +37,0 @@
-
-Cc: stable at dpdk.org



More information about the stable mailing list