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 78C3843ED8; Mon, 22 Apr 2024 08:42:14 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 62256402C7; Mon, 22 Apr 2024 08:42:14 +0200 (CEST) Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) by mails.dpdk.org (Postfix) with ESMTP id 796C740265 for ; Mon, 22 Apr 2024 08:42:12 +0200 (CEST) Received: from mail.maildlp.com (unknown [172.19.88.214]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4VNFvv563rz1hwkx; Mon, 22 Apr 2024 14:39:07 +0800 (CST) Received: from dggpeml500024.china.huawei.com (unknown [7.185.36.10]) by mail.maildlp.com (Postfix) with ESMTPS id D25B31A016C; Mon, 22 Apr 2024 14:42:09 +0800 (CST) Received: from [10.67.121.161] (10.67.121.161) by dggpeml500024.china.huawei.com (7.185.36.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Mon, 22 Apr 2024 14:42:09 +0800 Subject: Re: [PATCH v7] ethdev: fix strict aliasing lead to link cannot be up To: Ferruh Yigit , CC: , , , , References: <20240411030749.41874-1-fengchengwen@huawei.com> <20240418072818.2074-1-fengchengwen@huawei.com> <8d48603e-ce9a-4d34-9176-2a4a33ef08ce@amd.com> From: fengchengwen Message-ID: <842746fd-69f9-ae8c-6d7a-7c78ab13b251@huawei.com> Date: Mon, 22 Apr 2024 14:42:09 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <8d48603e-ce9a-4d34-9176-2a4a33ef08ce@amd.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.121.161] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpeml500024.china.huawei.com (7.185.36.10) 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 Hi Ferruh, On 2024/4/19 23:25, Ferruh Yigit wrote: > On 4/18/2024 8:28 AM, Chengwen Feng wrote: >> Fix a problem introduced by a compiler upgrade (from gcc10 to gcc12.3), >> which will lead the hns3 NIC can't link up. The root cause is strict >> aliasing violation in rte_eth_linkstatus_set() with hns3 driver, see >> [1] for more details. >> >> This commit use union to avoid such aliasing violation. >> >> Note: DPDK CI report compiler error (see [2] for more details): >> ../drivers/net/cxgbe/cxgbe_ethdev.c:214:9: error: missing braces around >> initializer [-Werror=missing-braces] >> struct rte_eth_link new_link = { 0 }; >> The same error with qos_sched example: >> ../examples/qos_sched/init.c:338:10: error: missing braces around >> initializer [-Werror=missing-braces] >> struct rte_eth_link link = {0}; >> So this commit replace { 0 } with memset in cxgbe and qos_sched. >> > > As this commit is already fixing the build errors, not sure if there is > a value to provide reference to errors, you can briefly describe change > something like: > "The impacted components have been adapted to the struct change." ok > > >> [1] Strict aliasing problem with rte_eth_linkstatus_set() >> https://marc.info/?l=dpdk-dev&m=171274148514777&w=3 >> > > I wasn't aware marc.info, but for consistency you can use DPDK mail list > archive, inbox.dpdk.org, like: > https://inbox.dpdk.org/dev/8175c905-e661-b910-7f20-59b6ab605c38@huawei.com/ ok both done in v8. Thanks > >> [2] https://mails.dpdk.org/archives/test-report/2024-April/637966.html >> >> Cc: stable@dpdk.org >> >> Signed-off-by: Chengwen Feng >> Signed-off-by: Dengdui Huang >> Acked-by: Morten Brørup > > . >