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 C82DC459C6; Wed, 18 Sep 2024 10:10:40 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B450342E6F; Wed, 18 Sep 2024 10:10:40 +0200 (CEST) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2067.outbound.protection.outlook.com [40.107.21.67]) by mails.dpdk.org (Postfix) with ESMTP id 2645B4029B for ; Wed, 18 Sep 2024 10:10:39 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=iwx/hN556EnQRqhJ/XskUBMTDqagPJfa9oOQGX5A7YQMC8fu7H09pBxh4MxMBCLt80ugZc1RBEryST5yEi1JB6v3qthaaU03hCK59iniTUevxUq8w9uveis7mU8M/j7/nY4EnB1vuB2wwx9AfOR74n2pIc7DncCJXyWO1t5DjLEGn8MviiYrlT3LtW+ubzI7C8R5r+AChxUbk2XEXCIglFWlj3mxP15R7FDN4kooSLVVP4MBS+T6Qzw1vemcQSeE2ZqnKkJCSgQcUoUznr0BB+L7kMJFm908y+NkmYCHsQf8+D81GCrHZ6b3/liFLTsIRFXjpbaMmEbSwOtdoYKHhQ== 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=BUidoO07CTTSZWNCMEf1/ZoJ3KbyBoOk6H7Z4RXiBQk=; b=oQuVeccZO8UVPMbdslEXQk1j6l6eWQlWtgVWiGhgxjQrAWecl23QxvWXNIkdPs78qg6VZvWXbe2p50NnwUsiU/eacJZ6i0nunNkoF4YNFKuCRfiIVV5Jrb+E6BMOIEDpKQAepuq5Hbf0BF9BJLap0zM5Z0rBfF4dLwTMXi9POQDyXvUyd0TJLvG2IenktuDSh2Sqsv2lDv9o8FFg8tZT2jRNHJ2y4UGnejpwSfmPjk+8+GaTWRZMsj6RndD70+K6zgWAwsv/HOel/jeg9/QRWhyOd1ARfCQoqOVbfKcyVZuZ+1mJ2HXRqRIVtb9WMBrmUbrm9cmIJN0WcUPpDHH9aw== 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=BUidoO07CTTSZWNCMEf1/ZoJ3KbyBoOk6H7Z4RXiBQk=; b=HtbrDjFZsB6BOBRznTbh3//ueaN0SzuvXrLr6INNp7qzpLJteOgDQdmdhDh+VsAZKmp+5p42IR66VwrKIk1OVtcE/QEe4jGr17be5euF6oR0HrZFb59Fcz09uokMvUv9ckWqzgugaRShReCUOku0BVExyPFnav2juKpY74BIMQ+NJihAosjePTeyHKU+76L0s7/Ta+8M8L7MRquoHEfM62MYCgpltMgWS0J/BiRxxgjxc70qrtwRs3O4dfYzH+DpYk9UIZ3q60ZYQRqzxA4h+ennD4X8sdWYfXk+cxCIFUhGtLuAqSawjeE5tE0EDtJmYGA4Fq/Q1jFKjl3JUg0NWw== Received: from AS4P190CA0005.EURP190.PROD.OUTLOOK.COM (2603:10a6:20b:5de::17) by GV1PR07MB8366.eurprd07.prod.outlook.com (2603:10a6:150:21::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7962.23; Wed, 18 Sep 2024 08:10:36 +0000 Received: from AM4PEPF00027A6B.eurprd04.prod.outlook.com (2603:10a6:20b:5de:cafe::cd) by AS4P190CA0005.outlook.office365.com (2603:10a6:20b:5de::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7939.30 via Frontend Transport; Wed, 18 Sep 2024 08:10:36 +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 AM4PEPF00027A6B.mail.protection.outlook.com (10.167.16.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.13 via Frontend Transport; Wed, 18 Sep 2024 08:10:36 +0000 Received: from seliicinfr00050.seli.gic.ericsson.se (153.88.142.248) by smtp-central.internal.ericsson.com (100.87.178.62) with Microsoft SMTP Server id 15.2.1544.11; Wed, 18 Sep 2024 10:10:36 +0200 Received: from breslau.. (seliicwb00002.seli.gic.ericsson.se [10.156.25.100]) by seliicinfr00050.seli.gic.ericsson.se (Postfix) with ESMTP id E7E8D1C006A; Wed, 18 Sep 2024 10:10:35 +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 v6 0/7] Lcore variables Date: Wed, 18 Sep 2024 10:00:47 +0200 Message-ID: <20240918080054.725164-1-mattias.ronnblom@ericsson.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240917143239.724069-2-mattias.ronnblom@ericsson.com> References: <20240917143239.724069-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: AM4PEPF00027A6B:EE_|GV1PR07MB8366:EE_ X-MS-Office365-Filtering-Correlation-Id: 229b67f5-8a86-4b24-4178-08dcd7b9607d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700013|1800799024|82310400026|376014; X-Microsoft-Antispam-Message-Info: =?utf-8?B?TCtpd3Q4QVNyUXN6NVZ0NmNSa3NTVWRTU1dtTDRuZ1ZQSi9EUDNxN2lZNGtW?= =?utf-8?B?bkdxVVFXODBEVzdOVjZ1Sk44cGRaWVl5NHZPc0Y5bm5IMjZIMG9YVzltK1BM?= =?utf-8?B?MHVSNTBzUkJuTXF0MUNCVWVVM0ZNcU1wVnJXdGdDbzh1alBXa0lnU3g1UTQy?= =?utf-8?B?N0JaNS9TbWcyU2o3TFJDN0Nxd3hCdFYyQnVTc2xBaU9DY1pHUzd1YWtMU1kv?= =?utf-8?B?c3hmK3gxL1hNdjhxb3diaE5peFFsV0VMVHpDZS9FWWNITGw0cE9Ud3J0RGxZ?= =?utf-8?B?UjhUZHl6RXJZSDZCV3JMMk1COE1pYXEzaGE5cGlmQ3NHbWFuRm9xQTVlQ3Rl?= =?utf-8?B?RVlieisyaXlQREFpSTZEeUNmaG5UeFVDZzNUVFdVajdzUTlwUkM4QXFiOVZj?= =?utf-8?B?emJtSGtjVitvTXoxZUpqU2tXZzhrNVc2TmxqUUlOL1pQU2VhZFJ6UXcreTV3?= =?utf-8?B?aWgwMGltTnJNVnN3SkdHNlRkM2ZtTUpqNW9iTlZ1UFNLK0l5NFVOV0ltMDhY?= =?utf-8?B?VnE3N0NoZEdPT0Qxbm8zSXZ5Qi9sRHkxdnhSUjk2aXVUd2ZEZmZ5OU5U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RFVqQktwS1RV?= =?utf-8?B?OGxGdkZ0Y2VNS0NQY3hmRDZQTStNajQ4NWVScWpNK0QxVG1odkVEZzdGWEJG?= =?utf-8?B?VjFOZW5EMHhJeW0zbDl4T1hBeFhUUUpqVVJyaThQaFIvQ2lBNklLNGhkSEox?= =?utf-8?B?M1BBUVJOdGdoV1Q4QzgwdFdSdXU5TWdxb0NTcVcva1orWVpmZGJKUkhPVk9M?= =?utf-8?B?VS9YTitTOCtFN0FzNGcrR1NidllRKzF2SDB1TzMxYXFVM0YrSnhtdGdZUTlj?= =?utf-8?B?UzNVR2kvNTRBWWszdFpwN1VmNmppRDRnRDh5L3lVOTRpT2NvTXRmbG1yUEFG?= =?utf-8?B?VjdwV3BCYWQ4WEltaitkUmVvQ21rd201UVpsdlQzTGRlMm91d3JzSklxekIz?= =?utf-8?Q?M2t8JPMqNjZYT?= 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)(82310400026)(376014); DIR:OUT; SFP:1101; X-OriginatorOrg: ericsson.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Sep 2024 08:10:36.6729 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 229b67f5-8a86-4b24-4178-08dcd7b9607d 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: AM4PEPF00027A6B.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR07MB8366 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 | 115 ++--- lib/eal/include/meson.build | 1 + lib/eal/include/rte_lcore_var.h | 388 ++++++++++++++++ lib/eal/version.map | 2 + lib/eal/x86/rte_power_intrinsics.c | 17 +- lib/power/rte_power_pmd_mgmt.c | 35 +- 17 files changed, 1335 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