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 EFE8F45B04; Thu, 10 Oct 2024 16:23:20 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D28684068E; Thu, 10 Oct 2024 16:23:06 +0200 (CEST) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2081.outbound.protection.outlook.com [40.107.21.81]) by mails.dpdk.org (Postfix) with ESMTP id 0A7E7402F1 for ; Thu, 10 Oct 2024 16:23:03 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=LSPTWtRSZTpJ64dCwb0Npqvux42BR81xIK0DmpNbY1ARifjnj15hP3dXGKvvlER8nalYPaGEWVidwhfqUeQa58q0T/b1E3t3d6ds7ySx5TcJd2BOZlp/+upJx4BwSOKSCIKLP7qelylamf5OzT5U9w676xqiK5KvZnM6g5vSpWEj9TBDQEqs/RIZQvcArHXPZmCkWYbEd+wVOOH7RWwgmix2qN+NpwA9PKXLVzXllde4JrIPSvf+0Jy4Eg6RvCqK3xDPLDaa6g95acBltrEh9S0O0M7sHLMsniuP0zVr65SbumxFIbUOhRH/ttv0YWKgk01SLAoy94Qheem6hYJsPQ== 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=aYIRpYULmU4ix969csje7C2aKHVWGN+7GNPuMSOI5vK6aOi3bqWy0mfyMtSBnLkYYEHcqc8EzNSOcQH7Ihg2DtNBuVb22w1DU9DGmgGWz2bmGuHKdAweMx2BgJkpCoJXl/WqiFBZhXGX+EHEqZTx/buQhueMU5iXXDAbM3ipAkK/ck/xi6Yr7l0BFeJOrr2pKFh+5xmC3RhuCU32RhkBFMPZSQW/+vKks+YF+EsxbbgO2ktoZznH0Qluu1tWf+aWUveWIs8406y30zGJxq8kVbCNS5/uquWpP6SOlpJ6NcM1BpVjr/54J8tW60QbB/tjqrquADnkICw3sqGRPUJ8YA== 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=afOHOowONT0vvXHInsWsqUiGU1I7ALISI6CIgQckW+YaHAp3c110SCobJlyH3cu6TXOgyOjWotPzWaBHwpC5VQYGioNUC3Ev8IGvdwqISkwDYrI9NYvyHeGWsJkqlpWfrSqGFA2Dt+9nx7UJa07CUu3vtFN7n9qCEFmCNWlxc2UJoodLsvfhvmtG6WPI2FePOSgRXtP1y8HFRVIV/xqs3XrnSW3ZJp2CrAuTbEfIOB7zGs/4jciu9JkVWQ5Duv8LX01Y8M2pA8kAHY8NSY52wlWqfbhraMRvA33Wc1wFXTkV2MvlqqS5Mf1FVdE7oOuuHAY5HzdRqIk5ORpGZAQBwg== Received: from AS9PR0301CA0034.eurprd03.prod.outlook.com (2603:10a6:20b:469::23) by AM7PR07MB6392.eurprd07.prod.outlook.com (2603:10a6:20b:13a::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.18; Thu, 10 Oct 2024 14:22:59 +0000 Received: from AMS1EPF00000046.eurprd04.prod.outlook.com (2603:10a6:20b:469:cafe::4d) by AS9PR0301CA0034.outlook.office365.com (2603:10a6:20b:469::23) 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:22:59 +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 AMS1EPF00000046.mail.protection.outlook.com (10.167.16.43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.13 via Frontend Transport; Thu, 10 Oct 2024 14:22:59 +0000 Received: from seliicinfr00049.seli.gic.ericsson.se (153.88.142.248) by smtp-central.internal.ericsson.com (100.87.178.60) with Microsoft SMTP Server id 15.2.1544.11; Thu, 10 Oct 2024 16:22:58 +0200 Received: from breslau.. (seliicwb00002.seli.gic.ericsson.se [10.156.25.100]) by seliicinfr00049.seli.gic.ericsson.se (Postfix) with ESMTP id 8F6F8380070; Thu, 10 Oct 2024 16:22:58 +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 v8 0/7] Lcore variables Date: Thu, 10 Oct 2024 16:13:42 +0200 Message-ID: <20241010141349.813088-1-mattias.ronnblom@ericsson.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240918082614.725220-2-mattias.ronnblom@ericsson.com> References: <20240918082614.725220-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: AMS1EPF00000046:EE_|AM7PR07MB6392:EE_ X-MS-Office365-Filtering-Correlation-Id: 02f9392f-405d-45ff-66d1-08dce9370aaf X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|36860700013|82310400026|376014; X-Microsoft-Antispam-Message-Info: =?utf-8?B?MEdHdEhqVW5VdDJvbkp3cWpoTUN4WnNuNlNSSTRteitxeW9oemZtd3FCNVQ4?= =?utf-8?B?YTNnNUFRVjFselB5MWJTYktqaVl3QSthN0JlNkoxOUgrR3RHcmltaG43Mm12?= =?utf-8?B?YitwYmNPR081Z2d2OEhWQXZFamJScjY2dzh6OXovUXRhTXl6SzdqQUxxS3VC?= =?utf-8?B?aCtVZGgrSzNCL3dDbUdxVFNNZ1hPbWx1TFl6V29DUmJUV1luTlNIZlBqODBi?= =?utf-8?B?UFJNS1plUXorSjY3U2VOOTU0bm5DQm5ja3NkYThhdGl6K0w4YUNZaGpoQ0pJ?= =?utf-8?B?VmlMYkU2U2hMWTVVeDQ5Zm9idGJOaGlldWJmbTlDRkt1YS80djdXc2N0OEVz?= =?utf-8?B?WUtHUjQwSS8wSS8vNk9TaFlSdVIveWVBaTVLbFNxcEVwK0xlQTk1alI1WVZD?= =?utf-8?B?UHc2ckRHK29WOUdab1JobUxpN0xaWUV6NWM1R2hvOS84TUZOOXRJdUNoNDNE?= =?utf-8?B?TCtYQjlaY2xEOVFsNEtoK1FKSnlkd2ExblZ0c2t3WTY5dnZ5c1J1WGI3TkNv?= =?utf-8?B?NDR0SWw1K2d1WXVmbE1lUTdxY2lHK3Z3cXFXQS9UcUJQU3BhQU9qMzZuakU1?= =?utf-8?B?OTM0M2NMdSs2SG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?B?YU9NQnhWNE5BK0dHSjhjb3NRUEJtRW1kSk90K21TRFlZTkg0MmFoVzFHVk9j?= =?utf-8?B?QUxjRWdiRFkyeG1OMHNGUW82THQvUnJjaXZPYXFYaEFsYnFWWmRhRy9sT0ZQ?= =?utf-8?B?UllGQkV4bk9yUFJvczhlLzNPdUpBVjh5cDZEVkFPTzRXMENwczNCQzdDMWFW?= =?utf-8?B?akRCdnJUMGROakp4aWx2V3kxY2RlRFV5RHRJeFNDb2kyVkE1K09nZmhWOStL?= =?utf-8?B?RjFwVllhYzVyb3ZDNExwQzhEMi8wSXhGeWkxOHFyejBlOWpvWlJ6QVJwdklq?= =?utf-8?B?SHZBTUd2SUdXa0ZtTVlhQVRlVVpRYXpheHY0cVVhdkdjMFJMNnA5TTVGWGNk?= =?utf-8?Q?CzEoDmUWXwwUr?= 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)(36860700013)(82310400026)(376014); DIR:OUT; SFP:1101; X-OriginatorOrg: ericsson.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Oct 2024 14:22:59.1039 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 02f9392f-405d-45ff-66d1-08dce9370aaf 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: AMS1EPF00000046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR07MB6392 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