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 0F9DC426CF; Fri, 6 Oct 2023 12:44:57 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8AB97402B9; Fri, 6 Oct 2023 12:44:56 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id 2A9EF402A8 for ; Fri, 6 Oct 2023 12:44:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1696589095; x=1728125095; h=date:from:to:cc:subject:message-id:references: content-transfer-encoding:in-reply-to:mime-version; bh=X4TG3s9b17OnlkpCQXfO9lHmvWxOCj5Opf0HL9hbDQ8=; b=LnBzbW1hXYMLcza70f1dEaNFWIYuYTQ5zsBa0wbxWDc6R7ZhLnaO/LbM BfuEHHee/S45c4EqcOp4VDdSqjUsg9YSFUhmOKpbqaLBAVX37gF1DkTQN mQ9zd0VkJBEErxnRNcjB4+WhFwu4ZH1pYXcKZcIQa19qc/4ptfI6XTJEQ M4u45DP4UJHPGaN1blrBcXnm7cBGiW47feBlebmF4nFOqafTgK/xYOG+u EBgic3eyhIWNrQNPc5LReycUnJ5ttZaaagxwj4YQaCbE2x/I9hRyAE9Kw VZKf1AfuqOBx6xRWMQivmu5KxVliOgWkYZHcc3aEFAZ/h3kNdyE05ddIC A==; X-IronPort-AV: E=McAfee;i="6600,9927,10854"; a="447913903" X-IronPort-AV: E=Sophos;i="6.03,203,1694761200"; d="scan'208";a="447913903" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Oct 2023 03:44:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10854"; a="728803031" X-IronPort-AV: E=Sophos;i="6.03,203,1694761200"; d="scan'208";a="728803031" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by orsmga006.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 06 Oct 2023 03:44:46 -0700 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32; Fri, 6 Oct 2023 03:44:45 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32 via Frontend Transport; Fri, 6 Oct 2023 03:44:45 -0700 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.169) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.32; Fri, 6 Oct 2023 03:44:44 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bzFUGppooVNQiAVJxvnJ2qN7m6wuPwQ3KN6L/dkM/rwl/g6eOpDXItDf81+K/KHdhi0j9F5xYHWgDLNNvNa0YPdTDkUaRYqzsJURaGCmsOfsh+wLmOFvEDqc7XVVkmRwhTL5IdySkzsMUHvKq5ktALIwQiKfZch0VF63MByQst3FpnXztTkJScCfNUhOx6kn1iVu7zfmCkAkPKcRCASz5AvUP+NYkzUnC8OawladbIJ9zjjzphe2mIeVKBZvxeBS7zXhWhiv5/l6DqEHdhxkiY6moQ4Bdnf0EUzBMTknJRb/Z+fP+xbXwTTo2DcJYMGAZZ5FUl/s9ZY8qzoszUai+w== 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=KRXWfsaLlR/nB/Op817iSf3Ohw6+Mjh00nlEx+JT1TU=; b=nCCU+Hpt6CQGFoWSKFv9u96rlbBre0OXP9CG7QMkWjr2Q/c4VIQ2u4SWcnTcQN6BrjyGNUPef5HsMK2fmVsssYD+VD1fEyKtA7OwK1mRxJmSjt6FCiehHw+MTqxMiC1nrBZ1ZhPcE6CdtyJhFADjt/BFnIu9FK7eyysxX1J6hFQI/dIA9mCgUVwN8IccArelZ/Zo/D4VR54O+YaDEyUvC9//fbgEvISKZPVVAoaQEZ71jaHH6TOmYezuVqqiu36ysKeOHO3jVl27x7TQ9jupnG289PHDBnd4ldx2mlW0CsRtDAC4FrEcX52GPlAojHJXgGuWPaO2kBGQUFVf1TKgvQ== 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 PH7PR11MB8453.namprd11.prod.outlook.com (2603:10b6:510:308::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.39; Fri, 6 Oct 2023 10:44:43 +0000 Received: from DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::aa85:ead1:baa8:c652]) by DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::aa85:ead1:baa8:c652%2]) with mapi id 15.20.6838.024; Fri, 6 Oct 2023 10:44:36 +0000 Date: Fri, 6 Oct 2023 11:44:28 +0100 From: Bruce Richardson To: Morten =?iso-8859-1?Q?Br=F8rup?= CC: , Jerin Jacob Subject: Re: [PATCH v3] eventdev: ensure 16-byte alignment for events Message-ID: References: <20231005115101.12276-1-bruce.richardson@intel.com> <20231006094527.73867-1-bruce.richardson@intel.com> <98CBD80474FA8B44BF855DF32C47DC35E9EF03@smartserver.smartshare.dk> <98CBD80474FA8B44BF855DF32C47DC35E9EF04@smartserver.smartshare.dk> Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35E9EF04@smartserver.smartshare.dk> X-ClientProxiedBy: DBBPR09CA0048.eurprd09.prod.outlook.com (2603:10a6:10:d4::36) To DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7309:EE_|PH7PR11MB8453:EE_ X-MS-Office365-Filtering-Correlation-Id: 6040f365-9c68-43d1-b301-08dbc6593c30 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LAyx8uS4bFLxgANU93Ivzu+DmeLGe6F4x1uMFkM10jUYs1ITvxItxlEdHOyFfINiouSqBVZ4wNVu9dv2C+ArbGudJm2cCe5/AHqPTAvPI11GtYpj4Red3nsLinBWCsAdlVDZNEeo/PpJk6YYxWoLYLrf9PqhPOnzjLCK5MTpdWYznZdjhAuCY8M8ulmcuClRxQWJCDnv9DCw7XDycYM0pCp9QEKyLfRcZNMxEQ6V+MIswqKpsKhiI5DxuY16/7/00gIQrTUnalDFYrxagbGt0He4vVprr/n1Y56C2BumPYTsoonJcH7dcLIHViE848Nw+PQRNoNT541KDbN1LZAp9pZ/oBASCNmNc7rzGTUqjUMVW7rQFUeG5SZ3ZvAcJe1+iPzmVeN2nwF8Ih2vuJg3RTf3PuO+3gAH841iAxtJ7IGpSuT80Fr2NoV7IuwEYf2hiq1P9yR7kt4JBXamJEalZ6uPG29m92pXr3YVFhE/ImP6g3erS7G9X53dCS4fBKAAE+lQyvvYISuqhcf9sssFFnqO4spNXCpuLhq9pfCJpyFHC0AVoQ3UrNgrmkJ/RUwG 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)(376002)(346002)(136003)(39860400002)(396003)(366004)(230922051799003)(64100799003)(451199024)(186009)(1800799009)(6506007)(6666004)(6512007)(6486002)(478600001)(86362001)(38100700002)(82960400001)(2906002)(41300700001)(316002)(83380400001)(66574015)(26005)(44832011)(66946007)(66556008)(66476007)(5660300002)(6916009)(8936002)(8676002)(4326008); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?iso-8859-1?Q?xYBldwf41i46zzk1yh7Gy7PB/P6ReO9O3wz87OTDdqmtKy+uNmqGbygXRz?= =?iso-8859-1?Q?hrpinZdccoR0ByDgS4QZSjliai9doqvp/XaL0qy8tdhQDqpjMs0K1ozhp0?= =?iso-8859-1?Q?L2UvZXlPwLIbYeQfjEUy8837wsRlZjT/KCxtZmv04tSDp/9qzLE0P3Hb/H?= =?iso-8859-1?Q?8r617NjPMS8vM8Ztohca9q8q3rtueuGBXxqqdS6vX8fVogcH1eJnXCvJqn?= =?iso-8859-1?Q?FUn8BVQAcHcjNCHq6DQCVwZPcQgFz6dklWjTWoOABTKZkJBsSzlJdUA2Cf?= =?iso-8859-1?Q?j5eM4EOaXhFbg58l5A9+Te/H60RYZdxIOOhiYhzMNc4ug+kJ6CFZuKYhQt?= =?iso-8859-1?Q?PXryyaurwkgs7lPpaJehoj7JAGa2AU9Ut4bjwrv0Q/Xn8JV2jqMRUJtnwc?= =?iso-8859-1?Q?BEE2D3WNlJo9I9FL+YuN3QVCridqxJXHBUly5Oj/wqQJ+rUxYfzq5GARBm?= =?iso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8QFYeVNCm7TJHiwOGdnzVUeSqGph?= =?iso-8859-1?Q?+krY57XA3hdvYyPgTciDHq/peC1sLkAk+27VGWyCL07lPcpz03OiAJ40C2?= =?iso-8859-1?Q?BSS5RrYBLB9IzrS+QZjFIC36JzO5ZxWyqNY0A+1GMtq2/jVZzT68f5omk1?= =?iso-8859-1?Q?uAPnSfgQf5kUnagNYbQHGEapSkIaDYlpi+9j6/9KSFGVZ60NVsTqfYA5z6?= =?iso-8859-1?Q?1a/tjEGZdud25GPBzTulkfr1+m2pvks+cUha4LbcEZiBo6gXzyYdGIjxrp?= =?iso-8859-1?Q?BCpgzAFC6B5SZJz96KjNW5C42cML80jhO1iTEr8MUbq/SJ9gEfkjyVaQ?= =?iso-8859-1?Q?=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 6040f365-9c68-43d1-b301-08dbc6593c30 X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7309.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Oct 2023 10:44:36.8683 (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: m2uxBl6nUrjahk5zfsRrVE88t0syOXV1YRDnjOmU8Y7M7BfvPsnQgKeqsctcPGO47zSFOi6u9AOMuLQpBFEn3sOzQkoCsSr66EpC4x91U4A= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR11MB8453 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 Fri, Oct 06, 2023 at 12:35:26PM +0200, Morten Brørup wrote: > > From: Bruce Richardson [mailto:bruce.richardson@intel.com] > > Sent: Friday, 6 October 2023 12.17 > ev: ensure 16-byte alignment for events > > > > On Fri, Oct 06, 2023 at 12:13:54PM +0200, Morten Brørup wrote: > > > > From: Bruce Richardson [mailto:bruce.richardson@intel.com] > > > > Sent: Friday, 6 October 2023 11.45 > > > > > > > > The event structure in DPDK is 16-bytes in size, and events are > > > > regularly passed as parameters directly rather than being passed as > > > > pointers. To help compiler optimize correctly, we can explicitly request > > > > 16-byte alignment for events, which means that we should be able > > > > to do aligned vector loads/stores (e.g. with SSE or Neon) when working > > > > with those events. > > > > > > > > Signed-off-by: Bruce Richardson > > > > Acked-by: Morten Brørup > > > > Acked-by: Jerin Jacob > > > > > > > > --- > > > > > > [...] > > > > > > > +_Static_assert(sizeof(struct rte_event) == 16, "Event structure size is > > not 16-bytes in size"); > > > > > > Thank you for adding this extra check. We should have more of these. > > > > > > NB: _Static_assert is deprecated in C23 [1], so for forward compatibility, > > you could use static_assert (which is available in ) instead. Nice > > to have; feel free to ignore this comment. > > > > > Is the availability in assert.h backward compatible with C11, since the > > link you posted seems to imply that "static_assert" is only from C23 > > onwards? > > Yes, the link mentions "static_assert" being available for C11 as a convenience macro in assert.h. > > I had to read the link very carefully to get this. I guess I'm not the only one. :-) > I missed that in the link, but I did have a read of the header file itself to see that there was a macro there with C11 guards. :-) > I don't object to moving it to the .c file. However, I think it's convenient for readability to have the static_assert close to the thing it checks, and/or close to any code that relies on the assumption it checks. > I'm ok either way, and happy enough to have the check in the C file. I suppose it saves cluttering up the public header file with checks that should not be relevant to the end-user, and are only for DPDK developers. Anyway, v4 sent, hopefully with all concerns addressed. /Bruce