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 8081C43D17; Thu, 21 Mar 2024 17:27:18 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5267842D7A; Thu, 21 Mar 2024 17:27:18 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) by mails.dpdk.org (Postfix) with ESMTP id F0A2542830 for ; Thu, 21 Mar 2024 17:27:16 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1711038437; x=1742574437; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=bZ6OMuEqRzRXR7CKdfPZZZ0FulO2OLYs2GFWYHwfetI=; b=m4uZBz07GkGX4cK9ADeY87+vzfpCkLki5s9lxl4c0L4q2uzusPni8PWL MtoS0aXrMZ1b0LJiqcTVa0jcAtKP53p9odeIUR4V11thGKqJirHmkzeJO SsWfFOM/JNZHBKonCiATtIUyTWaBQYRdq+vzFHUfDPPg3I3rXr0OZYN5S Q7i9VfRNu2BblpSoaldSFs2pVs6ffViGov2fatj4z/GsfIUtHYKkczYDy 3SBrYFG5FDcyjInGDz5Z916ccqMcjf1iO4wVjli3lWvik//6zOwJYeCgG 6blff0H2uv7MMu3zfuNVoxyU46VoYe5fBGIiGfc5Ql5fbuHXnaPq/m1gY Q==; X-IronPort-AV: E=McAfee;i="6600,9927,11020"; a="6652902" X-IronPort-AV: E=Sophos;i="6.07,143,1708416000"; d="scan'208";a="6652902" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Mar 2024 09:26:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,143,1708416000"; d="scan'208";a="45678176" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by fmviesa001.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 21 Mar 2024 09:26:21 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Thu, 21 Mar 2024 09:26:20 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Thu, 21 Mar 2024 09:26:20 -0700 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.101) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Thu, 21 Mar 2024 09:26:20 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YpMU+Yqea2ZUjtnmb5CpCs/4o2EFiF914HEcXhAPkeb/ZgdOjAK/lluHd0VhpSmDY0HG2fmwUB+KC2WsFEmZj41rGjrzI81xvjQbAux5x0SsGw7bTrUsc+VoKf7f0f+UQsxjk3x0iDlZcltm5pwJnbK6QROUl4+6pmZRj3V/ElMB+tTFHECwY2SwFPhVn6wC5bI+6RaRlp0f0mquslE28ta7n46FwvuG88rU4ziGkYCKFsoSfRGlM3F7A18ly10Up+OY/1vWEPSYM0GO9YC23LQnht/NsRWyimg/sD9VoJYuMGf0zgYgGfu1ae1ZxA1Y5AYoxbHeHm86i7vAShqT0w== 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=5uHGnTEO70LXLjGAzroG1NcQtGWBEZnkwLfGW+l7Hig=; b=l1NI9ZhKRnVrzoMbf+P8tDwRWzVtFWk6uQAINGnI8L2vqzxDjj5Qj/FYDjY8sGWrGOxUbkT5p1FXRg5/OqkJUslEr4DH8HUeQknuSJWd72bSQFQIQLjtVfQVY8Fena7IQJQXkx8pJ1KQZJ1XKFaMjJVY58eL547lOymavEOjLMSxqsIijm6abDuEFlYdlkJSanrHX08y98m26Kp8V+kCJNnZv0B2ux/uodl+GuT2jUi+cdlNeTlSaCY1AklcAfS+YXZ7gkjukbz8GigDw8dJNkxICBMv63bKcxSex9P4EYEh4644UM8DaAssVYGL2MpegMDu5OSLEiMVvNsiZSMRhQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) by CY8PR11MB7947.namprd11.prod.outlook.com (2603:10b6:930:7a::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.24; Thu, 21 Mar 2024 16:26:18 +0000 Received: from DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::487e:e20c:ad88:9c0f]) by DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::487e:e20c:ad88:9c0f%7]) with mapi id 15.20.7409.010; Thu, 21 Mar 2024 16:26:18 +0000 Date: Thu, 21 Mar 2024 16:26:09 +0000 From: Bruce Richardson To: Tyler Retzlaff CC: , Akhil Goyal , Aman Singh , Anatoly Burakov , Byron Marohn , Conor Walsh , Cristian Dumitrescu , Dariusz Sosnowski , David Hunt , Jerin Jacob , Jingjing Wu , Kirill Rybalchenko , Konstantin Ananyev , Matan Azrad , Ori Kam , Radu Nicolau , Ruifeng Wang , Sameh Gobriel , "Sivaprasad Tummala" , Suanming Mou , Sunil Kumar Kori , Vamsi Attunuru , Viacheslav Ovsiienko , Vladimir Medvedkin , Yipeng Wang , "Yuying Zhang" Subject: Re: [PATCH 09/15] net/iavf: pack structures when building with MSVC Message-ID: References: <1710968771-16435-1-git-send-email-roretzla@linux.microsoft.com> <1710968771-16435-10-git-send-email-roretzla@linux.microsoft.com> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <1710968771-16435-10-git-send-email-roretzla@linux.microsoft.com> X-ClientProxiedBy: DUZPR01CA0203.eurprd01.prod.exchangelabs.com (2603:10a6:10:4b6::16) To DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7309:EE_|CY8PR11MB7947:EE_ X-MS-Office365-Filtering-Correlation-Id: ebd8e915-41c6-4bfc-ba4a-08dc49c3a2c7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: IAhlsHq/VpszcXjVY9ZgcRaX0Q1L68jzsspW+hhXMfP3Xl3Hdt8knsxuA1nPDAYMnJ+p45AofMfTDsJ+fa2ql9f+kSvVsdr2NEU171KO9w+5nqAhGcXvPq/ZES/7bf9wZ/nXdRMV7d6wb9GUr/ruS5PZmLgPmlT1l6sbR/WX++vGAJH0V2OmKPvdeYLhBKaQucdiIlXmwbpqPx/1WJqYs4tDNtnHRGgd7HwrbnEn86MCvZ3vOVjUuEMw5vJeu4JneF92QnXTmZTtcxH2p0+H4c3iOr3SRwHe3XahpsXv+GZNTEO4YkuQMJgEHc/bqVzOEN/hHEiI9qSKkU+NQiPPH+1Aiq7Acq308HPv2k8Or1b2GdB3iOnjQWlkFaS6V9lqe62fmSodRrGkGMCMWq94bo3P1ExAgX3YNTFeizwWKXvFc7u87gxnzOqQK/OSTMA8WKQo8BBCpdcAWZTRpLA29oXJZNq/XDUk/UUEJDXR25SSUcQQfz98GfmSS17Hv39JdzHSl04hrK8Pyku2nTPmlr6N5Xo6tAssQppSY1eQq8ufb+gDrU+aFgS6xmeegp7mnZvI3DH1yV6ycjj67Tl4QXcwI4lNgzzTw7ps1C5ccFWtMzWHM0rhRaax5vHQjbhbSF1qs768QZTkJKoIwUS7ImUJ/v/Q9vMYyEFoy/PFick= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DS0PR11MB7309.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(1800799015)(7416005)(376005)(366007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?Qm7bw4XGAEwEAyi9ktO8Aj+j4xYKcLkdzOOQysxy8xLAhUrne14ic3s9Q67R?= =?us-ascii?Q?fAC4aHRzZ9RKq1FH9keIVKBZOQ+LF+/cbina/5eUxBeDftwRPmQplUZ4xhrH?= =?us-ascii?Q?HolIVYhGPtoHCH67JI7/WRErPRXg2jvGStCQCViFpjiCJqpIxPI6Bvulx0lf?= =?us-ascii?Q?vRHtf7dznY3eQHAjtQ0tyN1qXiZxPIm7+I5T8zlPoPPNXsQYrOe8ZkOjH2fu?= =?us-ascii?Q?HUDdSWOT5Np2KSTqc2Th4dyFjQWAWSzFN4Km36opWre7vlfOAmBjbokR3KUF?= =?us-ascii?Q?OYB6OiV4viV/w4x0kXbqdMieFSDJPksqeJsn9A5IEFD3ejAUZyr+XeXzEj9z?= =?us-ascii?Q?fmxXYp0hbNmNhy8iUlVmUFsbI7jBgDEOASYh0VYPeHY5KW6IHdEQgQIIU1Pq?= =?us-ascii?Q?n2uUuPmH2LeMgD6saEBqd4nZqaNa0kBQcb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Mena+2KAFgjYL6EFgVzszqeUzJRh0txycBcAPZueBk9fxhFbwlSUguBlPKvc?= =?us-ascii?Q?yQfAY3fv9x9S+GeerIqu+/Vh6TRGsmzi0MWhtkb9801NyiWcCUredjHPVOei?= =?us-ascii?Q?QUjsnwXc3+BjbbZr0+WFw7RJ5vwc7Q32FLRA40GMeutnCA2EMBjF9AiVeJbb?= =?us-ascii?Q?zvkVLQKOuvWOQEA06a8iKTYYNXR0+0eBL5pYjlseyDsmUirn5gWhP3VoDTRa?= =?us-ascii?Q?Nb0qVhhyPpw6BVCCi1Yna3gGsWXT+sxUOdE4I5A5h/7I6SHFpLz1Y96pdE+t?= =?us-ascii?Q?iQ=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: ebd8e915-41c6-4bfc-ba4a-08dc49c3a2c7 X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7309.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Mar 2024 16:26:18.0849 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: tygnsgvWqtyEgfMPQ9ZU6hwYjoUg+1EVPc+L56BFx3YLxZSn9YCSAXVrFBJHAMpxTEULWut7TeX38In0zkT+UMb1fMZeMnAQBJoxSNSeD68= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR11MB7947 X-OriginatorOrg: intel.com 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 Wed, Mar 20, 2024 at 02:06:05PM -0700, Tyler Retzlaff wrote: > Add __rte_msvc_pushpack(1) to all __rte_packed structs to cause packing > when building with MSVC. > > Signed-off-by: Tyler Retzlaff > --- > drivers/net/iavf/iavf_ipsec_crypto.h | 3 +++ > drivers/net/iavf/iavf_rxtx.c | 1 + > 2 files changed, 4 insertions(+) > > diff --git a/drivers/net/iavf/iavf_ipsec_crypto.h b/drivers/net/iavf/iavf_ipsec_crypto.h > index 49f9202..36ced50 100644 > --- a/drivers/net/iavf/iavf_ipsec_crypto.h > +++ b/drivers/net/iavf/iavf_ipsec_crypto.h > @@ -11,12 +11,14 @@ > > > > +__rte_msvc_pack > struct iavf_tx_ipsec_desc { > union { > struct { > __le64 qw0; > __le64 qw1; > }; > + __rte_msvc_pack > struct { > __le16 l4payload_length; > __le32 esn; Looking at the structure, I believe only the inner packed attribute is necessary. However, given that we need packed attributes, for safety, let's keep them both. > @@ -84,6 +86,7 @@ enum iavf_ipsec_iv_len { > * transmit data path. Parameters set for session by calling > * rte_security_set_pkt_metadata() API. > */ > +__rte_msvc_pack > struct iavf_ipsec_crypto_pkt_metadata { > uint32_t sa_idx; /* SA hardware index (20b/4B) */ > This is exactly 16-bytes in size, with all members explicitly sized and properly aligned. Therefore we can drop the packed atttribute. > diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c > index 0a5246d..ba0fa6f 100644 > --- a/drivers/net/iavf/iavf_rxtx.c > +++ b/drivers/net/iavf/iavf_rxtx.c > @@ -50,6 +50,7 @@ > static uint16_t vxlan_gpe_udp_port = RTE_VXLAN_GPE_DEFAULT_PORT; > static uint16_t geneve_udp_port = RTE_GENEVE_DEFAULT_PORT; > > +__rte_msvc_pack > struct simple_gre_hdr { > uint16_t flags; > uint16_t proto; Two 16-bit fields only, so no need to pack this struct either. /Bruce