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 78BEB43A0F; Tue, 30 Jan 2024 18:59:39 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F16EB402CF; Tue, 30 Jan 2024 18:59:38 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) by mails.dpdk.org (Postfix) with ESMTP id EDA7F402CD for ; Tue, 30 Jan 2024 18:59:37 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1706637578; x=1738173578; h=date:from:to:cc:subject:message-id:references: content-transfer-encoding:in-reply-to:mime-version; bh=vSkjQmNurXFpIbCxcIFB5jb8WS31aw3pLIZjF9VbGSg=; b=BMgOz3X+GtiR/KefrWTTddInNzjSxo8KN6G7aMcIKny1wAbpM1HhUfz4 3gmuxKUs5Qgweic92alVhrV/6/8wuaaOSl5ovWpMitmoWE2lwCeUWMsOt zcd0qpbQ7JcBaLTtqkCplP4F/9prPvkoe9rYjGt00BdA/wnPg7CMdr14D CjoBPXmHbJ5o4St9uL2/sH2Nazooak+ywtiLB50uVv84kS8E/8pnvag6Q BUbCUri8IIEupMCQV4kKduqGZ9sliNym6/JJG+fcuZoOJ6EIOt5p7v+tr WF3s7L3RZShwhKWZh15ZN/ThZ2unORO8L15tafjs2pfoQS5kFri8stevi g==; X-IronPort-AV: E=McAfee;i="6600,9927,10969"; a="16740287" X-IronPort-AV: E=Sophos;i="6.05,230,1701158400"; d="scan'208";a="16740287" Received: from fmviesa004.fm.intel.com ([10.60.135.144]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jan 2024 09:59:37 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,230,1701158400"; d="scan'208";a="3834813" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by fmviesa004.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 30 Jan 2024 09:59:36 -0800 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) 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; Tue, 30 Jan 2024 09:59:35 -0800 Received: from orsmsx603.amr.corp.intel.com (10.22.229.16) by ORSMSX611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Tue, 30 Jan 2024 09:59:34 -0800 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) 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 via Frontend Transport; Tue, 30 Jan 2024 09:59:34 -0800 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.169) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Tue, 30 Jan 2024 09:59:34 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TzHNXZMszPmwmAcMnazCrWvixpSzXx8OAm1lTjYCe4wrqLwLs6fDdkB3Qk2uc6DCLPSchOqqBu16+EnT/PGuj0kpZDRvjC9uJvmpSknkxBN10Hp4Bk0n74PEP+2ys0FXmaDjXv5NT3np6sSCzdjsHYBshEYQYCBUYbVi36fRtr2yf8SYWOdw4LxkhR1LGNhK8bXlw1XQJUvp8fbeokEmKxumMD34NvY2Vk/9JcRTsFBObYA5qbxjncUoGLtYBgjvYV3B0oYzmfki3ggxAgfuJo8jzFlWhEWuAG8vYKPvYM0i8talehh4faqdD7hC0pYyWwDU9sWepAJ2C8bL41UtOw== 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=ahNYBguO5s9EaF3VteyRs306Rcx4sn6c9gBYfVp+BYg=; b=FY7RG7qAiGRzfH7iLjBWxb+IIlNB14epM8iCacRriEpAOomnV51owBUBwUQlXaQG11jsNd8262hrew4zZS/eWo+uYv5F3kRKKz9RS/Spt/wSCfzYUNpjFtZvBk+s5ANXY9yRkClqYZDDC7rMYlFGhmtvLGpx/sNbxzoBhmG3qCvQmVR9zgsc8RD5jRBQCiM+GsGojXsHj/Cov6g5VgJLhjvuqNm8xYhQTxKzjTTCvFMtPKmQQyZRUz55XWxb4dnHDQxf5fO63PDv9QUfOW+4wzFxsVqtPu2a3NTEECYyoY3S2HZrYtXyvkJ5HYwbB3WQi5cTOZWImcpWsKsMBrhNsA== 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 BL1PR11MB5542.namprd11.prod.outlook.com (2603:10b6:208:31d::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.34; Tue, 30 Jan 2024 17:59:32 +0000 Received: from DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::df88:b743:97f8:516c]) by DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::df88:b743:97f8:516c%5]) with mapi id 15.20.7249.017; Tue, 30 Jan 2024 17:59:31 +0000 Date: Tue, 30 Jan 2024 17:59:25 +0000 From: Bruce Richardson To: Tyler Retzlaff CC: Mattias =?iso-8859-1?Q?R=F6nnblom?= , Morten =?iso-8859-1?Q?Br=F8rup?= , , Mattias =?iso-8859-1?Q?R=F6nnblom?= , Anatoly Burakov , David Christensen , Harry van Haaren , Konstantin Ananyev , Min Zhou , "Ruifeng Wang" , Stanislaw Kardach , Subject: Re: [PATCH] RFC: use C11 alignas instead of GCC attribute aligned Message-ID: References: <20240125183713.GA27715@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> <98CBD80474FA8B44BF855DF32C47DC35E9F1A3@smartserver.smartshare.dk> <91ba1ece-10dd-4698-acd9-6b51cfc63cd9@lysator.liu.se> <98CBD80474FA8B44BF855DF32C47DC35E9F1A7@smartserver.smartshare.dk> <635f0d9f-6665-426b-b778-d61e5e732fbe@lysator.liu.se> <98CBD80474FA8B44BF855DF32C47DC35E9F1AA@smartserver.smartshare.dk> <413840c1-a263-4118-adfe-d4ae0ec0b52d@lysator.liu.se> <20240129194356.GA25654@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> <20240130173928.GA2943@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240130173928.GA2943@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> X-ClientProxiedBy: DUZPR01CA0048.eurprd01.prod.exchangelabs.com (2603:10a6:10:469::17) To DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7309:EE_|BL1PR11MB5542:EE_ X-MS-Office365-Filtering-Correlation-Id: 998b023e-8c56-4407-4c5d-08dc21bd35e2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NlSJL4GlZoHE6ouUxi/eWnowKoMtc48vmg8e5vSnsVqqGOKlBMgkg7zfM3kskuNIpZT6XQBw4n0PUPTOguzrR/xj/jNcXrS8L8ixaW7txctdXPXlFD+tvs2BlneyB2RWKsLrB39TJ1bFU2JCfE5FtlKm+uUAeFyJsNsBr2MJzQXN/ZBDVAEy+qOSQE4tg1xLDLtO50JJ/hLhAt4mb2EbXK4CJZCgBcKsgh6wzlLmy6U7Ll3qJYzfjpktda7NIhlaoM56lYGmuUko/qilDNajWOStF1a4sebPt2DPit8dh1Pe3pPKt4omsmuhK0Gk6l1PlWKvlzEPLEhv2QWHezYqTXTzoxHtZx5no1wfouJZksLbFQjFTxNfy+1wTpF1bqXq91/5X/aCWDmKGuC7suo/AIOX68SsHZUI88Z4bS/OWBx5plnUhGSIh4KyQiCu/xfPvxEOTvh/Ppil6it6Zb1XBhZcrSxjSPhvc4iLRRgIWoqDiM2fC7+tuhVrOp9THdJizQzSJansfFLX0DqjT3+k+LXtIWVJzpHiqofvoAVTm+SI9C9tAxvi9pyiPuCDGjFA 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)(346002)(39860400002)(376002)(136003)(366004)(396003)(230922051799003)(1800799012)(186009)(64100799003)(451199024)(54906003)(2906002)(5660300002)(7416002)(82960400001)(66556008)(6486002)(41300700001)(316002)(66476007)(4326008)(38100700002)(6916009)(26005)(6512007)(8676002)(8936002)(478600001)(66946007)(6666004)(44832011)(6506007)(86362001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?iso-8859-1?Q?SBOHrWHMg5qK46hyJ23TFd5kzJjMM5+JMInWtR/QN4wGuE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6+W42hymUGw+sxMt8pw7Zh+xe5L?= =?iso-8859-1?Q?7PaAHoWK/jmN7QvgoU/03bt8+eUIyRrqVMM4sqNlIoz012mYvcRpHB2mPi?= =?iso-8859-1?Q?mnOXF147efeICkfwsdEb9LamqA8wzsMy+K9KhBA1tM25ul8ra1HtFU5MqU?= =?iso-8859-1?Q?Z+O/8rIm0zV2Nd69S1erESsz+fcz1cNUrp637FnRjR5na/mfHGg8HGgnT1?= =?iso-8859-1?Q?5X7e1XwkJt5IC95sYYiluO/FKiYp0ihBfCM3qcdH2IbwcMneno4RXOysdb?= =?iso-8859-1?Q?DA1SiuRvoMbXMpgUed/eBcLVxjagV01Y0ciLtHdH/VQfKvf538Ncr1BcbR?= =?iso-8859-1?Q?xUvSX4i4pGeXjhk797Kpqe5hbofEBfVCOR2BirQVjADLcvATbXxYCHJqu3?= =?iso-8859-1?Q?aB7Z3iKD3OCvxxPDO7f0hR2JgiY0WpksRVCGhfz0IK5ensZlZPVT6rSAgk?= =?iso-8859-1?Q?hxzAgNxT57wHVzRtj+qGHKh1yF7pQIqPwXyMNYabx0L6Ufw0LC3DydOLZT?= =?iso-8859-1?Q?861MvqfjXNskJoa2I9lpuQxTm2XyrcTjToWg1YjpYdxLKF4TH0em0dT4mF?= =?iso-8859-1?Q?zGJ+JU3X7gMsm//zEwcV4P2I7qeA3m/jYBE1GibiXiqIIhCcgJ54pCJHo/?= =?iso-8859-1?Q?DWI+h4sC6Rgii/3qDvxddkqzxMTdcOqnwHN/a/fdszaaYhxs4fXlFAxazP?= =?iso-8859-1?Q?mhKkwSTD09GFdgi+BHF0BeDAXfS8vCdHCAoMOEAQ72h6f2ZxuiEGlN4Q?= =?iso-8859-1?Q?=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 998b023e-8c56-4407-4c5d-08dc21bd35e2 X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7309.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jan 2024 17:59:31.8287 (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: EedWwbKyOuuMgFxOY5TWyjnQ0n5rrFOM2VczO/seqAp17ikTYZBTusDo3cB7hCqh5t7YxzwKsCCWWwuEztnFdDl90s0r6oqQzWEA4pRsqIM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR11MB5542 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 Tue, Jan 30, 2024 at 09:39:28AM -0800, Tyler Retzlaff wrote: > On Tue, Jan 30, 2024 at 09:08:21AM +0100, Mattias Rönnblom wrote: > > > > Sorry if I've missed some discussion on the list, but the current > > pattern of putting __rte_aligned(X) at the end doesn't work with MSVC, > > or why are we doing this? C11 purism doesn't seem like much of a > > driving force. > > __rte_aligned(X) at the end doesn't work with MSVC __declspec(align(n)) > > > > > If one defined a macro as __declspec(align(X)) on MSVC and > > __attribute__(__aligned__(X)) on other compilers, could it do the work > > of both the above RTE_ALIGNAS() and RTE_ALIGN_TYPE()? > > > > struct { int a; } ; > > yes for struct/union. but only when placed at location you mark as > when compiling both C and C++ for all toolchains. > I can see this restriction on placement potentially causing problems. Maybe we should consider defining macros with the "struct" keywork included. For example, (using gcc attributes here): #define rte_aligned_struct(n) struct __attribute((aligned(n))) rte_aligned_struct my_struct { int a; } Probably that's taking things a bit far away from standard C, but it may cut down on placement errors. /Bruce