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 A740B43EB1; Fri, 19 Apr 2024 17:25:53 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 33E4D402D9; Fri, 19 Apr 2024 17:25:53 +0200 (CEST) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2083.outbound.protection.outlook.com [40.107.94.83]) by mails.dpdk.org (Postfix) with ESMTP id 59A6F402D4 for ; Fri, 19 Apr 2024 17:25:52 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ASQwZNMt5iEsXf7Jsw80d2R/VLIz0ycTTimenog1OGCjTvGOo6B48hsCAnVe9EnpwRPy3v6wyIFUuyX7PybEvwFb1C6T5lVMCDjy0EkCV2508dnSUlBdq+2MJYymfoQwJmoT38LcnRaZ2sJlp15yeVooYt2kcVChQV9jUuAazf3OaOkj0K0vuHxRkPucpZYgMuBHIgNYXSVvLIwgTgqBkcYP367TuEG4hBPbs2SU+E2zaAUVy7wHMoFG1cgZwtFC4/EF2FbxFZuqw7q8uDVBzZEFOslZZznZtm6JkgI8S0k2TFUmz1UbqnNUt7xfK6mxUSYh+/OTkV56woiGCerzaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=XY92vJbIpwLrr6bOBj/dhkUWuoxLhkuNb0jNuVFtX88=; b=RXGgyz57uHnylk0NNInWqAN1K6DOT0F/m3DFRkuaZjn2XvTGiVBKVcmKQZT3HZKFrcnJt1OsVv7gJSS4rErirXfli2Y0kh0cQkf4Ub8u+vAfZyTxkMqh3UBjoK9ad+38Qd4zFeZ8KhdD1dj/8ANZeOrcjzQiWnztQzS6OYP5oQy7pxUcGPn6tfmJ8vleNkHT77TsZ94A4wb4FXkOgSaaetTzYYheix2VwQrQu8NdiqJ190EwjdAfPQG+2d29/+CrFd0PeDepJgU2bsLlpObvjwrEsPBCT6ZaV48g/7CBlpLI0gtkwkBN9uj4xJyx7i2vseMt0hANuZBy9IqWNjnO7Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XY92vJbIpwLrr6bOBj/dhkUWuoxLhkuNb0jNuVFtX88=; b=0ptRsuAZ+HJ5WKx1pr6/6x69aFZkHKWdnCc2Fd5FS2f0zrF9V4CNFdFA4ij+MZd/Y2t5xMd1I+v2e8njTTNq+BDlc9Dpcjwd8r2QJsmeDzPxp6YkyN3JjrE5l7rT2SbKrSKckHQuN0uucUR8w63HUwax5FuQYtRyqotUt+T0gIo= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) by SN7PR12MB8791.namprd12.prod.outlook.com (2603:10b6:806:32a::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7472.43; Fri, 19 Apr 2024 15:25:47 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::282f:29d3:cac1:cde3]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::282f:29d3:cac1:cde3%7]) with mapi id 15.20.7472.044; Fri, 19 Apr 2024 15:25:47 +0000 Message-ID: <8d48603e-ce9a-4d34-9176-2a4a33ef08ce@amd.com> Date: Fri, 19 Apr 2024 16:25:43 +0100 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v7] ethdev: fix strict aliasing lead to link cannot be up To: Chengwen Feng , thomas@monjalon.net Cc: dev@dpdk.org, huangdengdui@huawei.com, mb@smartsharesystems.com, stephen@networkplumber.org, roretzla@linux.microsoft.com References: <20240411030749.41874-1-fengchengwen@huawei.com> <20240418072818.2074-1-fengchengwen@huawei.com> Content-Language: en-US From: Ferruh Yigit Autocrypt: addr=ferruh.yigit@amd.com; keydata= xsFNBGJDD3EBEAC/M7Tk/DfQSmP1K96vyzdhfSBzlCaGtcxNXorq4fALruqVsD3oi0yfyEz9 4YN8x7py0o9EL8ZdpOX0skc0AMCDAaw033uWhCn0GLMeGRKUbfOAPvL6ecSDvGD7CJIO9j0J eZUvasBgPdM/435PEr9DmC6Ggzdzt8IuG4PoLi5jpFSfcqxZFCCxLUDEo/w0nuguk2FTuYJg B2zEZ4JTBZrw7hIHiFh8D8hr6YA6a5uTofq1tr+l048lbtdFUl8TR0aIExVzE4Z8qKZlcE+9 RQaewjK5Al1jLE4sHdmd3GN+IvgDF3D/fLsi25SKJDeGSdeHkOmaX0qGeM4WKIfU6iARRCiQ N3AmBIxZ/A7UXBKLaOyZ+/i3sE6Wb53nrO4i8+0K2Qwyh6LjTeiJAIjYKN43ppxz3DaI+QwQ vI+uyHr4Gg0Da9EPPz/YyKauSeOZCfCB5gIfICO0j6x0SCl8uQ2nLpjxcZkf0gjcwUzP3h+S 3x6NfDji9YEij0zczW/dcSpGgZ6vsFpPrtnP9ZXy6J53yp0kJtOJoOlkEFFdU2yCZnCDseum CoudmGLZVvS0/DzHDJejq+3kK3FDGktZBOxZIIpal+nFqS7lVgOZc4+huVv3jyhzoAUOEyXA XK5j6o7g8STUY+z33QNnHpdLvecMwuzmvqy0jR54yAbZ64mB9QARAQABzSNGZXJydWggWWln aXQgPGZlcnJ1aC55aWdpdEBhbWQuY29tPsLBlwQTAQgAQQIbAwULCQgHAgYV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IZewdIjkzAhmmbxl+8rM/LKBH dZUMTzME5PFCXJIZ83qkZQ795MTe2YScp9dIV7fsS5tpDwIs7BZNVM1l3NAdK+DLHqNxKuyO 8Zk= In-Reply-To: <20240418072818.2074-1-fengchengwen@huawei.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: LO4P123CA0031.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:151::18) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|SN7PR12MB8791:EE_ X-MS-Office365-Filtering-Correlation-Id: e311b5a1-9a8c-42b9-57bf-08dc6084fcdb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4l941lwjVlLrmHPPuFdr/S9KeEz7TMFKfnkJA7ahV1ssFWwLf+OBRmN6oa4Ln6Zuu4n9HIae6WVx/UYKlKNrl6dDMFuffE/6QcVnBty9MtvpGQ4l5yS3i/tAGFutXFZCL8GYvTvOJnbrukWetK4u0A12FEF2EW5bT8rDO7WQiox//Z9p7aFqiQu4t/Lrb9ip2Fe965Si/K0JVEIgRWbLzfcdKK5iI03KiHLij8UYstoMScAmLsgWNWlSzexPeXdgHHKG+vvuKbIhhTqtz6wXxFpKS/mwM16lZcDo80b6Ao4WRTaHAEPxajsIxKI9/UYDzMMUTb8as4+gtlPnSM26Pv/HWOeetTx2c51bDyLbuuZDJwAHHQf7b5ReediTlDj0myzm9I+b8/2ePwzRSKFd2Djf7D4TtlMozPhX+0uRURbPxY2EfwcZO1IJQXOwCXLPSp6k75uFsrCqzlEbyYMPQHeitaAGN9VNYu/OaPFlJ/0ruBJxMzwlmjlzz9rssQAxhxHYwpPwxj1qOB2y1F5rdMV5L2iCR53wm4IGBBk6UN5tR2zMqutajnLM/ED0gMBJsHeHfrglnpKRUnTSWXV72jk5+gtBSw0agE+0w5nU1XQ= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH2PR12MB4294.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(366007)(1800799015)(376005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?dlRaRWoraWZJaXBFVGpVOXNhRlNWZ3FzbWV2V2djbFdrZG1WVnc0UkJ1TkxS?= =?utf-8?B?VkRQRHFNbVFlWjFjUjFzZHhUeTR5RWRpQmh0RW43aHZCSEYvTnlHbCs0Nlc4?= =?utf-8?B?N2dJYnFINkV3dXM3K1RUSmYyb1lqdFpNaUo4c0J0QWRKNm9WNTVIaTNBaHFK?= =?utf-8?B?TkVLcjJiL0IxY0lTdWxZbThOQTBxVVZRNSs3U3JsbkpTUTdFc2xaNDlBYlgv?= =?utf-8?B?WXdZSGY3Ri9jWi82ZVl4cm5JUUtPbkJnZUovTGx3TFlDWmR3SjhUNGZIMW1K?= =?utf-8?B?U1ZoNmtNRDZUaG52d1p6VVlMTm9kR0o4UzE1MERMaVZSVkMwVkNNQ0JuV0Np?= =?utf-8?B?Q09na1prUitWNXVvQ0RUOHZ3eXFSVFRpdW8zVlg5K3JQVjkrSHJxNDhreGl0?= =?utf-8?B?MjQ5K3YvOWdvT2NETGRNVzRsbldkQTFtVUJIcGlzQVdscVNYbWVLTWMwNUxJ?= =?utf-8?B?UFNQamZmOGhMZnA0UlNZQXlMaFQwdkp4ckFjWkQvMitidzQ2SUFwQlVVOGRk?= =?utf-8?B?VkVENTBVb1FFR2h3eU5mZzRhWjA0alFjTGt2citOczNtcHc5UVNiWkFya2tn?= =?utf-8?B?TFRCeXhkTEw4b29OWjhIUWQ1L015T044WStsS2lrZndFMkFsWVRNVUF2ZWFY?= =?utf-8?B?eGxvRy9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= =?utf-8?B?NkYyMmszb0QvVUNnWUNlNm1LYjFFNnMxSkQ3MHVUd09FRXE5QVVvOHRJSUkw?= =?utf-8?B?MzJsK1lwcnlBNlg5anI2d2JOcjhtWUlLRDhsUFZGSE0zSGhNZkhXdVpMc3B6?= =?utf-8?B?clg2OFZtRFA3R3JnZjU1VCtsVFFsdTd4T2lqNG10cjh2eVdtci9xdzVrTnVK?= =?utf-8?B?VisyTWI2cHRXQWVPWmpKdE10QmFBdzZIdGdrR1NnZUZHTWh5bCthRjhzNlFD?= =?utf-8?B?clVUNmo2anM4TG1ITkozWGF0dFlhZ3A1bmRsNWZMV2FZNHZJSGtBQU4zUVJ0?= =?utf-8?B?dnNQZkcyWlNhVUhUWndOQ1F1UDI5a3ZhQ05TUDVDeUp3QUh5NmJFQnJxaVFW?= =?utf-8?B?NFZuQ0RxVm5OVkJMWkxXMlhYbStZZDVpV2NBbFJyb3RDWGVtWFpkWkNGN3Iz?= =?utf-8?B?UGJrU0hJOGUwV1VyeURDNE13YXVud3M0azU5VUFiNUNPV29UMER2Z2dkYkNY?= =?utf-8?B?NmpTcHplajl5UlZYMlBraUNpNS9NTlpab3FzL0JJTVhSR2lqYjRuQ0xyaHdL?= =?utf-8?Q?uwrEBW6QCk69qp2NaIP2tn2Lf?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: e311b5a1-9a8c-42b9-57bf-08dc6084fcdb X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Apr 2024 15:25:47.5929 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: I5j2uaXbRRCPKNqPfudRw+s+gI95ijjQO7BhG9r0X9EKU81nJkD95fiiQ/VWldW8 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB8791 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 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." > [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/ > [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