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 64CC943D17; Thu, 21 Mar 2024 17:32:02 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1031642D7A; Thu, 21 Mar 2024 17:32:02 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.15]) by mails.dpdk.org (Postfix) with ESMTP id 26C2242830 for ; Thu, 21 Mar 2024 17:32:00 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1711038721; x=1742574721; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=Xby45+U/b8ixz09cOfEGaG9RCrsXOd0QGJMOgmRNEXQ=; b=EI2CCi0PlCpI0jnQ4jpLQkfETMyLSkEzDqU5dyAKeUb3APas5MEtRgfH Fl0qEbHvFI2uzM4wmpspaX7Hy+CggUfecN4NEKbv9y07BBqRvn4DqAsZi muN4v8Y+riKUnWI9CRnrT4Jmp9MiTF6K4lHmSLekuXONP7bKBHZskW2bf HG+K5U5XVIITsmmoEYwLQpgJ+I5EnNpdXe4C+kXZt8UbpegQrqMxjfxme AU7cY5qVbwwgvS+g2i0Y0v2Tk9t2Pq0P4DoVaD+44zvi2r1p/t0Q4AIs4 kgruEyiBk+cRdgi57ZmJ7NA4uei2morKIBUL+3P+BBJq11EXAI3S6arvF w==; X-IronPort-AV: E=McAfee;i="6600,9927,11020"; a="9830063" X-IronPort-AV: E=Sophos;i="6.07,143,1708416000"; d="scan'208";a="9830063" Received: from fmviesa003.fm.intel.com ([10.60.135.143]) by orvoesa107.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Mar 2024 09:31:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,143,1708416000"; d="scan'208";a="19140346" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmviesa003.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 21 Mar 2024 09:31:55 -0700 Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) by ORSMSX603.amr.corp.intel.com (10.22.229.16) 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:31:54 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX612.amr.corp.intel.com (10.22.229.25) 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:31:54 -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:31:54 -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:31:53 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lt61jr/fntA1+sN47IRlUbIawELHHWPstr/TabcG1EUEkng0Wx36nMxSEWcfyrAbOUkITIHz8ctSspMnrS6gfsI1jTd6i/i2pnGTgkczUZhi9EyXkbdhfsKd1xjxZTe4QHyd4yOeOaMxCRtYycQUoFmfJbKf/iUSz2cfBYwt1wjvjMEnSkjWPRl0SsrDSV65rs9jSaGaDpJSFkdVvRYAgMqCJCX7ZK773akRkIu3yMBUHboDnJreb9y5ibOiEMLitZmbVZOJvEG3zNnNE+fX2/WxgrOqDhsJCjwNwh3EFQEByD9jQvvgVNFMdv8cNEhC0wykyGSXE6UMm0XwUvhYoA== 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=fDETSW+JK3rZ/8V41AVGlt85GEL2vQ7mvtbT2w/963A=; b=Q3K+UCIFd2fhUi/khafOvePesIzNfhTeXnVC7eZ159XvYBmJFkTLzY3A1TREgPyfPDShs43bXBCd8w2e0pODiNmfHlJdeSViAVIp7YwiMbnTwDZ2PNUVULX6ZYS/BvmmB8GSPO+CEDLrThgALVzJ+36BEmqeXtXpPWzbE3ERuhIJz0ygRr7rDQkcOJaPYG4hm3oQ5dWdCt4dUCcdsSS9NU+LNJMyYjiDQta5dfiJ5VXppHEyDO9She+KB1jdY01xdzb3f/Ay4Qvt2bzrRH/B0g8deWTsF1irfMepWBtW1/jsyIw4lS3rCchs4iqiGkTrT/KIzFxQyfVBbo/cmyPe7Q== 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:31:52 +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:31:52 +0000 Date: Thu, 21 Mar 2024 16:31:45 +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 15/15] examples: pack structures when building with MSVC Message-ID: References: <1710968771-16435-1-git-send-email-roretzla@linux.microsoft.com> <1710968771-16435-16-git-send-email-roretzla@linux.microsoft.com> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <1710968771-16435-16-git-send-email-roretzla@linux.microsoft.com> X-ClientProxiedBy: DB9PR01CA0001.eurprd01.prod.exchangelabs.com (2603:10a6:10:1d8::6) 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: ec27632a-072b-4372-cb1a-08dc49c469f5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8SUpxzm+q5p/xZwYgSm1L1TOT1Lcg2QB2Ef6gQV/GWVoC5AMprgYq2BS4nDdlJGwTScG2ZdzPSCfOJMDvLsXC5eieKSUAe1QPYqdL+NuC6eY6UZPzS0oFPuKMqlcP0f63O9lOoVklT/ksQWB893AUWYkwRUiEGbp1s1j3PzjjG1o/I1b4iD6KmpZNqv41/0/JgiXVXwHQ+B37BBVQDvrtkKd2c8BbK/q7EN5GHAtDbiw4aa2Lb71YsVY0cdbDiFU7nYWLcPL1mR4Uu78cEe8lecE6/Lhn8tqArmO/4PwiXxAt3j63hsDhhW2oDtWy+pzRNYG5C/etROQv8nQ8/BqIFmkNxXjohsg3ZCCme2SpfUPH4AJWMey1QPHRkUkLhznC78wH7R6GBUPtokeFnC67oGJfSRVS1F/y0Wptaw2YwGB+j8OaPEnKUbM0/ICcDxmfc2TqfHBS2PQSGJ4dlMnEwyR+vw+pCo7T3pOlpusWpbUVDFddMFVjKr6tq/EpduCp/ZcKhuUAs9hEYRSzdMT7bHBfkgNDBPO99XerUnBnk4KBL5adbNS4IAlSPE5Z7Cv0ASSnE6KwLwdYlzDDk0M4mw+CiebXrIYtLdRU6FtLAvwp+y9vLC/G/Gre7t4KN6lGoDwPjDBtWtAzctHMQKnhNpZO4SBCWKelv7dUhxu5Lc= 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?6z80ulRIauS3Ophexih/CZF4/7FYrI9UHOmgCg3togyNH2xmqZF+6bEt007E?= =?us-ascii?Q?5KcYlwLKp0KAPi35imTy/Du9go0JGWm9Hun1/QpcXr9GooyLqU01QjSBqM1i?= =?us-ascii?Q?6IjdUBBJTTD4IxA7YYCCOBpQiqnIbH5LlchTBPcroIYqw08cybdlWKUaRk+q?= =?us-ascii?Q?3tK5uLE0XCFb2G3CQjkkn2cqtcJalGgyMxBGTrRKcZqXCymVk7KqmMEGUPUR?= =?us-ascii?Q?H4E5jG9RFi9P5y9t4ecmBHxLXk2HRyM0VlkzzPjQbgMM1hj8u7jzCZa8nq3b?= =?us-ascii?Q?pW88pIPTYneXIibdVraMZmO8h1mtFJw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IcdTXtu+cMeEwBxTPEAF9aGH0HhUJgvFNaSblgqh2rVhZ8K+YYcOrDnjNo1m?= =?us-ascii?Q?fNwAoFLmwyRapCkbmMb8r8fQ+Ti+ESWxaDVQUmC8/YgwzqVsgV5wbDCe41I8?= =?us-ascii?Q?1T/RogHTNMCdUNKoqmq8CqltiW56iAy13D6UYz/5a8EoLSubM0iFXTzoPW/K?= =?us-ascii?Q?i7isXV+HfuNs6s6c32h6Uwe2/QPGxk8U2ecGWz+rkEzvMPAJPIOQwj6CwAw7?= =?us-ascii?Q?cQRx7OvVwP1efpQl7cZ2ZHaRHvXOpouZ+aqvcsLYiI0es36LU/4C9gDTbyHI?= =?us-ascii?Q?gcpk5PwByp/O1FWUnrWeFuWmK1ZxJ7rFtqIuZzLbAa5Bjra8Nz2q3P55X1r0?= =?us-ascii?Q?huLuIGVIvtHbFGDkTGJGH3CFvcn+xhXZ4MlAdSkbOszel2Do/eTXzoa/B/cP?= =?us-ascii?Q?RQ=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: ec27632a-072b-4372-cb1a-08dc49c469f5 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:31:52.2568 (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: tn2VmQJKCspBWJtX33meizM+CSPRRqqvXvyjcNcBFvTy3PmqVYQoOwpR3A5pSGznfShy4+TiHlCr4P0zGhQzuGwlkSNi+lrFsMF/a8TGxq8= 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:11PM -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 > --- > examples/common/neon/port_group.h | 1 + > examples/ip_pipeline/cli.c | 5 +++++ > examples/ipsec-secgw/ipsec.h | 1 + > examples/l3fwd-power/main.c | 2 ++ > examples/ptpclient/ptpclient.c | 8 ++++++++ > 5 files changed, 17 insertions(+) > > diff --git a/examples/common/neon/port_group.h b/examples/common/neon/port_group.h > index 421e2e8..bd40590 100644 > --- a/examples/common/neon/port_group.h > +++ b/examples/common/neon/port_group.h > @@ -21,6 +21,7 @@ > port_groupx4(uint16_t pn[FWDSTEP + 1], uint16_t *lp, uint16x8_t dp1, > uint16x8_t dp2) > { > + __rte_msvc_pack > union { > uint16_t u16[FWDSTEP + 1]; > uint64_t u64; > diff --git a/examples/ip_pipeline/cli.c b/examples/ip_pipeline/cli.c > index e8269ea..cae5c1f 100644 > --- a/examples/ip_pipeline/cli.c > +++ b/examples/ip_pipeline/cli.c > @@ -2566,6 +2566,7 @@ > * | lpm > * ipv4 | ipv6 > */ > +__rte_msvc_pack > struct pkt_key_qinq { > uint16_t ethertype_svlan; > uint16_t svlan; > @@ -2573,6 +2574,7 @@ struct pkt_key_qinq { > uint16_t cvlan; > } __rte_packed; > > +__rte_msvc_pack > struct pkt_key_ipv4_5tuple { > uint8_t time_to_live; > uint8_t proto; > @@ -2583,6 +2585,7 @@ struct pkt_key_ipv4_5tuple { > uint16_t dp; > } __rte_packed; > > +__rte_msvc_pack > struct pkt_key_ipv6_5tuple { > uint16_t payload_length; > uint8_t proto; > @@ -2593,10 +2596,12 @@ struct pkt_key_ipv6_5tuple { > uint16_t dp; > } __rte_packed; > > +__rte_msvc_pack > struct pkt_key_ipv4_addr { > uint32_t addr; > } __rte_packed; > > +__rte_msvc_pack > struct pkt_key_ipv6_addr { > uint8_t addr[16]; > } __rte_packed; These structs don't look to me like they need packing. No padding should appear between elements of the structs. The last struct definitely doesn't need it, as it's a uint8_t array. /Bruce