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 6DAD645B34; Mon, 14 Oct 2024 09:53:05 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DCCD5402DE; Mon, 14 Oct 2024 09:53:00 +0200 (CEST) Received: from EUR02-VI1-obe.outbound.protection.outlook.com (mail-vi1eur02on2045.outbound.protection.outlook.com [40.107.241.45]) by mails.dpdk.org (Postfix) with ESMTP id 6F41040151 for ; Mon, 14 Oct 2024 09:52:58 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=VZOisgin6D6JkD1UZIEB6qb7a3HSjIc0aOEfI9cDYlwwoYLwx8tSGjsQvxAnVN1wuQx83WelsT7BFNUreYX5IJhujHbETyRRniV+6VFXqvEJQfec2XrDz+k8PadaXiJ0VdhDX0I0eWM7mIXomGjSxn3b/XtXE6NhNI2oVe6XoyCtCmo02LI+fmz2h+WW+nNmT9SBkez/zLs/AZthL6xMPEAxk7/ibxjCdYuQxB7C9gKIdoEVqUyukG1xaZj9IvUOzTPExsp9TfrXLUG8WzhktoZVdV5bqwkhTI4pFVejrxf9OjGyzcCqfKYta5uZWWaE5uiXMzOF54LQO6CFwJMCOQ== 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=d0by6lmpzlEIxbkKPSFQjfOD7bHVGUsH0W5JNMcpVyQ=; b=wq7JfPFjzjdE8GEHMrqcOdX/mK0LRQU0h/W2Oz8beApqCX1RH5cbsI8yjeDHUOPcYtZloruGgDxRDi3wLXCtPdncH/Uc/SFoNU2VSoQO43XRRFzDvd8rs9526sYGtf4RE/3nRdgrAPVdQAaEhyDCVNzqumOz38XpS+tVU6Gs+NjfaQhDaV1Gri9IR8Y2lBEAQrhmy2Hdw/gqlTnhSdakAYD3fJhtLmldTZlD299xY+PCaRd7msoi0e4cbq2xkaMZZx/iTz2LxXsEjLxmTa0eycipcXMO6NpC8gh0Z+5r30RjgBtyGsA96hhLRqijTJ6CeAc7ErRbbLbo9ESzDQvq5w== 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=d0by6lmpzlEIxbkKPSFQjfOD7bHVGUsH0W5JNMcpVyQ=; b=yNDeqkfW0QtAGVJWjPozQVxk2D+BOPxFDCCl0NH/zBe07H+sHKuoMRmhWN0Lus5mMEu5cSx4C0zx24OBPc3wwWgf24N2ZYQVQNiM3cRbBtRy+nsL/wgEodbTgQ6hx8kwlua/KLEX0eAebY72YbeQHr5IRnFp2A3PiS/xEolPE3XhOEPfpTegx+EAp2amJHKJ2eMsb0yD1DtEMxh8kSpUmZgShZuaSFwdSOOBp22b6oVGcaEV++CmMvC2LmAY6yoHvIXM4h4wXVL6rkDhPd094Rl09vjeChaAinSEWd2cDLK9Gi2eQCMsc3/kjkiIQo5FYPZrWMiDlr6iI5P+bvQbXQ== Received: from DU2PR04CA0162.eurprd04.prod.outlook.com (2603:10a6:10:2b0::17) by DBAPR07MB6581.eurprd07.prod.outlook.com (2603:10a6:10:188::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.26; Mon, 14 Oct 2024 07:52:55 +0000 Received: from DB1PEPF000509E6.eurprd03.prod.outlook.com (2603:10a6:10:2b0:cafe::67) by DU2PR04CA0162.outlook.office365.com (2603:10a6:10:2b0::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.26 via Frontend Transport; Mon, 14 Oct 2024 07:52:54 +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 DB1PEPF000509E6.mail.protection.outlook.com (10.167.242.56) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.13 via Frontend Transport; Mon, 14 Oct 2024 07:52:54 +0000 Received: from seliicinfr00050.seli.gic.ericsson.se (153.88.142.248) by smtp-central.internal.ericsson.com (100.87.178.67) with Microsoft SMTP Server id 15.2.1544.11; Mon, 14 Oct 2024 09:52:54 +0200 Received: from breslau.. (seliicwb00002.seli.gic.ericsson.se [10.156.25.100]) by seliicinfr00050.seli.gic.ericsson.se (Postfix) with ESMTP id 26EEC1C006B; Mon, 14 Oct 2024 09:52:54 +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 v11 0/7] Lcore variables Date: Mon, 14 Oct 2024 09:43:41 +0200 Message-ID: <20241014074348.821962-1-mattias.ronnblom@ericsson.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241011081901.816211-2-mattias.ronnblom@ericsson.com> References: <20241011081901.816211-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: DB1PEPF000509E6:EE_|DBAPR07MB6581:EE_ X-MS-Office365-Filtering-Correlation-Id: 4cc81ac3-e18c-447b-11fe-08dcec253639 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|36860700013|376014|1800799024; X-Microsoft-Antispam-Message-Info: =?utf-8?B?SHVXamJDMFUzSzFoYVlCZmEvOGVDWjRuV3pMbkNmZEU0dTBLRlhnLzVrVEd3?= =?utf-8?B?V3ZCbzQrY20zQkplaGhXTURGcm92YzVwVjBaeXdoYXFKOWp4RGEwR1MzTTVW?= =?utf-8?B?SEg0T0o4eDdyd3B0MDNLMU82UkwzUEV1Z1kvZ2xkMUNMVFlnSTd3MEtRMUxR?= =?utf-8?B?ajdCZjY1YXBOaU5BUmlmelhTYmVwbGFxMncyeFRWazZ6SEJtQVFPZUhubW4x?= =?utf-8?B?ZVF5QzVIakQ5VWV0Y3I5d0Z0RmlyazhIalA4OG9YU1hsT1EwODNub3R4Qk9R?= =?utf-8?B?cVZLMUh4TVJSUUp4alo3VUlLZFMzQm9IbVlOR3l0QWxFUFc4MHdCQURDbW1C?= =?utf-8?B?RVdMR1NGcXNuQmdGRDA3S2Z4VmNvN3lDWWtyYXdRN1lvTGRlbkJEaXlQcWR3?= =?utf-8?B?SXZhOVh4WW0vT2pjNS9kRGdCc2luQjNaYWs0UGE1VWFMVkp4eWJkQ2pMYWRH?= =?utf-8?B?Vy81UDlsc1k3UW9xUGxNM0twOFd3MDdseFdQQ0ZNLzI2NHZFZWkyeHRGY3F2?= =?utf-8?B?WDRBeHdVVUZOK1E4OTJUV3Q5dmUraitFbGVOOGZVMVlNbkhtbjRJV0R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kRsN1Q4aSt3Mmh0clFwSkZzYWk2?= =?utf-8?B?cmVaOXFDa2JmZGY2MzNDbWkvTXpUTXhlNkx0RFlPcXYwUjZKTmtGSXJWNlZa?= =?utf-8?B?VkdYRlU2REhMZVU3NlVrU0ozSWpWZTFhMXkvZGRrS2hhUDhqbWhzZzFEZXRh?= =?utf-8?B?SS9GcFhmU2dIT0J4czBqa1VqTy9VcWFyWG1aQXMyc3BoVUZVeG1OS0o1MGZD?= =?utf-8?B?TzlRd2xNK3VrallPYVBqKzY5NEtvV254OE1UdTF3WVY0N3MzRWQwbVF0K2hJ?= =?utf-8?B?cVg1Q3N5ZmhvcFZwVnQyamNrdDAyek9WYXAyaVd4cmdMOHJzMUJaZ0JjRlBX?= =?utf-8?B?dUR4MnlDcUM2RzBnNVVyRVhhMUpPY1g0Tkp3Ly9kNGV4aUVtTEI2NXdHOHRX?= =?utf-8?Q?8RjyyeNzgGOsn?= 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)(82310400026)(36860700013)(376014)(1800799024); DIR:OUT; SFP:1101; X-OriginatorOrg: ericsson.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Oct 2024 07:52:54.6641 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4cc81ac3-e18c-447b-11fe-08dcec253639 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: DB1PEPF000509E6.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR07MB6581 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 | 43 +- doc/guides/rel_notes/release_24_11.rst | 14 + lib/eal/common/eal_common_lcore_var.c | 136 ++++++ lib/eal/common/eal_lcore_var.h | 11 + lib/eal/common/meson.build | 1 + lib/eal/common/rte_random.c | 28 +- lib/eal/common/rte_service.c | 117 ++--- lib/eal/freebsd/eal.c | 2 + lib/eal/include/meson.build | 1 + lib/eal/include/rte_lcore_var.h | 391 ++++++++++++++++ lib/eal/linux/eal.c | 2 + lib/eal/version.map | 3 + lib/eal/x86/rte_power_intrinsics.c | 17 +- lib/power/rte_power_pmd_mgmt.c | 35 +- 20 files changed, 1411 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/common/eal_lcore_var.h create mode 100644 lib/eal/include/rte_lcore_var.h -- 2.43.0