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 9210B45952; Tue, 10 Sep 2024 09:13:16 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4D17442792; Tue, 10 Sep 2024 09:13:11 +0200 (CEST) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2083.outbound.protection.outlook.com [40.107.20.83]) by mails.dpdk.org (Postfix) with ESMTP id 094B44021F for ; Tue, 10 Sep 2024 09:13:09 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=w0CPTGjcHR/BIKjsALEoK6jhbcei0ZptEKo2DBPpceiJLgEApFeH6F1MosCye7/ah4Sm280B7zxpBgCCm02FCn75B35Xm9a9y1SROCf3BYG28JbAAPRYz4i4vNsBaIOyoHPBlDaBn7J0HbLV+MJVtcz0TQQomvslcnxVb6qrmptSA89munIS7n/dWYjkqmFtY6Vm1CUA3PKhDGA2uKwdeQwujfm78w0nk8YyY3xyTdylOupUHfsQOZsmtNeYu6AlQi4yQMqgm6TedwzF0rsGa9YtqKo/CrP24H5anD5pEwrSmuyDqgm51GT55Nw9dzlxdcV9wFOJDf9+tTgjRwuUQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=HoiiL041ZD7zWHPl8ZhIrk0lvLo4UFBN0nFr1YTksVI=; b=NbcEl2/ahTlIE0RO4OjYxYWlbG1qnX8kh9PoE2al2QqAMUhLmdVdMYVtb/vHudO3Gb4qwOJpzkzAos7MR4FJF+PD5bruvRiVFjrEN5z1bxBfXg+zAgdTGPyEdOPNg7k5MM+F9PM4VGh2FinwXeULYN3AT1VOgKoF8/W9guiOx+KwtMhgCVF+Qwo95cmd/5IWX4JK4t5/KmDNdn41vRg7GGZ1XIzLnYFXTPIyapIa/ifuKfV96mJ5TSjJvYfIqeXOpkr7e7PgReGRYRWgLbhot1fADVQkgC0NlXTnWJ+QOgYPiOk5xq3n/sbKTy2ndSsdme+Kmc0ruZDErTs2Kpo5Wg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 192.176.1.74) smtp.rcpttodomain=dpdk.org smtp.mailfrom=ericsson.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=ericsson.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericsson.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=HoiiL041ZD7zWHPl8ZhIrk0lvLo4UFBN0nFr1YTksVI=; b=wZNrVgDFuTZ/cScc0V5Lcs68RSyCX9l/rSmRimkNpKkdrAz3YfmrZ9lw5UW3DPEaID9vXMF2wRknQbaait66E3TU479CdOsDmTy7vxE/NAO/hzyyu2cVzK4da5XCFqvMruMlBJL4SN5NDItivgi4Rg+8boX8fnJKfOA0rhlWvYJx9WhCNE+KhXVuhEmRuKK5CKpvZjVqBzq85AsnZM0MA20t5BImobH3J3wQMVvwf4CwB47ovxcGayJQSiymlTgwQJdUvP1H0m+UCABT+xs1/+GBla4vk/Zcqsp524/9gZC6s3zVMUd2KD6NKZ2E7U//RFDOxyij3b32nVpCArtj9w== Received: from AM0PR02CA0010.eurprd02.prod.outlook.com (2603:10a6:208:3e::23) by AS2PR07MB9025.eurprd07.prod.outlook.com (2603:10a6:20b:555::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7939.23; Tue, 10 Sep 2024 07:13:05 +0000 Received: from AMS0EPF0000019E.eurprd05.prod.outlook.com (2603:10a6:208:3e:cafe::2c) by AM0PR02CA0010.outlook.office365.com (2603:10a6:208:3e::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7939.23 via Frontend Transport; Tue, 10 Sep 2024 07:13:05 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 192.176.1.74) smtp.mailfrom=ericsson.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=ericsson.com; Received-SPF: Pass (protection.outlook.com: domain of ericsson.com designates 192.176.1.74 as permitted sender) receiver=protection.outlook.com; client-ip=192.176.1.74; helo=oa.msg.ericsson.com; pr=C Received: from oa.msg.ericsson.com (192.176.1.74) by AMS0EPF0000019E.mail.protection.outlook.com (10.167.16.250) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.13 via Frontend Transport; Tue, 10 Sep 2024 07:13:05 +0000 Received: from seliicinfr00049.seli.gic.ericsson.se (153.88.142.248) by smtp-central.internal.ericsson.com (100.87.178.66) with Microsoft SMTP Server id 15.2.1544.11; Tue, 10 Sep 2024 09:13:05 +0200 Received: from breslau.. (seliicwb00002.seli.gic.ericsson.se [10.156.25.100]) by seliicinfr00049.seli.gic.ericsson.se (Postfix) with ESMTP id 5D28A380061; Tue, 10 Sep 2024 09:13:05 +0200 (CEST) From: =?UTF-8?q?Mattias=20R=C3=B6nnblom?= To: CC: , =?UTF-8?q?Morten=20Br=C3=B8rup?= , Stephen Hemminger , Konstantin Ananyev , David Marchand , =?UTF-8?q?Mattias=20R=C3=B6nnblom?= Subject: [PATCH 0/6] Lcore variables Date: Tue, 10 Sep 2024 09:03:38 +0200 Message-ID: <20240910070344.699183-1-mattias.ronnblom@ericsson.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240506082721.120666-2-mattias.ronnblom@ericsson.com> References: <20240506082721.120666-2-mattias.ronnblom@ericsson.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AMS0EPF0000019E:EE_|AS2PR07MB9025:EE_ X-MS-Office365-Filtering-Correlation-Id: 0e73a6f7-d739-48a8-3901-08dcd168044e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700013|82310400026|376014|1800799024; X-Microsoft-Antispam-Message-Info: =?utf-8?B?WnFkVy9YMEVBRmlrVHNOK21VamJkQnBvSTk4K1FtYnhOdHJJa2pTZTVZQ3lX?= =?utf-8?B?VWlkTUtKSWJNTW1tSzZhcW1TYWYrc005QkttQjg2VEZwM3dEWTdHVHp3Nm5V?= =?utf-8?B?Z3RNYW40MHJYRUczcXpjY0RteU8zN0dPSzg4cDI3RkN4Y0RXK0h6RUhDcnJw?= =?utf-8?B?TXF4eTNjVzVZVTVJUW1SYzQ1K09zL3ZRLzRCNS9BeXhadXNaa0NEV0d3Q3FD?= =?utf-8?B?MEkvQzNyK1pKMUpia012Q0FlT0ZUcjR1WkJ4MDNFN3Q3czFlbHlDdUNvRUkw?= =?utf-8?B?UitqMlY0eVdPVGZwam11K0hEUE1OdDVHL0JRME50N1RtODR1bTM0YkJISytI?= =?utf-8?B?SitSWVlINVV3TE1UbUFiZ1hDVytXRnlPaXpSN0l0S3lOMnpKVU5hZDdYYnJN?= =?utf-8?B?MmJSbW9zeDBZVC9vWFY4bnJtTE42L3ZpWVU0eDF2T2pUZkk3eEc1aTNzSXZw?= =?utf-8?B?L0N0R2ZhdXRXZXFtdzF4eEpUMGRpdm1adGl5SkxEcHZLS1FrWlBvVkRrLzFo?= =?utf-8?B?eTFUcUVmdW44blJPTm1LZkQrR2xLdE5RYUo4Ylhyc3ExdDQ0TDREcHdUUnU5?= =?utf-8?B?dlo5OVA0NWsrSDF2UEhCczJVcXlzZlRjaHR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TOG5VanUvT25KL2xyV2hjbFlvNW9xRTdMTFF5Q2k2MkF6bmw4?= =?utf-8?B?eVNxVkhZazMrd2UzR01HTmhWQUlld0NSTHlyd3FhYUE5ckRYQWxhWDBvSm9W?= =?utf-8?B?VnBTM2JYZHF2c0FFWFZqcTN1QVRHUUtjK1A1c2xocUpSSCtWVGllN2ZBQmNx?= =?utf-8?B?NVNWT2dYZzR5RmRZUXk2Z2NaUzRod2h1dStmTzcyUWJ5KzExYm5DWXNPMU1I?= =?utf-8?B?M3BDVGhFTkZjT3VmKzBLSkJQSGwyMU40V2JITGNETXRQK29ONDZCL2dpd0Rl?= =?utf-8?B?dFpsbmRPdnV2cjVTbXZrZkFISzlJOFNoQmhydGVqU0JybzdsZ0l1TzRFeXVo?= =?utf-8?B?UXhTWkNocFlkMEdiWURQZkhpTHhOZG9rVW8yZGcxMXg2OThWK0drSWR1azVG?= =?utf-8?Q?hhIJiKHLNwCXq19Re6LmsF+PXBs6FqsE?= X-Forefront-Antispam-Report: CIP:192.176.1.74; CTRY:SE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:oa.msg.ericsson.com; PTR:office365.se.ericsson.net; CAT:NONE; SFS:(13230040)(36860700013)(82310400026)(376014)(1800799024); DIR:OUT; SFP:1101; X-OriginatorOrg: ericsson.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Sep 2024 07:13:05.8182 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0e73a6f7-d739-48a8-3901-08dcd168044e X-MS-Exchange-CrossTenant-Id: 92e84ceb-fbfd-47ab-be52-080c6b87953f X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=92e84ceb-fbfd-47ab-be52-080c6b87953f; Ip=[192.176.1.74]; Helo=[oa.msg.ericsson.com] X-MS-Exchange-CrossTenant-AuthSource: AMS0EPF0000019E.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR07MB9025 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 This patch set introduces a new API for static per-lcore id data allocation. Please refer to the API documentation for both a rationale for this new API, and a comparison to the alternatives available. The adoption of this API would affect many different DPDK modules, but the author updated only a few, mostly to serve as examples in this RFC, and to iron out some, but surely not all, wrinkles in the API. The question on how to best allocate static per-lcore memory has been up several times on the dev mailing list, for example in the thread on "random: use per lcore state" RFC by Stephen Hemminger. Lcore variables are surely not the answer to all your per-lcore-data needs, since it only allows for more-or-less static allocation. In the author's opinion, it does however provide a reasonably simple and clean and seemingly very much performant solution to a real problem. Mattias Rönnblom (6): eal: add static per-lcore memory allocation facility eal: add lcore variable test suite random: keep PRNG state in lcore variable power: keep per-lcore state in lcore variable service: keep per-lcore state in lcore variable eal: keep per-lcore power intrinsics state in lcore variable MAINTAINERS | 6 + app/test/meson.build | 1 + app/test/test_lcore_var.c | 432 +++++++++++++++++++++++++ config/rte_config.h | 1 + doc/api/doxy-api-index.md | 1 + doc/guides/rel_notes/release_24_11.rst | 14 + lib/eal/common/eal_common_lcore_var.c | 69 ++++ lib/eal/common/meson.build | 1 + lib/eal/common/rte_random.c | 28 +- lib/eal/common/rte_service.c | 115 ++++--- lib/eal/include/meson.build | 1 + lib/eal/include/rte_lcore_var.h | 384 ++++++++++++++++++++++ lib/eal/version.map | 3 + lib/eal/x86/rte_power_intrinsics.c | 17 +- lib/power/rte_power_pmd_mgmt.c | 34 +- 15 files changed, 1020 insertions(+), 87 deletions(-) create mode 100644 app/test/test_lcore_var.c create mode 100644 lib/eal/common/eal_common_lcore_var.c create mode 100644 lib/eal/include/rte_lcore_var.h -- 2.34.1