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 D025A43A0F; Tue, 30 Jan 2024 19:01:50 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5953B402CF; Tue, 30 Jan 2024 19:01:50 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) by mails.dpdk.org (Postfix) with ESMTP id E23CC402CD for ; Tue, 30 Jan 2024 19:01:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1706637709; x=1738173709; h=date:from:to:cc:subject:message-id:references: content-transfer-encoding:in-reply-to:mime-version; bh=qx+evyiBpeAxUkib/kA6iCo2b/Lcnm4sm0xr4QxWF4Y=; b=VCca6kHcHtLzKPxST+QAsijAYGuhUk5NzTZb4YQbLVWn2DCOPMtn4MoT Zl9I5ftCQ2ZNzwwYK8FKjXneuGg0GZGT0s9571VN2tDzjmdSiMKfeC8Wy 7CgYfvf/H/WkeAUfrmzJOX8zZOmHWFhgUnYIPJBFkeVFK9MF+8IJ/MYMX zvHollZZ2PzaoL1zIzLUDbCTAjlMDZ/O6dhL8BdaL+UuFsNVGOIiuGsA4 8+J+moe17+5jgbrm0bvZxXvolfMMh7w9dn3jliY1kgnZvxUh6Ksmr3jNh 5yegOCqnixq4ZmRIs/dhuaHpExFquPKBWQakSUE3ujsD++Zmk1h9OLi+X Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10969"; a="10454769" X-IronPort-AV: E=Sophos;i="6.05,230,1701158400"; d="scan'208";a="10454769" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jan 2024 10:01:48 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,230,1701158400"; d="scan'208";a="22495178" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmviesa002.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 30 Jan 2024 10:01:47 -0800 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; Tue, 30 Jan 2024 10:01:45 -0800 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) 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; Tue, 30 Jan 2024 10:01:45 -0800 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) 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; Tue, 30 Jan 2024 10:01:45 -0800 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.168) 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 10:01:45 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TV0YuK0cHQfR6SSlqn+j9LgT1gtZdnB7qprb1cjiHFEWWvzgSA8Kfq3cxviXzAW/bTLgvO5ssOu+04dA7NwlP3tTsA5Wk84ZH1/8ApGjODd8fJ3HLbaeSdu2lbO3cXogeXLBiV7BDcwNI9B2tpLs/nSjOx2GFnCahnzw5pkswyayw7pi0T/PzVaR4HsiTRlVUrfbl7OYPQGTXGQr0MjdZIiJPAhXPEuB1kywOADUCDG3XobOoqH6a4D/fMVHEDHy4BXn69Wk/g/E5p+p8re/zuXIaKduFW6llmASEZOryRJu72vsS1XBnQ6zHDEnHRJC5k+ybxsS1zL6kmrNelaJWQ== 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=5SeSMAzdkxtuFtiWz2AwnL7FM1LRt2LJQGaEHeM+dXk=; b=ffh/CTdK4yQlTxDdCr6uEhMyVmjXpEj+fIHfQhhlR+Rl58fZwnXwVRZ9pxswedChBS9Ev5tkr0BOuecpIXYnOtiVkkbsx+5b7pLakP2JjqRqtptpDb9LgVl9iqTEkvhjT9u0Ms+bTEiYInh6QWPsL5S2WDoJ+ED4NVKbEZwQRB/YXEZ5OeIjwZIzCc2M/fpQ9mcUjvKJaKjD43dcyCibPHZfz0dOxhMRiZdlgBv31XsxFAcyFIJIYpvfLE3bd9/qVoxJn3qHeH2NQuZ8PrZ7QziQuYWkSxGgCtNPmmLqqK653+4UyBkZelaZDqIEewGG1BUmR5UzhZAAgW+PUXFPUA== 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 18:01:43 +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 18:01:42 +0000 Date: Tue, 30 Jan 2024 18:01:36 +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: <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: X-ClientProxiedBy: DUZPR01CA0110.eurprd01.prod.exchangelabs.com (2603:10a6:10:4bb::7) 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: 48b35236-7a15-4de2-a24a-08dc21bd83f2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lgEG2JQ/Af60gAu24GagHjttzYVxD9i1g15bz89vt3NRR69kNraYGJEyxBjmEARZdIgVWwX+WZhEjb252Bl/eY0816YhZo9dB4yIgezKXylqtlpSP5VjfbZzcAYTkBIYr86gyrDBBzjD2FCwwtew3WxuOaHusWWMIlqXVpu2XCQ07/Qcup+I4mAhN+dD91Slu0odAAMFGFhEllSnKEW1kS3zE87/l1g2KxlERauOsjE6VD02Y0MJ672BDUfTQJ/wTAbZ+sRLJdZ/txq9S6Imct74uJ0vvsPyGzjjB1dHra9HfOjVXIaPnfWq4rLxeaK1Jo6nYVDhEfHE88TwMcscISTBx+fxyijaVr2GOwUkhNizwaps61TDWkffLJM4nvsKSERQQvfTXF+Yr+5E9NWXo5PfI/V7al0nLzH8f4dg/4RZ9Kx8RkNges8bIwxC6jsfNqQGTeJgC3tI1WL3B5iAzEBuAz5/73x9Ob9rmswAEDp6MZZqXjGpkO1ICN1KjQRWygQCWkop5Rb/QLdh5HEmJcPUMhBBU0+KhCG/svw0yZT0o3cYH7zo9zuBs4uWpGhI 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?0+ojSsdAnA072P6cPUjZJvMUNe26zR1JjgAb2gcgj2dDjnlm0FOAwVbmYY?= =?iso-8859-1?Q?kter+LoaDQ3eHk+kwZJdSmBPjM5+M0/P3DCBKpAixtwVFHfP8OA1IveO3s?= =?i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nPLXtFGKgOnWra?= =?iso-8859-1?Q?C/5BEDoxewP1IUicVnF/ZRNVU++hZoRsoLaFAfNMGZtTBpC7iLhaaIsZ3o?= =?iso-8859-1?Q?7cjOyycOHRB+vjqDCAA9ZEHFMwnAwCa1vcB0rgT/jQv3X144RW9/Vm0+kQ?= =?iso-8859-1?Q?wLsvcd3QWxDgrfYjpvaVHMt/qSd4u8DHZbezeUdq4aJUwu6U7RG9JpOyGz?= =?iso-8859-1?Q?P4N6C4c5Uoe43KPVQ0qFKcgjkDFj+2cjq0mtEg7/judcISgiShnZEEDguE?= =?iso-8859-1?Q?ESVoMH1EWxfVlJ+EriJUT1RpLBfpvljB0JDxbnIMZiJK+iG6akqTV7e68/?= =?iso-8859-1?Q?WGwsqOmwtdxrlNNcD9Zw4Qa3YzkHtFroo24PdBhTvD+LoUusxSKi+zOsFR?= =?iso-8859-1?Q?H5pe5I6p3qC3S3QJLruSvRjSFIKR1bpBDS64vZxGiAGXc0p0ZLYsz9exPZ?= =?iso-8859-1?Q?IGi+eYYa+OTmBZGR+GEVQsfzft7+3ATaVe5a1t5Veutv+lVzzMbXieFteV?= =?iso-8859-1?Q?Wn8tH7Q0tUp6dV6wvW1eqwIgkAEC9EJKO1PtV/y7cVNu9yA0lKfC+SnmSH?= =?iso-8859-1?Q?Bh0unkUJL+nnQuhvvSG7tmJNnrCCQGHG0lf0y8ZZQ9eRtF0E42+A034u1r?= =?iso-8859-1?Q?LfQBAh8rFKAGP13HHjdisGBp8cLZDsPIauJISbVSecD1Bi6fVRWAcluA?= =?iso-8859-1?Q?=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 48b35236-7a15-4de2-a24a-08dc21bd83f2 X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7309.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jan 2024 18:01:42.8215 (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: RpzJMiFD8JsncivahwF3PacZA6lMOh5jSS5fusyEmCnrEaXWd1nDbcTkeengF+oWqNOgWp5PpgNu67V8K5qWfB2k/2VePjo/m2Q5DDS32h4= 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 05:59:25PM +0000, Bruce Richardson wrote: > 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): > Sorry, corrected example below, though I'm sure the idea was clear from the previous mail! #define rte_aligned_struct(n) struct __attribute((aligned(n))) rte_aligned_struct(32) 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