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 CF7BD43D17; Thu, 21 Mar 2024 17:02:47 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6256D427E1; Thu, 21 Mar 2024 17:02:47 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) by mails.dpdk.org (Postfix) with ESMTP id 8E3AB4029E for ; Thu, 21 Mar 2024 17:02:44 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1711036965; x=1742572965; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=moQQ/+q1uJdFmMDV4Dv2f7ki4yQRmtoxToj+apULxFs=; b=mKt7Ofku8JXzEiIqsN1mMN0V0hJwCr0p3DWKwPvz6HY6MV3N8WDqNdSC Dyyf1g5yfb64SkEUQQiAg8ppCYG4NSFO0IX45vbDJaZjSIu6oZVNWlzb7 xWdlaZLsnz2fIlWC20uycZO7QtIRjEzviYFmtnzmJ23pRBAL8DPkGdBX5 4jDC5vaPrfYqS3Ntn/PyS4yks04XPLm/8fAiN9aZreeRYjIGWu2sNL/Pl vJGNKSPk6JFrfWzYGmxrEp/SlNXTZ4rBSoQYGcnWCOBbRw/NiUbenla29 lG3WkurBc9mv1KXkNANu/H9mr3Dt4Fn1Hqn9mOKta9EiavzqK75C4kW93 w==; X-IronPort-AV: E=McAfee;i="6600,9927,11020"; a="5889266" X-IronPort-AV: E=Sophos;i="6.07,143,1708416000"; d="scan'208";a="5889266" Received: from fmviesa004.fm.intel.com ([10.60.135.144]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Mar 2024 09:02:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,143,1708416000"; d="scan'208";a="19205247" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmviesa004.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 21 Mar 2024 09:02:25 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) 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:02:23 -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:02:23 -0700 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.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:02:22 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WI9yOj1aB2Ctrv6qU1cV6dCWHKJCUIS+48GfFGHaIrI6/zgaQYYAYrs/YfZ50/bPReNvacnnQ9CPlNVVModsIxKHwwO04qOSgxWDkt1ncLGtRwU9z/cGebalGbECLM3tYxTJtYDk3lXsrocnj0i/Z2Gp9vrD81zxB3UkOP0PN67siYg65jgiIfbx+OhXUB3LJoaDMBmg5TIDloPi3VR+lrv8lGPrUssvjWaPr+8eyaR1FcrQZ95S4oJ5cPrtNe76HkCjtp66nQQL3UavmUDwiURoXvq07Ai+jPa4k8ZoHLJ8h8t0whmOXijD5QLgkcqq+Vrskv7JeoNtHgxja/rMFw== 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=AQCozrkbuXg4qXXJpSqPAIC+dPOeMvAVQqUvw+JPP8o=; b=oQkalX/qiMeAsuTRBLyX/v3lgfZjRSeJyOuf0ekOwmnZKBFK3dxGMdpF4no/4dpaywsN6JB47fJJRoTG38chryqB5pdI2oMpSrzFlrGHCx70RiPo+oQB1v3lVUE89v07gRFo3/JG+Z+zKXjstMhnInpxAcGgtTTnn2dk1nHOJcpVc+mR3Y7eanZCKgSiL9yBGivFBiv+i1/sdsrrQjIU71X1VS1iMbwp+RdYa2X34MnBGPMrx95bGMVXE2azwog7Z2MJHiob2hSIV4GbW7Nv+IuDalBCmEViTpvexe6CsidcnoA/2usbJP+4K3t0wteSLIJG+frYjs8IOZg5NNfQ5Q== 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 BL3PR11MB6460.namprd11.prod.outlook.com (2603:10b6:208:3bf::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.15; Thu, 21 Mar 2024 16:02:20 +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:02:19 +0000 Date: Thu, 21 Mar 2024 16:02:10 +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 02/15] eal: pack structures when building with MSVC Message-ID: References: <1710968771-16435-1-git-send-email-roretzla@linux.microsoft.com> <1710968771-16435-3-git-send-email-roretzla@linux.microsoft.com> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <1710968771-16435-3-git-send-email-roretzla@linux.microsoft.com> X-ClientProxiedBy: DB8PR03CA0024.eurprd03.prod.outlook.com (2603:10a6:10:be::37) To DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7309:EE_|BL3PR11MB6460:EE_ X-MS-Office365-Filtering-Correlation-Id: 0f8821ce-1e5b-4776-2229-08dc49c04976 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: oQ/TlJ9SV/bsfaDq2zBlu6IWLj2ItUlGJpVk0B/rdag8FXlCqS99qCeDHw7rU1tu0tmQxLtK76oxsE4FmRF6Lk34q0LbSrzdhL4pxIp814CGOMUByO87d/3Zaqhz4LGXCB1tGW8XCbqYIIgn1lnDNn154f6hrcyTbBhXzs5+2drbban6WVWOlwGXWYTLZMoB2QC9fVTfXUs0gYUaz4DEWW4aJSdsTdZj3SlMlnByXH1XoyD1bB0+ii439vdoNlvhXkIbYRDCoNduX2mwI0fdYi2LARxn3JDBo6cTpTUbkJfx7lZu6wvE5NBXTJXcpYqKYP4tWsQa/pbchfu7yyQMHGpf+l3Pv/v2ajmQgI7082BkGaNfDnTEQau8vADA2sPT0tie/mMyf3hRuW8GCfnpw7cDSWLQOMkFt/cjEqzAl1b0R0oJxMs/gZuAQTg2OBD8o6c3vV+X/H/f+YGjezixShhqNA/ZyiX98vV/ta/1Q6aVVTiCqHGXceNmHoowO+Fx0KLt4/bED0sMMiF3C7s/hGlsaZxqmEDxvrJ+N+dqTlFeA1zEQ9i1NH9jm6TBiP6B2MLkBeJXH40KaFcEExqPQCuSdwqr+Wh0mqGZ6DadzeLfiBMsIcjKYUtP41W/A7TymDUR5gC9uzn++bJ9ABkhckWb+9AERsMd2FnYLjnpB0M= 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)(366007)(7416005)(1800799015)(376005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?/P9HI+RGJkSwvqcQbcBKiL4HjPXR0a8Cg+R58WPZqcQPJ4PCZh2MxZMpnyCr?= =?us-ascii?Q?yX9hA1VNPR8pbfwD3Cb70x9gNcoKXDfAqB9O1KGQubsVQVVK0OsTqYunXXWc?= =?us-ascii?Q?M6mOcTZXNnkdMGIUDaF4BTPpNVXwJfqXKFdTgJ+xnkQcGP8uKWfkoxNZYA4W?= =?us-ascii?Q?j+DqKIyck5/bg+DhqdP6MVGvD9IdKrHNrTaDwcXNHyO+rH8b52bHEI5asox1?= =?us-ascii?Q?PBxLwz7Y+MOJDkq6h9yCGEME0dkflk7bA+Jbs6Kytk+4AWalfxpnGF/d5lli?= =?us-ascii?Q?GIME6QIoVbVLTaNejyolB3nZ6Vw9hSaMuhaxTEv5h5u+8SXl63OWqALwdVQ/?= =?us-ascii?Q?rk2u0Dgm7cuBJ1qf73NJ/9u9lWsqNKF4HyWAkbTafFKg6uUgJGCeJGj5tkuJ?= =?us-ascii?Q?vb8z+R4HDYNCwXlW3h2rJkCRS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1BuzCn3vmp3MKiuPplgX3RUtlSYG1gH18g/pNboPMKBx/8hJTbNfYFmI?= =?us-ascii?Q?jZOAhfSbtEH4fiXcJD4VVvbCVyiJdQ0bOEMkmaT8awOsVt9BnyKUY/6k3Anh?= =?us-ascii?Q?Y16nu31a5cqBlE4rRGfZZvpsgZ0tdVDACntnhsxGzug2ipyn2l8COA/O8QUt?= =?us-ascii?Q?pca0qawfqR48RXJJ8v7D1ir56QH5ReD68AJU1koY5JG78HPaLqWvB81meHnI?= =?us-ascii?Q?g7lxrgAJuDH71Z3/getI1oJLokfyxpoF66d1lZBUD2L1JPKoE8Qgo9Ldalo4?= =?us-ascii?Q?ig=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 0f8821ce-1e5b-4776-2229-08dc49c04976 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:02:19.7549 (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: +XjBwmq2OCE6aJBsn6yByl5FFdx4EuCQvQLAAB8SQwATpeM+EWmhTd1KDjdb4vwPjU47JTl+wotzdVlZ8MAKe+mH+sWOgDVG75jJ44DlV48= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL3PR11MB6460 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:05:58PM -0700, Tyler Retzlaff wrote: > Add __rte_msvc_pack to all __rte_packed structs to cause packing > when building with MSVC. > > Signed-off-by: Tyler Retzlaff > --- > lib/eal/common/eal_private.h | 1 + > lib/eal/include/rte_memory.h | 1 + > lib/eal/include/rte_memzone.h | 1 + > lib/eal/include/rte_trace_point.h | 1 + > lib/eal/x86/include/rte_memcpy.h | 3 +++ > 5 files changed, 7 insertions(+) > > diff --git a/lib/eal/common/eal_private.h b/lib/eal/common/eal_private.h > index 71523cf..21ace2a 100644 > --- a/lib/eal/common/eal_private.h > +++ b/lib/eal/common/eal_private.h > @@ -43,6 +43,7 @@ struct lcore_config { > /** > * The global RTE configuration structure. > */ > +__rte_msvc_pack > struct rte_config { > uint32_t main_lcore; /**< Id of the main lcore */ > uint32_t lcore_count; /**< Number of available logical cores. */ This struct almost certainly doesn't need to be packed - since it's in a private header, I would imagine removing packing wouldn't be an ABI break. Also, removing rte_packed doesn't change the size for me for a 64-bit x86 build. Looking at the struct, I don't see why it would change on a 32-bit build either. > diff --git a/lib/eal/include/rte_memory.h b/lib/eal/include/rte_memory.h > index 842362d..73bb00d 100644 > --- a/lib/eal/include/rte_memory.h > +++ b/lib/eal/include/rte_memory.h > @@ -46,6 +46,7 @@ > /** > * Physical memory segment descriptor. > */ > +__rte_msvc_pack > struct rte_memseg { > rte_iova_t iova; /**< Start IO address. */ > union { > diff --git a/lib/eal/include/rte_memzone.h b/lib/eal/include/rte_memzone.h > index 931497f..ca312c0 100644 > --- a/lib/eal/include/rte_memzone.h > +++ b/lib/eal/include/rte_memzone.h > @@ -45,6 +45,7 @@ > * A structure describing a memzone, which is a contiguous portion of > * physical memory identified by a name. > */ > +__rte_msvc_pack > struct rte_memzone { > This also doesn't look like it should be packed. It is a public header though so we may need to be more careful. Checking a 64-bit x86 build shows no size change when removing the "packed" attribute, though. For 32-bit, I think the "size_t" field in the middle would be followed by padding on 32-bit if we removed the "packed" attribute, so it may be a no-go for now. :-( > #define RTE_MEMZONE_NAMESIZE 32 /**< Maximum length of memory zone name.*/ > diff --git a/lib/eal/include/rte_trace_point.h b/lib/eal/include/rte_trace_point.h > index 41e2a7f..63f333c 100644 > --- a/lib/eal/include/rte_trace_point.h > +++ b/lib/eal/include/rte_trace_point.h > @@ -292,6 +292,7 @@ int __rte_trace_point_register(rte_trace_point_t *trace, const char *name, > #define __RTE_TRACE_FIELD_ENABLE_MASK (1ULL << 63) > #define __RTE_TRACE_FIELD_ENABLE_DISCARD (1ULL << 62) > > +__rte_msvc_pack > struct __rte_trace_stream_header { > uint32_t magic; > rte_uuid_t uuid; >From code review, this doesn't look like "packed" has any impact, since all fields should naturally be aligned on both 32-bit and 64-bit builds. /Bruce