From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9AA3A46056; Fri, 10 Jan 2025 18:27:39 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 319064279E; Fri, 10 Jan 2025 18:27:39 +0100 (CET) Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) by mails.dpdk.org (Postfix) with ESMTP id E842B4279D for ; Fri, 10 Jan 2025 18:27:37 +0100 (CET) Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-21661be2c2dso37943055ad.1 for ; Fri, 10 Jan 2025 09:27:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1736530057; x=1737134857; darn=dpdk.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=MvX4Tq1ibzA1oVCufiWk2/QfwJvIolpH+hNqQlopgSc=; b=2Pwj6R9N6w46gT8OZc3LRen9x24LJvpSkpg5tnTGnCldbY9u9pKqLxXW4NKSBQZbhO KY09QksbX/BfEzYuVKfdFY/H0QPEe3XFXktBjmJqqaNuO6qX7Cm0V29r3WVEIjlIiZNU QbwYzRRaYfe8MNTJkUfDQRQLRey5vkSNyInHIelyMwyM7gvuKqniA8AOStTRfNBbSQLG Ir4okGPCsigE85AiJIMiTIgD/q0CoVrXiWxm7Ii+0SqL4/4JrSf3wQrJihYe0riiyfWo VIfsJXI/aCbhxWXyaTxEEbgfDDP7z6pw9mfAqJccmhWUpsfjfNzBpznWPKirs4ceJSbW WTLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736530057; x=1737134857; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=MvX4Tq1ibzA1oVCufiWk2/QfwJvIolpH+hNqQlopgSc=; b=P6uh8tyT0PaUft01ToUebE8a0RTykROO4rxGxC8fFG8tqAwwyiX6fHjvbnG08jM+iw HKFMpbkiZn09cX6ItnEVMNxaPfyJXlzDMDSC6jK2oIJyyhbFLYjFQpg6HVGWsnadelQX mrc1UzFDVFjTZxrERYHx7elxTBBsW6d0Ua4o3t/yyVfXPpGCo551hbb1cweYLE8PUcO+ /reBXdwzE9ijNt768Y0eMheflFVccKB/rq8boQ03tc3thop/JsMR1R6WTLwFYHtqKN1O osRN6yRn0pG6FwgMia6HrIezc3h1lyAfF1qgnYaXn5krfnD8VUEEF03BQ20y1q1pD/HB fT1w== X-Gm-Message-State: AOJu0YzJOZdjy37YKRJfLorRPhVA4N2K5sznMlIdsmdDufmJsRkCh4ft AryEsCJJW7MSZqt61zzEfy0xkVqb+eri45RqrOKiKdvTac6CGJr3t/urjeLkF/qfE0Z588Nricd S X-Gm-Gg: ASbGncsaVKFRRCsuIe4AKz/lhBF5YCKnO7/rqtpl1Jv2Jv6hAWsZ3HlTMStq+at/kP/ Kw7r0msIatVkIYFUa0Atz3A5dT2zlY98/nO7bdZYsg+Nx0ueCefxO69p8pwxF4geeWTs8s96U1J iVAhXzKQ1TSq5vNagX3VhwnlfYp8g+J+qeIJC/NNppJ29DxJoKZ0pJtfYJlsj+q18i7HeuDMe9n 7BC9YTos24UnaLCVUKOz80Kj8po2Ld36SN0JtjQCQbJMRDnOOtGW3mEeLZIiftd0+yOUzwlAPY+ XklFAKSBmq0y9VO2Smfvdj4t/x4WVlgHOA== X-Google-Smtp-Source: AGHT+IHz5ppI7BOE1sc+QuoUEeu1cbx7AMTv5S19TdDqKHsGcCoWV2O2LK3CxzHBrfHHrIm5lmm4EQ== X-Received: by 2002:a05:6a20:a107:b0:1e1:b062:f403 with SMTP id adf61e73a8af0-1e88d2f6a10mr21763487637.34.1736530056946; Fri, 10 Jan 2025 09:27:36 -0800 (PST) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72d40680e67sm1831561b3a.139.2025.01.10.09.27.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jan 2025 09:27:36 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Jerin Jacob , Maciej Czekaj Subject: [PATCH] base/thunderx: fix build with Gcc 15 Date: Fri, 10 Jan 2025 09:27:24 -0800 Message-ID: <20250110172725.540897-1-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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 partial initialization of a union has changed. 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 --- 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.45.2