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 AC7EC45962; Wed, 11 Sep 2024 19:14:34 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 383C943293; Wed, 11 Sep 2024 19:14:04 +0200 (CEST) Received: from EUR02-VI1-obe.outbound.protection.outlook.com (mail-vi1eur02on2066.outbound.protection.outlook.com [40.107.241.66]) by mails.dpdk.org (Postfix) with ESMTP id 957E442F87 for ; Wed, 11 Sep 2024 19:13:56 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=uVoE2erCqwzapzl7TwiYO/wN7cULy5XXL/ORJgOLsHXwkdu00dPlZhHxie5n5swbb1zDJ38PKyN+1zlOwi0zMrWw6GGKluz98OxhM5tFQyRDp+0ZJz2icJy5dmxpoYoB6X3ZTDtbtxNVSUDSNArdMts/b+JwUBBhqHH9b+RaXIDJjUuXR3gReKGY+Y/3t4Sx0VcxgG7syktKXliTTWckLszNZjQOShBsUjr15y6wSEakVo40mZZebz7Wdqi9QGVqWwSrPfnZrMnsLFnDrNIvA93ncy6S+kt5qqTZIozmTtqizbes/e1uNjZ3q6Ns5P1Qaq3SauB1N1k/0/kzAKG8Ug== 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=/S+Ue7ckD6MXqmqK9DQ/on+R1mONpntlwylO31aymwk=; b=tiHEsZQoNHca2hoorECS4sqR+r5h8wz1e5jJiLyTYJlZBAT7X5AQpkfAgFQzdwQqveROH/484iKNKGT9qhCcYs1chpCmJC8yVU3Cs2THxhdilDCBH1cjRTR1bBOvRAjbMmrlCX7RI+CmVYyR8BSqvXdxwRX80WqiO/HZQOoFltah+SM/LskGDcor8NJelzzbdiPw6xO/HLRx+we11LZCS8jyWl1jpacAXEMhxeTVaz57JoFgHmRIPvzhvqoOWuzXgquQUCdSJJQqfAGXGN+D9vo5aHBvNl3f+kjGTN9hCrwbJzGooMmYwY1G6rDtHyPsSrhu9aGzpJLzJekDgUVmKQ== 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=/S+Ue7ckD6MXqmqK9DQ/on+R1mONpntlwylO31aymwk=; b=XxyrGRf4PX9LStt7uVw5MuykJiPNpsfPGWK5/BftuVpmT2wCUYZAWgj2MxKwOUdgPMQRgw0q+CZ87Jcuf8XcoZnVVnZeiv0b/mVjsUnAe2dTL6AZW2pdP/iMGCSr2TxH4B7BPMG86vhD9DBAFoC3VJDwn6zj4i1kVJDQTFjS6/oQAKM7ShVxkBmGN9Id976xhvjraIrLUPvtIYNxCLkoStPxaVVCB0fUIFbFCJSeZifri/ockPHkbxgPDC6+FQUMmkHIjPkU4q6o154KqRrwzXeUmk/G3UdxJaMva+DuFtCSF4cVDWa7hZopDEahSwBhtGBunXotyS+An419TNi76Q== Received: from AS9PR07CA0005.eurprd07.prod.outlook.com (2603:10a6:20b:46c::28) by DB9PR07MB8498.eurprd07.prod.outlook.com (2603:10a6:10:36d::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7939.23; Wed, 11 Sep 2024 17:13:51 +0000 Received: from AMS1EPF00000045.eurprd04.prod.outlook.com (2603:10a6:20b:46c:cafe::58) by AS9PR07CA0005.outlook.office365.com (2603:10a6:20b:46c::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7939.25 via Frontend Transport; Wed, 11 Sep 2024 17:13:51 +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 AMS1EPF00000045.mail.protection.outlook.com (10.167.16.42) 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, 11 Sep 2024 17:13:50 +0000 Received: from seliicinfr00049.seli.gic.ericsson.se (153.88.142.248) by smtp-central.internal.ericsson.com (100.87.178.65) with Microsoft SMTP Server id 15.2.1544.11; Wed, 11 Sep 2024 19:13:50 +0200 Received: from breslau.. (seliicwb00002.seli.gic.ericsson.se [10.156.25.100]) by seliicinfr00049.seli.gic.ericsson.se (Postfix) with ESMTP id 5BD16380061; Wed, 11 Sep 2024 19:13:50 +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 , =?UTF-8?q?Mattias=20R=C3=B6nnblom?= Subject: [PATCH v2 0/6] Lcore variables Date: Wed, 11 Sep 2024 19:04:24 +0200 Message-ID: <20240911170430.701685-1-mattias.ronnblom@ericsson.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240910070344.699183-2-mattias.ronnblom@ericsson.com> References: <20240910070344.699183-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: AMS1EPF00000045:EE_|DB9PR07MB8498:EE_ X-MS-Office365-Filtering-Correlation-Id: 2abaa032-36c8-483c-49bd-08dcd2851b35 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?Y3RRSXpjNjROd3FVWHMxOVBOR3dtQ29pS09IcFRxdlZ0bGZyS3R4WDhZVmEw?= =?utf-8?B?djI3TjcrNVlIWDljVGVoaUtVcklTUUJ0M0VPWUNrZXhaT0dzd2JUYllnVzhO?= =?utf-8?B?UVJLdDB2VWJJQ1FZREZtS2JqRmswd2xmWHgrRzZmSWk4OGhXZDVjT0dMYThh?= =?utf-8?B?U1NJV1VUdEhkOENRZDRSNW83NkpqY3hNY0NYYTZORzlTZTk2QmF1WlYrT0tJ?= =?utf-8?B?aG9RS08xWXRhVnFLUVVvNFJkQW1hWmZsek9BaTBpd21rdFUwSjBQMTN0WEZ6?= =?utf-8?B?bWROMWRGMWJ5cGYvTzNYQzhwRkdBYXZBZEJsR1YzT2p5aG9wUmwwSGZKV1lZ?= =?utf-8?B?VVh5NkltL1d4SHZpdUQ5ei9hVElsTEZCLzdpWmZTRmlDZnExMVpqa3BUMERa?= =?utf-8?B?TnRDYmw5T1EzMVpnd2RPbFVSNDRENENsUlRNbVdtYjVsV0VIbnJRTm1DOXEv?= =?utf-8?B?R3BxWld5SU04dWZyOFNyQ1A2dGRHU1dBVHRqS0dwRVpsUkRBbUJqaEF2R1cw?= =?utf-8?B?TkQ2QXdDRUZpMUtOTmEvMDdncDRBZ214aEdkQVdsTS94TER1ZU1TS0JRM0x1?= =?utf-8?B?b0pQeHF6aUxKK1lkM2VXdE13Z2FqWkRDWC9hS0JKT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ZyditxZjJkTU5LVHlIdFVGL1lQMHpVdkthbTYyMEs2?= =?utf-8?B?aXBuWWdtbUFWMXU2WXV2cy9MMTREcVZDb2JVNFlSdmVBN0FPZVg2V1ZQTlY1?= =?utf-8?B?U3J6aktDbytSYktleWZZSzNwWE9iTVhZaHRCdGZXVmZ4ZjJaTkJVVXBaYW5x?= =?utf-8?B?YmZZUmpOTGpCdTIxTXpvUExDY2pxZHBPUW1RQlRkZ3hLalMzVGx4MHoxdnhP?= =?utf-8?B?ZGdmZWNveFZCa1kvSkMzUTRES1pNZFYybkZ4OWlqdXQ2aVdONkFFNGhTd3FG?= =?utf-8?B?OC9zNk42MGFFS29hMnpCc0M1aHNGblRtMS9ITVRCQU5aOVl2NGhRTzNaZTBZ?= =?utf-8?B?VHJrNVVLdU1zVlgrdmp6azBId1JNcWpBb3JQc1htSTRlV3VIVWhBSW1iOXNG?= =?utf-8?Q?atTSSkLv92RZ3k0+MwGSMqO5D0I7RyaW?= 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: 11 Sep 2024 17:13:50.8259 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2abaa032-36c8-483c-49bd-08dcd2851b35 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: AMS1EPF00000045.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR07MB8498 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 (6): eal: add static per-lcore memory allocation facility eal: add lcore variable test suite 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 | 1 + app/test/test_lcore_var.c | 432 +++++++++++++++++++++++++ config/rte_config.h | 1 + doc/api/doxy-api-index.md | 1 + doc/guides/rel_notes/release_24_11.rst | 14 + lib/eal/common/eal_common_lcore_var.c | 78 +++++ 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 | 385 ++++++++++++++++++++++ lib/eal/version.map | 2 + lib/eal/x86/rte_power_intrinsics.c | 17 +- lib/power/rte_power_pmd_mgmt.c | 34 +- 15 files changed, 1029 insertions(+), 87 deletions(-) create mode 100644 app/test/test_lcore_var.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