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 0AC66460C9; Tue, 21 Jan 2025 00:25:07 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 25D88427CC; Tue, 21 Jan 2025 00:24:56 +0100 (CET) Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) by mails.dpdk.org (Postfix) with ESMTP id EC890402C9 for ; Tue, 21 Jan 2025 00:24:53 +0100 (CET) Received: by mail-pl1-f172.google.com with SMTP id d9443c01a7336-21680814d42so81193425ad.2 for ; Mon, 20 Jan 2025 15:24:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1737415493; x=1738020293; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=AVKsSKfOqojv6FhGC9J4uH4butWNuq7EEne+ogZF0OI=; b=YyB8lKV4+tRCrJAjRkCPwDfuOMFZx+2sGaijKxnLxkHISdVh9PHTyymtNflXf53Gr/ 6SEV/PU4aB1YJ+H/cMtCNH362yug/euDm7ZW5qhx6rAncAIvMLgWiyPgvnRFsaAZEkFT 1tqkjcDmAlTB+fiCoHATMrdtNYG5KNBqoJ2CWme8Qt4FK3Y6wOvkygckTln3blg8jD8f qTqMaOv5e44I2xtoA8GY9TUbKJh6I8LwF5wOS/i+VAlisv/+9uCf/ZnIQqCKCvyMRAsM SkVlOQCIfyqDa4ZvtW0hQIRJBqeQ+3dViQQjC+gFJ1nZqZTql4InI4v0j8NYV1rVA7YB GSJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737415493; x=1738020293; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AVKsSKfOqojv6FhGC9J4uH4butWNuq7EEne+ogZF0OI=; b=bphaDVSwx5TKdOc8R3x4IQ0/psb1CnxCUEXJWyJDKvNlaWpxMA7bRAqvrVM2rwOqlU 5VxCV2dBaSsDTaMgAi2Tuyop/9c22RBLqvH+FN1rTRfOcn4TRnwW2wPhtxtxX8ddOtfi wEP02N8cwD6SlAcbzKx39fX6jNKveHW1W5ApsrPi2AblSdUVJbl6W1bf1brs7pFl+vRX 6iYaz7kuaAQyLhH+KJW+yEeQRoMNu3P1lkq1ik1IcC0NAa4P+YuzFlGDBmdy3rc8fCME 3SrT41BBGC+AHeYoT19f2ylBTZqXuKYBn1KD6bYCbS6sn/chKANSstacJ6rO3qtvE860 L39g== X-Gm-Message-State: AOJu0YwVynSDth1qJoZ9E0S9qhRdvY/LHwMlc+TS6MN9YmC6nzXe8fzB 8uUMa/k/4GoGkLxymSMNXeK9Y5IQOwrBKsEKCUoVI+GZXC6iNUEESyl/13goa45vsQ63hpAo9S2 o X-Gm-Gg: ASbGncumSnWMFP6mENP+d5d9dg3KvItoOmfWEu4epvXvHNiztlaQKugI9EVl3kdXYu/ qCE/Q/1nyFk515p14ltllCkLqjiBEzdsjva3jZUKtRxsWs57d+1SA2hbseTcC6v5o7zKzc5dSES +zo67OkaiywXW8ej8QSK8MyguqZTDR0w59sBLn8Gaa3fJtFVDlsXbdrLcd9elPUobRoZtDdCmiR Sk+pTwnzJ+Q/DVL0wkkkGARy7epoWCq/+pUAQvZa3iKDecrS75YlCk0M1fgFDziau/J73zEPHti ZaddSs/3U+4AW9NpxDTath46pqzMuYkG1hGtsZH1Gc2PRA4= X-Google-Smtp-Source: AGHT+IG4SeL+h/Nh/OeIdWnEXsHDflo0uNGICqszvgoLMj7adQF5h3SXqG9ubc2QPpRYy4b8h1AeKg== X-Received: by 2002:a17:903:22c4:b0:216:485f:bf90 with SMTP id d9443c01a7336-21c355750eemr209368235ad.27.1737415493102; Mon, 20 Jan 2025 15:24:53 -0800 (PST) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21c2d3a87efsm65795125ad.138.2025.01.20.15.24.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jan 2025 15:24:52 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , David Marchand , Jerin Jacob , Maciej Czekaj Subject: [PATCH v2 2/3] net/thunderx/base: fix build with Gcc 15 Date: Mon, 20 Jan 2025 15:23:39 -0800 Message-ID: <20250120232442.505866-3-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250120232442.505866-1-stephen@networkplumber.org> References: <20250110170603.538756-1-stephen@networkplumber.or> <20250120232442.505866-1-stephen@networkplumber.org> 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 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 Acked-by: David Marchand --- 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