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 7DDAE45B40; Tue, 15 Oct 2024 09:04:16 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F0695402A1; Tue, 15 Oct 2024 09:04:15 +0200 (CEST) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2055.outbound.protection.outlook.com [40.107.22.55]) by mails.dpdk.org (Postfix) with ESMTP id 149334027C for ; Tue, 15 Oct 2024 09:04:15 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=uqeN4lv2DscEFrFViJ2y07o+xpmQc0Pgrqm8YszymWXQgXPlw9oKLkIFnSb6K194h9zmny0VdpSlifx6Pm2ths9vwzieANarFDpGJMGwv5N2ZIDlhqkNNAusUwD6eEVvszN17PLXolRUZKkw1jjrLNbfjkJyCuFAAEbQfrjBH+60RqY4BWUiA4gAPHXkpGjs9rlXHW01BbbclXt+oT4pS8lCDts/MiVGxZhXRXCeRwqoJY/n1dh3Uwgfs76I8AU6vmMkyg2gyp+g6E/+OaUMAPhcdxzNooqG8cldsdnlJNp5z2K4SPqrS+YI79iXyKWpTI09FugKTT9I5nHnd+gTMg== 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=KFF6B8vmcwgEsYwNKe95PYqHgASKPIes68Xs+S24ugA=; b=gaNWR9b6pQAVskoETIzZQQ2SFyyJhwWp3T2DOOS0i8Ui3945fwxApAHB2BsWE5pIsKxHrWODakJK1UjfHlFIpXO0geWmpegO3BXvFRniMhyMswINRFWywotA7WSRujsGYhPw12IJJNExhM38m0QIAu7NlQt5X1axl0lSmbcV2lFNRFRCt9kcKu44NxapKyt22rddS1Bv6FaJ5ULPFwp+AIzLgZiCo9cldTcH7jwqhYYnxmpmbnuJkTMHGOeLJwhzaEmhR4LCZtD635O110AfRmKZ8CcmE7JeFD8jpcwfdHgjwrE3WJQK8z75wGpKASsavheICI+MqQBrnnbimURnWw== 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=KFF6B8vmcwgEsYwNKe95PYqHgASKPIes68Xs+S24ugA=; b=EjaEDRMx5M6ZgvN0oD8EuIn8waGyqN202cGQ3JEP63oPmEhPKGX97RqWdkJJWm5BWXA9+f8OfNu9C/w7ShHB+s5aHiJrQq+WP1hyuBEq+xE0259uWEZteLp/Vatr5MqdnmxcmFZg4KyMlQ9AW/YG1VOcXcL4grK9fIkSyJMgtmjGVfrxDP+W+mX5s/YIiG4OFH9ZiFNA0cXRWIzeSO2jOlk7mX1HFRvcQ+Yp8vOeeSESeA82GfHy9e7T65mnCb1GJ5KgAPWptMx1/Z59umtfq28X1ys0dJ04/MU1wG8AVyxRp7uJbgkpokpr4M+HFmM801s0pCyl09aLlahJ1qeYOw== Received: from DUZPR01CA0196.eurprd01.prod.exchangelabs.com (2603:10a6:10:4b6::23) by AM9PR07MB7313.eurprd07.prod.outlook.com (2603:10a6:20b:2c6::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.27; Tue, 15 Oct 2024 07:04:12 +0000 Received: from DB1PEPF000509EC.eurprd03.prod.outlook.com (2603:10a6:10:4b6:cafe::81) by DUZPR01CA0196.outlook.office365.com (2603:10a6:10:4b6::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.27 via Frontend Transport; Tue, 15 Oct 2024 07:04:12 +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 DB1PEPF000509EC.mail.protection.outlook.com (10.167.242.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.17 via Frontend Transport; Tue, 15 Oct 2024 07:04:11 +0000 Received: from seliicinfr00050.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; Tue, 15 Oct 2024 09:04:11 +0200 Received: from breslau.. (seliicwb00002.seli.gic.ericsson.se [10.156.25.100]) by seliicinfr00050.seli.gic.ericsson.se (Postfix) with ESMTP id 2D2121C006B; Tue, 15 Oct 2024 09:04: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 v12 0/7] Lcore variables Date: Tue, 15 Oct 2024 08:54:58 +0200 Message-ID: <20241015065505.823840-1-mattias.ronnblom@ericsson.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241014074348.821962-2-mattias.ronnblom@ericsson.com> References: <20241014074348.821962-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: DB1PEPF000509EC:EE_|AM9PR07MB7313:EE_ X-MS-Office365-Filtering-Correlation-Id: 7a00a448-2924-4b3e-4257-08dcece79267 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|1800799024|376014|36860700013; X-Microsoft-Antispam-Message-Info: =?utf-8?B?MEJTMkxFL0YwWDlKSzdiSktCTDRmT1BTMit0eW1EdHhvVWt1L2VaeDJ3dFRN?= =?utf-8?B?M0ZrcjVLcWd1VDNZMGhUNHE1RmVRY0czWU54V3BKbFVVUEVoMFpDdmdkcG9X?= =?utf-8?B?VGZ4OWNTeDRLM2xnS296YTBTbDNna3lEeklIUUxpMUM2bVBaWTl4R2MvUDRG?= =?utf-8?B?K0tIY3pad0JPUm84Y1RVbEgrUkJYcGVQSGV1TUhXL0RZRXluZ0VRd0NHek96?= =?utf-8?B?WHZESnRSSmZlUjB3VFFWZmdqd2ZSMXc0S3VjVEJnYTJCYWhlamhEbkRvMlNr?= =?utf-8?B?VlFoMC9QcS9DcW5aOG9Nd21LU3VDWEVEQ3VSTnZJUVRBWE44cGhBb3JkYnpX?= =?utf-8?B?QmlOa3pSc2s0UDFxd2Z6cmFNR3VKa2pHaTFaeHU3dnRYTDg3NFBXNyttOFFq?= =?utf-8?B?QjlYOGlIZ1BhcmxiZ1hwaU4xcS91azJ6SGVKRDJBWWc1WE5MSkdMbWhPVHQy?= =?utf-8?B?OTNFL2ZmVDVtQWEvMHoyQVRPVGdFamx0bCtyOUZpZlhXbFBpVDJDenhqTmpE?= =?utf-8?B?WjM2UE9Velh6S1lSZGZvQzBuM3pTQ3N2Mys0NzdRTFFOMWFBM3ZXWlptRkU0?= =?utf-8?B?WFJHV0tVaCtXc1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k4Yk5X?= =?utf-8?B?ckU2OVVtcUpPd3RYOWJqWVB3R0REeGRwWGg2WHUrRkx5OTBtQ2FqNnR1OFZX?= =?utf-8?B?OEg1N3pxb0hlM3N0K3VvV0RQY2JGeVNQSTIyT2ppWUdWbGVPQ2NESmpUTEc4?= =?utf-8?B?YTNYMk5xNVp4eXBrYjR3S0JNRFdGVjdxSWdIeVRjNExYVUVSNFdKQzdLTnFp?= =?utf-8?B?SkU0RjNGcWFNM0ZYdHRGZzNiUjEzVHdnSFVsa3pha3laVWJ4OHhlM3FwYXBL?= =?utf-8?B?Q0FmeGd4N3loMHNRS29pVHpGMjJMOGRSQktGbjZyVTlWa1FaeEdYcG9sZ0Nz?= =?utf-8?B?TlQ3SFNUR3JmMTh2Q2JKVlpqeHNncitIenFXZEQrM1c4T3p6WlJNbG0vTklZ?= =?utf-8?Q?qFaLedT9QcyzB?= 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)(1800799024)(376014)(36860700013); DIR:OUT; SFP:1101; X-OriginatorOrg: ericsson.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Oct 2024 07:04:11.6827 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7a00a448-2924-4b3e-4257-08dcece79267 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: DB1PEPF000509EC.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR07MB7313 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 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 | 138 ++++++ 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, 1413 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