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 1751F459C6; Wed, 18 Sep 2024 10:36:53 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 53ECA42FC5; Wed, 18 Sep 2024 10:36:00 +0200 (CEST) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2074.outbound.protection.outlook.com [40.107.20.74]) by mails.dpdk.org (Postfix) with ESMTP id E5F2042F7F for ; Wed, 18 Sep 2024 10:35:55 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=xjkogbGQAtod+6L0Zs609C1Q5hlZbBvka+TaQZhSNuzfIzRVdk1GZzMbQumr99jQy5qHf8NmYqFT//VhLESddT7AkT4+ngeCwHwxIQTwkazrY0qg5P2n4AdbR8nv8GbmWPk2VadqhDoeZhxIOfNZpkydP7TH/Vu4/5HxAhyWB+QBuDHXObmLy6mA/9xNcdxIW/ts1p3QzFcZk123pGQTc0Me/IA5FJBCIit2z6J/Qqwqhomk0pSYSHwaFdmLIB5zhNSsljpicCvAVK0CcEUpn92QLOs8JOQB1kyOv3dNw5N4DMXsrDASp/kkDjlrdih4vUBievL1nfYXFqObPKgfDQ== 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=ra9cMC45EIAofcmj/IL5klOOTeNQ27KIGOfGdhBBVkw=; b=pvsF4hzBMeptSDFrwXqkHW8mjciOpnPD6AFviIKQAp9lWSIhZwrD4IE4N4bqiBpj7p8hf8jD6M1CPEbQZhh7U4wADWb2ZShwgJAt0XKFVZAzGAxKgBEKHSxXHmoX4Z9+c34gprIZvn19TYKiKoK8mxxPokcvv+fnS2iCUoazY7PPDs280g1tVnTOy39nw6KRGxIJ2h261tJQUglFPJjPyptbi4ifnHhgJWKnoDj0rIgHJi9zNrMMDo6JL6YjqvVHK9Ve6NYwQ8us+UCnq/i2+co1ZAqGOxIFnTg24ZZeXe10sPnaumodniz6eVKkOpSqBAps5x6QeeITS1HmPkVqQg== 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=ra9cMC45EIAofcmj/IL5klOOTeNQ27KIGOfGdhBBVkw=; b=QhW2t0aa3OlohUlq9WQOqu/6h9qwGJujiZcTNzmt0pRMqIhTJH8fVMhk8unDCOdaplKPL8zsUpEZeL8p2r6INXb1fxL+N5UPbcoZVmcKNwWlTVCw90+1aNsCDAnDaBMR+D3yk9w7m54laVvE9Vkk3bm/34c/65z5cijExZHbyRFL+mrJ2PCXn4+Wk7zbfAyaY3zpjZCSB6DeaNzqlK0I+OzRxgEjmQAH5slD1KBawAVVkl79r7Gkb3AkAUGt1SkxjfN6fHrAqdR2z5FCitcnBVwSSZ+Ie0aWQJg/6ZZmp/IU8YBc8reQZA8ceZwo/ZC1N2ta6r2bdQA8+bxUk0FJrQ== Received: from VI1P194CA0033.EURP194.PROD.OUTLOOK.COM (2603:10a6:803:3c::22) by AM0PR07MB6322.eurprd07.prod.outlook.com (2603:10a6:20b:159::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7962.18; Wed, 18 Sep 2024 08:35:42 +0000 Received: from AM4PEPF00025F9C.EURPRD83.prod.outlook.com (2603:10a6:803:3c:cafe::36) by VI1P194CA0033.outlook.office365.com (2603:10a6:803:3c::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7962.25 via Frontend Transport; Wed, 18 Sep 2024 08:35:42 +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 AM4PEPF00025F9C.mail.protection.outlook.com (10.167.16.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8005.1 via Frontend Transport; Wed, 18 Sep 2024 08:35:40 +0000 Received: from seliicinfr00049.seli.gic.ericsson.se (153.88.142.248) by smtp-central.internal.ericsson.com (100.87.178.64) with Microsoft SMTP Server id 15.2.1544.11; Wed, 18 Sep 2024 10:35:40 +0200 Received: from breslau.. (seliicwb00002.seli.gic.ericsson.se [10.156.25.100]) by seliicinfr00049.seli.gic.ericsson.se (Postfix) with ESMTP id 3AED6380061; Wed, 18 Sep 2024 10:35:40 +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 , =?UTF-8?q?Mattias=20R=C3=B6nnblom?= Subject: [PATCH v7 0/7] Lcore variables Date: Wed, 18 Sep 2024 10:26:07 +0200 Message-ID: <20240918082614.725220-1-mattias.ronnblom@ericsson.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240918080054.725164-2-mattias.ronnblom@ericsson.com> References: <20240918080054.725164-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: AM4PEPF00025F9C:EE_|AM0PR07MB6322:EE_ X-MS-Office365-Filtering-Correlation-Id: abcdf1b0-d23b-428e-0bae-08dcd7bce104 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700013|1800799024|376014|82310400026; X-Microsoft-Antispam-Message-Info: =?utf-8?B?aWlsb3YxZHpuWXVBR0xJbzJaRm9rdElXcXREZEZRWGNHbUhlMmJ6N0pQWUxN?= =?utf-8?B?dENlSVVmSncvZlZha0Q0VDJPby9SYjhQVXdONURRYmx2dGt0bVpVVm10MDhV?= =?utf-8?B?S3lKNHpjWWFJcVh3ZWRScHAwL3pqUlVyZW5LWXRvR21sbW9NRk5obWVyQU5a?= =?utf-8?B?amJla0czV0Z1UUdNWi9MWmlNNDl1cDlSZUxZUEdrVDdvWE8yRGZiU0k0bTFO?= =?utf-8?B?UVJUNlByUW0zM0NhaUM5dHZOQ3RRVDhRZzFhYTJWaWlwVHVLV0lCM0JvcEtv?= =?utf-8?B?NHB4L2FkcW1uUGlnN1hrUWFhT2VpbnFEV1NyMGJrandTZU5YbUtUL2xVSVRl?= =?utf-8?B?cmVtVzV1REEzdnJrWGNIanhVeTdIUnhRMk1iK2U2ajRCOEFVVm5MbFRxcktt?= =?utf-8?B?Ym44TDBab21KcnkyQVc5VHVuVEdXUjc4M2R5bEVIQWhna3AyeGRNMEdIL3Fo?= =?utf-8?B?ZCtxeUt2eHhKMEpYSlBpSXJsS2x5UG5hRVgzRlFyNFBDTzh6eVdOak1wVytz?= =?utf-8?B?RWNLdlp0NW5jZTlBUTZUY2V5ZzJpVWk4T1lmTEF0ajNTaXpWanRnRGJ6MHVX?= =?utf-8?B?SEpnOXVQc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?WlpEaEt3UVlabE9tK2k1RllPUDFYMjhWS29pL25KNUl2SUVza1c4Mmd6emlo?= =?utf-8?B?SUVnT2RJYk9MeThkODRQTm1KOTlrdHVrV1RIdUhwb2drQ0tySlN1ZjFnbU0w?= =?utf-8?B?eUE4Ty9mZGk1N29sTHJHSXVYSGlNNEJ0UDk3SjJGdTNINlhjT29ldWZRenJW?= =?utf-8?B?UWMwT0x6V0FvMi9lVmYvZkRFVjZwTnZpR3dPSmdJRnlHcVNyYkFUc1BUSGlr?= =?utf-8?B?MEU4SkZBN2JVVk1tOXRTS2hmNjJvL2NQTEhSM1hlSFFYL1lBNk82THdLRUdK?= =?utf-8?B?QUpGTUZEZjc1SUVHRkVwb3ZKTEhWTmJhajR3ZFQ4WlJmMXVxSHNpeXFranJk?= =?utf-8?Q?5+W36x9bEFc6i?= 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)(1800799024)(376014)(82310400026); DIR:OUT; SFP:1101; X-OriginatorOrg: ericsson.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Sep 2024 08:35:40.8261 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: abcdf1b0-d23b-428e-0bae-08dcd7bce104 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: AM4PEPF00025F9C.EURPRD83.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR07MB6322 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 | 79 ++++ 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, 1339 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.34.1