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 8FCF7426CF; Fri, 6 Oct 2023 12:19:41 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7F3E6402F2; Fri, 6 Oct 2023 12:19:41 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id 8A6224014F for ; Fri, 6 Oct 2023 12:19:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1696587579; x=1728123579; h=date:from:to:cc:subject:message-id:references: content-transfer-encoding:in-reply-to:mime-version; bh=VkTyMz35kv3mwv65yTaR1uVpaCuSLIE1XXD6ob2i2/k=; b=HOR3YXzlboCWRyrijb2CBUBYqKMkRFBmmZBiafLta/uenj/92w0VFMkc UjPl8yghQLRzfSuG5O2cqrsn4tgdKJSn4u2RLJRJbhoZGPD5KIwirWg9I wyFtnE5kWMS3wwFRPanULHRM8Ha4qYVAUxgOmSgxZr19ZBTB8cBqbU7r5 dxYHuak9C2Y2/pekthdAdy1qYs/YZ9+fZP14a5aLreUrTd5ce5qFIXpfP QsKUHQqHm4ycA8rB4OABlQGIbse6AK7MuPb+9hfuD+BvjkOtD/qECQba7 22BXucvT5I+hqGkurAl2yVXpltyk58nZOpVIe8iUGtszqamuOYLwYJ+fH A==; X-IronPort-AV: E=McAfee;i="6600,9927,10854"; a="447910231" X-IronPort-AV: E=Sophos;i="6.03,203,1694761200"; d="scan'208";a="447910231" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Oct 2023 03:19:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10854"; a="745827306" X-IronPort-AV: E=Sophos;i="6.03,203,1694761200"; d="scan'208";a="745827306" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga007.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 06 Oct 2023 03:19:37 -0700 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx601.amr.corp.intel.com (10.18.126.81) 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:19:37 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx611.amr.corp.intel.com (10.18.126.91) 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:19:36 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx610.amr.corp.intel.com (10.18.126.90) 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:19:36 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.173) by edgegateway.intel.com (192.55.55.68) 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:19:36 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=A0d+s+GkssxaiItzztB02WTaAwUcqVWabEBnp9Gb4PByI2JPH/nEG2xPFaHIaR289MG4pRwY477hTWG1pIL468sAg5coWTMUTnAGNKN7Jp7uncfDPbnwRi7V64Q4OkPMn0wc6MGdDmldeBKj8hgCJ+EQPnjRtJEOxkIghlK94y+q19CtyZEUTKL5ue9yF49ck8ovd9SYRfvroV7m7PdRZaHGAqX4wiDs6YSrbLFO6/eX/Nak+Ss/a0M4mZj9zyuP64XvYEZmkxrjsnBvoTwkLdb+8QPt1xt8j+BQQQIp6m/N97DKhkiftKBsNJAbFzuccUwx2/3he6J0+DRqJACA4w== 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=NPeaHk5RPh43H88mac6Gw5Wuq8OPNpHHPE33aM8xR9w=; b=mYv+GLvF5QgtS0kTx6/kVPFjTBz0u0cx9L0H6Lp8s5Zf23N5G3nCtFpXGZ7aSlf6EbNng8H+ebJMV3X2/zRHpBAln9i6x/TL2+n5Vh+kI8+LDLEccrL9/c4vkebI4AzEUq/IkF4pW56BTOdsoQ64J45YKRLeiyNlqdXCih96w8kecUeGconXRZay5dvuKcEfE3YUxAr4Cb1yIu4BZrngLPwZWjeUcFYWnKHuYH/Vpsk3Wog6SmylvouB2y4dcJa6A4ICbqo/ha30qWuUrprQVlI2am4qrBSEa1Gu2EyV317HQCLjECGRgS1G7Fog8boS199HBmYkNELS5vBt56YJRg== 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 PH0PR11MB4999.namprd11.prod.outlook.com (2603:10b6:510:37::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.29; Fri, 6 Oct 2023 10:19:29 +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:19:29 +0000 Date: Fri, 6 Oct 2023 11:19:24 +0100 From: Bruce Richardson To: Jerin Jacob CC: Morten =?iso-8859-1?Q?Br=F8rup?= , , 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> Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-ClientProxiedBy: DB8PR04CA0028.eurprd04.prod.outlook.com (2603:10a6:10:110::38) To DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7309:EE_|PH0PR11MB4999:EE_ X-MS-Office365-Filtering-Correlation-Id: e1e9ae52-4e60-401d-db84-08dbc655b971 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: r4d+gU9F31w0CVa02iGafb8hZSglAzxXCt59TNquYmnPg+/0WUyPsio2YZ3vP8BSkqVT8dasMKVwu9nZBBKXNjFtIgccm7NZCyJTZ6hVvT4IURc2mmiSFGmy5BU1ieHigVo9SH8HMCoaT196/TR4QpvnpmnfXCYDkyz5Tq94xwiMUFm1GshKrHTNwNeTR/5j/kLDBRNMrcX1dCETcEidLA48rdAqX/I3BZVcOTDHxosqqj8XbfxBnCze8ggZwEoCS3XdGl6wOkP8ubyP/AggtK1sJ8AP2aSSQAsrzPTILmJ5DX2Q+MoyH7mNdh1+0pd2tYwZTb+S2Tw5fy2+BU48CLlYkvy15wR8+6oYovX+G8TQLyMM4onkqhh8B9bxLiLjzHXg72QzdYYCp1SOWiUaEFAmNA6Ipc5yl7oJ5GajX4JwZGPvfQanDLHlRBs+kakTDbjjlaQgtv9IOunaeiRMnc6n6PSErZ3Ltb71vT/bfB6AcKmWTqWqTGG2K621rdLJDtKP5JwUjplSTpBDd2qsc6lJUjJYTTJ0AxmQ5o+05eI= 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)(39860400002)(136003)(346002)(366004)(376002)(396003)(230922051799003)(64100799003)(1800799009)(186009)(451199024)(66574015)(83380400001)(26005)(6512007)(6486002)(53546011)(82960400001)(6506007)(38100700002)(478600001)(966005)(6666004)(8676002)(8936002)(66476007)(66946007)(4326008)(41300700001)(86362001)(66556008)(6916009)(5660300002)(44832011)(316002)(54906003)(2906002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?ZXZ6aVBHbUdwbUxYVFZ3VTJaR0svWnRyS2lmbkZZV01VRElGRnRUNjA2S0FI?= =?utf-8?B?ZHNrT29ZOHJxeDBWKzRnWG5RZUxSZUZPNUtlQUpGdTlzNVZkWkZvTFVkOTIw?= =?utf-8?B?UnFScnFrSGlGZVJ4QXJMY3Z1S1E1Q1N6a0RBODE4S2VmWU9UTnozMS9EcGl3?= =?utf-8?B?YTVGSnF3UUt6dGNNOFpKZC9xV1JpVWRHQWtsaEwyTmROYmxxVXBDVER4RVdJ?= =?utf-8?B?M2o1eGp0ZEZXOVhpSFNUaVprcTJCb240Wkw0bks0dFZpMGtzekJ1dEE1UDRo?= =?utf-8?B?bjJ4R1h3SVVLeVozZmo4dmhWRXJ2Ri90T1d4RUxWc2ZPb0RWTE0rYWlQSU5G?= =?utf-8?B?cDErT1M2L2JiNThnZXc5RjhlYjQ2aWJSNWhmTkk1eXNDUUlyRWQxdXBIekMz?= =?utf-8?B?d3V3ek95WlB3NXprR1QvLzVn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e60-401d-db84-08dbc655b971 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:19:29.6480 (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: Y8uFpoKjN4iwPBRlUDBOhPkfEk8wv9hrQbRLbgk0mE0qthyEB6ddu1hkn2NzvSrHG8TDX4z/lPFTlnWK+DX/5guaYU9/XZniU9RqNWpjGu0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB4999 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 03:46:21PM +0530, Jerin Jacob wrote: > On Fri, Oct 6, 2023 at 3:44 PM 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. > > Use existing RTE_BUILD_BUG_ON this on .c file instead of header file. > Ok to move to a C file, but I think using static_asserts are better than using the old macro tricks of negatively sized arrays. > > > > 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. > > > > [1]: https://en.cppreference.com/w/c/language/_Static_assert > >