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 19D2045B04; Thu, 10 Oct 2024 16:31:29 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 245D44066E; Thu, 10 Oct 2024 16:31:19 +0200 (CEST) Received: from EUR02-VI1-obe.outbound.protection.outlook.com (mail-vi1eur02on2062.outbound.protection.outlook.com [40.107.241.62]) by mails.dpdk.org (Postfix) with ESMTP id 3EF5540653 for ; Thu, 10 Oct 2024 16:31:17 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=L81P7WUcqCEGw5r2GKnzuLtVCXMyKgLZUHEcdo59rtQXrnjRpIY9IRi1HkcZIhbFKNaR+Rusw50qkE904RzajQgCsodd0pZItpacOvyZCYJaG3h1+25WpxGtM4RRZK8iAG1VMvghzL0YbLeO0CEDwnuoAFQU59PNszR0Db0ZNecHDh0f7ebxVUpag6llSFWLgObFe+WfYtthDJAEBOuXNSNjLjI02Xy7QpoNXt7NgFNy/gYMaldWrlb1N441Mn9oAbpPZZiOnuzU8/m79PZSHr1i7JfQ2S26wj+2onpQXqTmU/cLsKeIrWcp18bxI+778U9InhptCagH55rQ2Pt/jw== 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=JrYmJ/u7bQ7n6OZw45FE8yC8CnKKyCrrSgczBXDOXq8=; b=lr/TBvucqLL2hTF67HEguDxEetSLwx2HWeDUsSbCSOFWjAE+AETy/K5RgXmTQK0P0zVjCzYuWOZZWnDkcSwk46ywkYsu6VnLZjn7qyZ+rqWyhEyqFo6z4I0ccqooNcrRJaGfrGSt+a6d0nqrxQ+iB3pAmRUvCHxTShxy04GM1p6s6e0CPWB1hMaZapNoZFB3Yu02MIrqlgbAqSf6mfLm4HLzKtdI7VqSsVLcXHgZTsr1OlvTS6YQdsm7+rvw1ZE+vJE4lnWgAQsu/eqR68Y+Rn5aZSkXmFelnRt4+jn6m2zv2wQQpDOPAN708a7aZAKWtq8L6EvRX8PxBEFqvLIp/A== 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=JrYmJ/u7bQ7n6OZw45FE8yC8CnKKyCrrSgczBXDOXq8=; b=n1MXFQdWWdJ0XJIkfoM46LV88+zEFRqtM8THwLb9xDVlIDTm+RDoUTEuVFAUtmUR8FGEkgP4ZqCUD6Ni4EIBnDYyfGdjvtt68146+MBKPG8BJ/E48QAimJcFvDajHB/It89ce21URg3kv5bNFWvasD6uzkoJdcpNOHDSxVpHrCwa1AO/GTbff19v5PjdtUZIM4zZuc+p5dTO43Zq2DOM3MLVn3GMZEXoKNnnwZVHfU9V03Y1/a+Z0MWt38n0nFIWH2TcRYTSK979skIl3UpHDwrL5ieTcT5JWPDC6TcFsKrA7rOAdbLHpBLOz9fawzfX4uMDyuF2xq2OFj52BPPWow== Received: from AS4P192CA0027.EURP192.PROD.OUTLOOK.COM (2603:10a6:20b:5e1::17) by GVXPR07MB9776.eurprd07.prod.outlook.com (2603:10a6:150:114::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.16; Thu, 10 Oct 2024 14:31:13 +0000 Received: from AM2PEPF0001C716.eurprd05.prod.outlook.com (2603:10a6:20b:5e1:cafe::2b) by AS4P192CA0027.outlook.office365.com (2603:10a6:20b:5e1::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.17 via Frontend Transport; Thu, 10 Oct 2024 14:31:13 +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 AM2PEPF0001C716.mail.protection.outlook.com (10.167.16.186) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.13 via Frontend Transport; Thu, 10 Oct 2024 14:31:12 +0000 Received: from seliicinfr00049.seli.gic.ericsson.se (153.88.142.248) by smtp-central.internal.ericsson.com (100.87.178.63) with Microsoft SMTP Server id 15.2.1544.11; Thu, 10 Oct 2024 16:31:11 +0200 Received: from breslau.. (seliicwb00002.seli.gic.ericsson.se [10.156.25.100]) by seliicinfr00049.seli.gic.ericsson.se (Postfix) with ESMTP id CDF6B380070; Thu, 10 Oct 2024 16:31:11 +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 , Jerin Jacob , Luka Jankovic , =?UTF-8?q?Mattias=20R=C3=B6nnblom?= Subject: [PATCH v9 0/7] Lcore variables Date: Thu, 10 Oct 2024 16:21:58 +0200 Message-ID: <20241010142205.813134-1-mattias.ronnblom@ericsson.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241010141349.813088-2-mattias.ronnblom@ericsson.com> References: <20241010141349.813088-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: AM2PEPF0001C716:EE_|GVXPR07MB9776:EE_ X-MS-Office365-Filtering-Correlation-Id: 3bf832c1-44dc-4737-0feb-08dce93830f6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|376014|36860700013|82310400026; X-Microsoft-Antispam-Message-Info: =?utf-8?B?ZGRYLzRzVFFCQ0lGWlVmNGJTeS9CVWJ1aFdNUXlNejNZOWV6K0c1UGZHQXBi?= =?utf-8?B?YzY1aDFuTUREb25PNFZacVJYNWdjL0VWRVRsTjhWVWdCOG5JMzN3T1R0ZitZ?= =?utf-8?B?SHYvR0R0bTNrSk8yRHJYMTlhcmtUWmZmMzI5K3BQZVczU0R5VDZSSjJGYlVq?= =?utf-8?B?TWFqK24wenRzSUY3dU96Ui9MM2pqaW96TnBOeU0xSGVvSnk1WXNzamtSa1py?= =?utf-8?B?azdWUG9OM1h4MlNLVlFyYWc1ajhsTXNjQUpsMjVtU1NkU2MreUFWL2JISVhJ?= =?utf-8?B?V1JkZkt3eWNtNHk2aUg1VU5QTXFSeTFJSDgvbmk3Yyt0bjFuazNMd0lkbzNJ?= =?utf-8?B?Z1dBL0RHaFJ3Unc4RSswNVh5R3FFVElSZXNCaFIxWXFaWjNKVU5tNUhPZFg2?= =?utf-8?B?bk5aUTQwK2F0M1pWY3BmUmlQeGxnWldHKzR3cmkzNXA4UzdUVTdLaXpyYkVo?= =?utf-8?B?bGFwc0piSDg4a0E4T0FBSjVOYWV5RGFHU00xM254dmRrbUxPa3Rhcy9mUmky?= =?utf-8?B?bVIrKzVneXJ0TjZyT0ttdjdKNXJlQlc0YXpXMFNXS2tsUG5qaHg3QkdIa2Jo?= =?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R?= =?utf-8?B?ZFE0SENHVTgvemhsYWNBTkwwMnR0WTB4VE5iVVNQY3FBMWV4SEIrbkZ6U1JE?= =?utf-8?B?ODduakRqU3QzdDFvZmJ3SGsrbTg4UXBlTWVrdWtseTIzOWlDd0lpQ0pCV3Nq?= =?utf-8?B?WSt5MUFyNzlKYldLVW9iTndQVWZzWi9kMEZNdk5TbEs3WVFrMXNlc0lnd1M3?= =?utf-8?B?RkZBV3ZDTS9Xck5LcnJNLyttTC9UU2RITm9MV00rNHVhWkw5RjRvZk15R2Nv?= =?utf-8?B?aUxXV2Q4aU1jZmlFL3l5YlZSNkZBVGpkeVM2MXhOSC9lSndnZEFvSWlmQWpU?= =?utf-8?B?dVZuL1VaUjIzRGhFSlNSUmJ1MDA5QXAyeVcyNW5sRGoveWVjYjFNRTBtTjFB?= =?utf-8?Q?ZWoa0q9Z9YXdT?= 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)(1800799024)(376014)(36860700013)(82310400026); DIR:OUT; SFP:1101; X-OriginatorOrg: ericsson.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Oct 2024 14:31:12.8171 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3bf832c1-44dc-4737-0feb-08dce93830f6 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: AM2PEPF0001C716.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR07MB9776 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 (7): eal: add static per-lcore memory allocation facility eal: add lcore variable functional tests eal: add lcore variable performance test 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 | 2 + app/test/test_lcore_var.c | 436 ++++++++++++++++++ app/test/test_lcore_var_perf.c | 257 +++++++++++ config/rte_config.h | 1 + doc/api/doxy-api-index.md | 1 + .../prog_guide/env_abstraction_layer.rst | 45 +- doc/guides/rel_notes/release_24_11.rst | 14 + lib/eal/common/eal_common_lcore_var.c | 84 ++++ lib/eal/common/meson.build | 1 + lib/eal/common/rte_random.c | 28 +- lib/eal/common/rte_service.c | 117 ++--- lib/eal/include/meson.build | 1 + lib/eal/include/rte_lcore_var.h | 390 ++++++++++++++++ lib/eal/version.map | 2 + lib/eal/x86/rte_power_intrinsics.c | 17 +- lib/power/rte_power_pmd_mgmt.c | 35 +- 17 files changed, 1344 insertions(+), 93 deletions(-) create mode 100644 app/test/test_lcore_var.c create mode 100644 app/test/test_lcore_var_perf.c create mode 100644 lib/eal/common/eal_common_lcore_var.c create mode 100644 lib/eal/include/rte_lcore_var.h -- 2.43.0