patch 'net/thunderx/base: fix build with GCC 15' has been queued to stable release 23.11.4
Xueming Li
xuemingl at nvidia.com
Tue Feb 18 13:34:02 CET 2025
Hi,
FYI, your patch has been queued to stable release 23.11.4
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
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=23.11-staging
This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=68dee34412e088bc904f639b0428b6a9a9543c72
Thanks.
Xueming Li <xuemingl at nvidia.com>
---
>From 68dee34412e088bc904f639b0428b6a9a9543c72 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
Cc: Xueming Li <xuemingl at nvidia.com>
[ 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
@@ -212,7 +212,7 @@ int
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;
mbx.msg.msg = NIC_MBOX_MSG_SET_MAC;
@@ -226,7 +226,7 @@ nicvf_mbox_set_mac_addr(struct nicvf *nic,
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;
mbx.cpi_cfg.vf_id = nic->vf_id;
@@ -239,7 +239,7 @@ nicvf_mbox_config_cpi(struct nicvf *nic, uint32_t qcnt)
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;
mbx.rss_size.vf_id = nic->vf_id;
@@ -251,7 +251,7 @@ nicvf_mbox_get_rss_size(struct nicvf *nic)
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;
size_t cur_len;
@@ -284,7 +284,7 @@ int
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;
mbx.rq.qs_num = nic->vf_id;
@@ -296,7 +296,7 @@ nicvf_mbox_rq_config(struct nicvf *nic, uint16_t qidx,
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;
mbx.sq.qs_num = nic->vf_id;
@@ -309,7 +309,7 @@ nicvf_mbox_sq_config(struct nicvf *nic, uint16_t qidx)
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
qs_cfg->be = 1;
@@ -325,7 +325,7 @@ nicvf_mbox_qset_config(struct nicvf *nic, struct pf_qs_cfg *qs_cfg)
int
nicvf_mbox_request_sqs(struct nicvf *nic)
{
- struct nic_mbx mbx = { .msg = { 0 } };
+ struct nic_mbx mbx = { };
size_t i;
assert_primary(nic);
@@ -346,7 +346,7 @@ nicvf_mbox_request_sqs(struct nicvf *nic)
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;
/* Enable CQ drop to reserve sufficient CQEs for all tx packets */
@@ -365,7 +365,7 @@ nicvf_mbox_rq_drop_config(struct nicvf *nic, uint16_t qidx, bool enable)
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;
mbx.frs.max_frs = mtu;
@@ -376,7 +376,7 @@ nicvf_mbox_update_hw_max_frs(struct nicvf *nic, uint16_t mtu)
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 */
mbx.msg.msg = NIC_MBOX_MSG_RQ_SW_SYNC;
@@ -387,7 +387,7 @@ nicvf_mbox_rq_sync(struct nicvf *nic)
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;
mbx.rq.qs_num = nic->vf_id;
@@ -401,7 +401,7 @@ nicvf_mbox_rq_bp_config(struct nicvf *nic, uint16_t qidx, bool enable)
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;
mbx.lbk.vf_id = nic->vf_id;
@@ -414,7 +414,7 @@ nicvf_mbox_reset_stat_counters(struct nicvf *nic, uint16_t rx_stat_mask,
uint8_t tx_stat_mask, uint16_t rq_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;
mbx.reset_stat.rx_stat_mask = rx_stat_mask;
@@ -427,7 +427,7 @@ nicvf_mbox_reset_stat_counters(struct nicvf *nic, uint16_t rx_stat_mask,
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;
mbx.lbk.vf_id = nic->vf_id;
@@ -439,7 +439,7 @@ nicvf_mbox_set_link_up_down(struct nicvf *nic, bool enable)
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;
mbx.mode.vf_id = nic->vf_id;
@@ -453,7 +453,7 @@ nicvf_mbox_change_mode(struct nicvf *nic, struct change_link_mode *cfg)
void
nicvf_mbox_shutdown(struct nicvf *nic)
{
- struct nic_mbx mbx = { .msg = { 0 } };
+ struct nic_mbx mbx = { };
mbx.msg.msg = NIC_MBOX_MSG_SHUTDOWN;
nicvf_mbox_send_msg_to_pf(nic, &mbx);
@@ -462,7 +462,7 @@ nicvf_mbox_shutdown(struct nicvf *nic)
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;
nicvf_mbox_send_async_msg_to_pf(nic, &mbx);
@@ -471,7 +471,7 @@ nicvf_mbox_cfg_done(struct nicvf *nic)
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;
nicvf_mbox_send_async_msg_to_pf(nic, &mbx);
@@ -480,7 +480,7 @@ nicvf_mbox_link_change(struct nicvf *nic)
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;
nicvf_mbox_send_msg_to_pf(nic, &mbx);
@@ -489,7 +489,7 @@ nicvf_mbox_reset_xcast(struct nicvf *nic)
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;
mbx.xcast.mode = mode;
--
2.34.1
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2025-02-18 19:39:01.001152583 +0800
+++ 0007-net-thunderx-base-fix-build-with-GCC-15.patch 2025-02-18 19:39:00.418244084 +0800
@@ -1 +1 @@
-From e7133f8fb39f506dc1eef02c2927acda949ca000 Mon Sep 17 00:00:00 2001
+From 68dee34412e088bc904f639b0428b6a9a9543c72 Mon Sep 17 00:00:00 2001
@@ -7,0 +8,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit e7133f8fb39f506dc1eef02c2927acda949ca000 ]
@@ -36,2 +38,0 @@
-
-Cc: stable at dpdk.org
More information about the stable
mailing list