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 81CB043E37; Wed, 10 Apr 2024 17:58:46 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6CFBB4028B; Wed, 10 Apr 2024 17:58:46 +0200 (CEST) Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2095.outbound.protection.outlook.com [40.107.100.95]) by mails.dpdk.org (Postfix) with ESMTP id F20534021E for ; Wed, 10 Apr 2024 17:58:44 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YEcO4YuW6cx9A3uPNA3XvS/mC0JsOFH+xusCbx4mheYNJ5R8/7Qdfx5W2BEKhQ0lRuT+4ykbgelkg6JiFVC6xnv56NrMdSs26/YM7fDdk+QePzSJyDNPXOQFW0djfebkHhPmvIBXf7ftJR6M/xddG//Pinw7PJ7T2uDnxWryBM51UCvmUz2JUiDSs3AqHhED4vjgpSqEJWdRs1E3X/1QtA91b2z3dxtbWm21fBcIQjxkGo565BxJ9wbEnef8REmRYNzmZ2lomky668gfoBPrsOZOdNh8OAcBldYtlN2qQHcvZvkyJ0zgpMSQZzycg19OPCUgOWMBm8WQ4lBKjXs/4g== 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=x2BpRTAMDto0yg5mvV39y/wp/hyMltPa1AUbdJp5nns=; b=CXHZ8kHKrM6V4sswvyVrt6GPQOEpDYO+u3QZLySJMlUDy2yzP/mcTmb+ZHwI3RokVmx4Lgn8HIj1hjYYOEQCdWZfrQt7eG1PIQX+riKPwweHi8Z8bjclM/qFNZ72f03ifFZWqm3eSFcP+RW+NZmsn5sTzJO871pwdNAZy4z31mjhSDuklpiSW/GVLAugQ4X7y33jBRV+GOtJMctNZX0RIJ29WwTIsAN8Orqmh5DQ30eeTp7uIjmj9tGKv7mY7dLpRFwKPWjcNAoS3dVOEjOikvDnFRNvxNklREXACnlPYDL9mO1qupNHQ7Uo5Uk4tcEI8ar+ojEQuPZvfrjwDgzv0w== 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=x2BpRTAMDto0yg5mvV39y/wp/hyMltPa1AUbdJp5nns=; b=cHrgjSzXxjVlVAiBYBZs7rb/l2llmPR2bXnFiuBrKYf7inI+6xrQ30J2WGTQY1muhXuo35iapnUVaELRXCuVwR5QTMP81EYx3AVozesqd3SRbv8+Hyx6n/pblYK3A33de8H0GRknKYkMwfFp2Iilx0TmCcmHjbv5yomUfG7gdUY= Received: from CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) by SJ0PR12MB8614.namprd12.prod.outlook.com (2603:10b6:a03:47d::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.55; Wed, 10 Apr 2024 15:58:42 +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.7409.053; Wed, 10 Apr 2024 15:58:42 +0000 Message-ID: <699a2d52-bd33-4cdc-ad36-068435e81a25@amd.com> Date: Wed, 10 Apr 2024 16:58:38 +0100 User-Agent: Mozilla Thunderbird Subject: Re: Strict aliasing problem with rte_eth_linkstatus_set() To: Stephen Hemminger , fengchengwen Cc: "dev@dpdk.org" , Dengdui Huang References: <8175c905-e661-b910-7f20-59b6ab605c38@huawei.com> <20240410082704.4691d7df@hermes.local> 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 aXQgPGZlcnJ1aC55aWdpdEBhbWQuY29tPsLBlwQTAQgAQQIbAwULCQgHAgYVCgkICwIEFgID AQIeAQIXgAIZARYhBEm7aYjps5XGsPHCElRTPtCKKm/6BQJkdyEEBQkE3meNAAoJEFRTPtCK Km/6UdcP/0/kEp49aIUhkRnQfmKmNVpcB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410082704.4691d7df@hermes.local> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: LO4P265CA0303.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:391::14) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|SJ0PR12MB8614:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 22mFaWVXjjmpT10Iy35Ga0X6TTHrfhUUFvfhuv+ol5Szv68/dtfuHVN9T8r5EBkRx+GzUhsT/AXNc/uh/LhstowocqomI8L2r/4SezP3F2+jM29yboIT7P50yBKXwoXqmxavoH/ukSPaOOqOlNxv0Jzp0rCCe5V1DTej21OkLTpMqys82w2d9rQkAlge7W6Ysx/HHZ+bk72LBIo/gHJoNLTEHG+5EkZQR+jzLxi9APyFpiBknWYzFYes6w7d7gDulIq1bNW9l9Tu8njt0fcYC/VQf+HbGZ3lcEhsrSS25GRpUm5IXikb7nntRTgSBU7aaLSLxpAN2VnUpdNoPOUqcvoQX5rWIfewNhPDMP01kJ3r5vCXCkatJI4WmNfmaXMQ0DlL+SfCVRe+/4kUil0bg4YxknJhLdn0IWeQEfSK1K7x9QX/Q+uFD6RQiEMv77gNtEVJn5eJFQyZavRvp3gpKcbYo6J2ty/k8oKZNjF4NQde+zDP3phvZ8V2ih6kqno+kCVkN2qjRg2ZUPqD8Ah/Ebqkikt3XAQNQPlAEch7jqBxcxC5vJtC/1naQ2b8ebREmi1h90Yzr6jYEoiIeRYwsmU0fmjt8Il1HVV6JHVAjc/sseTUgJ6IG8XEcbwfQWSmDls+CnTbBSzQRAMUgJrg+410bVNjNmtHG/DzZ/j9eOc= 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)(1800799015)(376005)(366007); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?eGFkdHVXampoL2t3YnYrSGg5VFExQURTQ1ErL3JrNllXLzJnRTZZZ2RiVVhj?= =?utf-8?B?NmVncDJmMSt2eWpORnpJb0w1bzgwdjVleGc1N0pZR2J2dUVyZnlVSmlyV0dw?= =?utf-8?B?bVNWbU5sUTk1ei9YTXJyOWVQaFhianJDKzVraC81cjR6Mm52Ly9Kd2Z1RUlw?= =?utf-8?B?QU1uVVQ1cTNrcFZrMExKK0N4Nlo2Z09UZzVjaWkzN0NUNnY5U3NsWmRheFRu?= =?utf-8?B?Qm9DZU1yRnJMMHBuVkJSVEoxam1kSFpkaXNISFhzdHo4SVp1UzhiYmJlckla?= =?utf-8?B?OGpzNE9QRE5sVkVENXhOZ2VVbUZrS2RBZjJHUk0rbjJublU2RkxZcUdITTNR?= =?utf-8?B?MndyQ0QxV2F2a1o1SmJEM2M1THZvaXhINU5Vb0F0UHduY1FkRGdWd3l5c1FX?= =?utf-8?B?RmxYcjY0ZDhIQVNRTjNzMjlLUFNvQ1pCYmdPMFZOUUxPZm1TTEo4Y3N0dmda?= =?utf-8?B?NDNBbDFWK0tYb1JueDhIRG5EcjhjYU9VY2dTcWczUnd6Tkh6MHZtM1Y4Ly9o?= =?utf-8?B?Q2lDbzVKdlpQY1lnejE4QjRhcG5ILytQVHRpd3paYTk5U3VtcXZ6eXlpZFJB?= =?utf-8?B?d21vSkFUWElsVTRHUHhLT2RoQXdaMGI0eVBBajFKQ1RJajJ4Q21DbEROemNQ?= =?utf-8?B?bHhkNVZGUmNBQnZTS0pJNWpPVmcwZ2Z5TkZRWktQR2FGUVpweTM0aEpQaUpR?= =?utf-8?B?VEFiRjYzZy9SK3NGZWNrTGJ6Z0Z2TGty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RzI1ZUdOeVdhbldBdC9Id1M2YXpnUmZDRVJUaG5zRUE0OXlX?= =?utf-8?B?bndxWXJ0OWFVRkVqNG90ai9scDFGa1JrcXRlZFpxNUpLaUVxTC8zTEVLU2Ux?= =?utf-8?B?OE1jMUZTK3F0bmpNTWNjdSt5WUh6a280SlA3R1pmY0J6L2tQSlRBM3QxM2FS?= =?utf-8?B?amhoVjBhN1E5cklnUC9oRXhiMHdVYWMvUnUxZklTcEJ5RkFER3VrakVMT0hY?= =?utf-8?B?cEJNSEd4V1BBa2I4bnc4WmVqWDVJdkhnVENxU2t4S3N5UGpGdXo5OGRQVWRQ?= =?utf-8?B?T3lrUlJWT3NzTXpKUWJkQVozVDZ3SEhiODV3bVIvOWM5RS94ZjFFODZ6em96?= =?utf-8?B?a1RCbGU4LzFsNVoyK0w5Tm9xdUJZZjRUc2pjOG94QjhGZTFxcVIvRnVUVnkr?= =?utf-8?B?R2sraXJXZ29rTDM4ektINXR2alhoVGh6Q2VTV2xFTDRnV3pkdVNPRzNZM1Ni?= =?utf-8?Q?Bor7TzF2qn6Tnub0tH3FBJJOM?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 35c5c501-454e-4f85-ecd0-08dc59771846 X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Apr 2024 15:58:42.5089 (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: nJFA6SLDMR6bqyO5lwwLOI0rgFZOwMAdNts9AtsyXY7tEf8E0NVBdhtI4VpMtS2r X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB8614 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/10/2024 4:27 PM, Stephen Hemminger wrote: > On Wed, 10 Apr 2024 17:33:53 +0800 > fengchengwen wrote: > >> Last: We think there are two ways to solve this problem. >> 1. Add the compilation option '-fno-strict-aliasing' for hold DPDK project. >> 2. Use union to avoid such aliasing in rte_eth_linkstatus_set (please see above). >> PS: We prefer first way. >> > > Please send a patch to replace alias with union. > +1 I am not sure about ABI implications, as size is not changing I expect it won't be an issue but may be good to verify with libabigail. > PS: you can also override aliasing for a few lines of code with either pragma's > or lots of casting. Both are messy and hard to maintain.