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 50727459BF; Tue, 17 Sep 2024 16:42:48 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6660341153; Tue, 17 Sep 2024 16:42:10 +0200 (CEST) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2086.outbound.protection.outlook.com [40.107.20.86]) by mails.dpdk.org (Postfix) with ESMTP id 71FA540ED1 for ; Tue, 17 Sep 2024 16:42:03 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=BikQWJ+YVaEpEgZscp5vxPXf0gIMNkIbIoW/lvzMLY7A5q6M4MksaF5JaT5rhLtXItSHi0DNE5mTsFfI2/rYAyeWfJ4RyPREaXWSTNqAtPb2YPrAN1TAJNrHjeuSQ7QW9g1S97T8ILoJlYSgDBnIlzZCSIk57IulsTNd7JtLuC6W/H28uJPMckamChaYxI8XeFlIT6WhC1yv5pc55icF1xJaJHfEJ3VNHLP14TNqTJC6dHqE5HJgPHcs0Ee4PaVJwjPRArQlw2JI0DNNp3KEqlVq4vjSKcPL6dA+n6zNVafUASnr9WtpG+gmj+5DTgKxfTOMkTWAp4qGhwuierNq5g== 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=4SjDkZQzxX/kowDp+KvH4yJ/Ar0qMnG5DR17DdbXCNI=; b=izDAk38KOrm/McAaKvYpQnJLg9+7E1Om1Hu0sIJ44uwmQkxHI16JZ/Jbm2T2J/iQu1DBa3Q9xUoSj6jQUE6ZIIE/9y8Qv0Mk2oEVOzLo1L9c6JyL1FPxQ12S7ypj7UOqgRirL2IOfxLg7vcKxiD6ehnU5kAASfrJOSoyoZ0wnmWQQ2q6R72W2VgHZWKRSsTt34gWrVEJzljWqFNUOR4ugYwILF1hVx+3ITQSx7pGq4F93nXcftVvT16PmocsF9AIWfGcVpGPglpVesxx5DaM5CcJ+ZIcL4jLPJhbSzx0o2plFxr45UOTwn1itRo/Bdfr7gsX5r3kqQiVo7aHT34tUQ== 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=4SjDkZQzxX/kowDp+KvH4yJ/Ar0qMnG5DR17DdbXCNI=; b=HIfu3fuq+Dkd5r+0M/ci56DBx2lWNg3hCIYZfhG/KkjIM+n9s8BQp6adEsdZ+BokH2Zh9jBJHjhIWg+gvly03SJIL8rHILe5Em6r/OhVFlTiz8ZbPV2m8hnsUukGIe5RooNe6TcQE/toXrCVFR6iCMVNPrFKgKDcpFMnHlv3fac3Ve92uGUIZhdG4xnLabIN9H9dsKzbMFa/AJPyLqwDv4icZKbWmPwHfQ/PhJ4N8KEf1vQ8j7VvoICwvshIM8rfzaM/F/GenHdRWWVX7UmcF6/84DNSZRkc0La9Ul7SjciMXQIWEYad+tjPrVeOFcEQ5WS2xu2POCJlSRsPV6Bw8Q== Received: from DU2PR04CA0193.eurprd04.prod.outlook.com (2603:10a6:10:28d::18) by PA4PR07MB7711.eurprd07.prod.outlook.com (2603:10a6:102:d7::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7962.23; Tue, 17 Sep 2024 14:41:58 +0000 Received: from DU6PEPF00009525.eurprd02.prod.outlook.com (2603:10a6:10:28d:cafe::e1) by DU2PR04CA0193.outlook.office365.com (2603:10a6:10:28d::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7939.30 via Frontend Transport; Tue, 17 Sep 2024 14:41:58 +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 DU6PEPF00009525.mail.protection.outlook.com (10.167.8.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.13 via Frontend Transport; Tue, 17 Sep 2024 14:41:57 +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; Tue, 17 Sep 2024 16:41:56 +0200 Received: from breslau.. (seliicwb00002.seli.gic.ericsson.se [10.156.25.100]) by seliicinfr00049.seli.gic.ericsson.se (Postfix) with ESMTP id 95D83380061; Tue, 17 Sep 2024 16:41:56 +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 v5 0/7] Lcore variables Date: Tue, 17 Sep 2024 16:32:32 +0200 Message-ID: <20240917143239.724069-1-mattias.ronnblom@ericsson.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240916105210.721315-2-mattias.ronnblom@ericsson.com> References: <20240916105210.721315-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: DU6PEPF00009525:EE_|PA4PR07MB7711:EE_ X-MS-Office365-Filtering-Correlation-Id: 85c80ead-5df8-4550-0be1-08dcd726e207 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|376014|82310400026|36860700013; X-Microsoft-Antispam-Message-Info: =?utf-8?B?T2pwL0tTVjNaaEFCVUJBcmpxbCtwK0d3ZkpmOEFkMS94V0JSWnI1TWxGMnky?= =?utf-8?B?MjZCT05aekNqcHYvbEViV2V5OGlmNzFNai9NRElPMmlFb202dHRIaUtsdzVx?= =?utf-8?B?Y3dkeEcxN0hTT0tuc2N2YWdja0locVQ3dktLbHB4WVFja21tdTlIZHNUMzJW?= =?utf-8?B?anA3SWl5Y1AydnJhMlZrdjhhNlBqalNSeUZFeGF0UUZROWVVRENHVGJQcytv?= =?utf-8?B?STIvYWU1OWpDZ0NFNE81WEhPU1pyTWhDcktQcWtXM21odmw2ODlNNnJrYnlh?= =?utf-8?B?RjRFWXBOeVk1QlVGUUlyY1BLQjQ0TGJBWWtqT3d5NDVYcU1oZFh2Qk1FcHZU?= =?utf-8?B?TVVOR2NhQVFtWUMxbEFNaks3YmpUaFpDNUJmc28xNHhrdEdGOTB6d3hTZlhQ?= =?utf-8?B?QURPVzhJUng0VHhSandDeXFJazJlVmMvbDJiSzM4VzV0ZU9wTE50WWJqKzRt?= =?utf-8?B?bGNsL0wxT3hEYkRhUFhWREJESEU3SytqV2ZhYllTTTloY3FBRjdHb2w3Z05m?= =?utf-8?B?YlVQRjZpeEc1YTB1YnNDWEVhTk9hQzc5dmxrK3drM1dmWXBFc1dDUEVUZTlz?= =?utf-8?B?S3p5QVFOaGRaNm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RVRC?= =?utf-8?B?Z3ByVUNxMEY3NFpDYjRSZ1duUFM2K0grcldPdnpKS1hpdWkzYXJybmR2Y0V6?= =?utf-8?B?SE1XNHdLYy9RUXZNdU52dE5tMG9yelVCTDlhNENSOFRiTFdCNnZiUGJMRXJY?= =?utf-8?B?Qk9NV2NjQTRLYmNtTTUvZStEVC80cVZlampuSmh4OWRCbUFOcTMyTU8zSzNr?= =?utf-8?B?SGd5ZFB4anVLSGNrT1RFVXFXZlN4c0F0YmVBOTRrRkMyT2p2WUFiS05OdjJp?= =?utf-8?B?RTZ2eW11Vkw3dG96Z25qa0Q4azYrYmJNUVBGVk5Ubmk3cVJzZytoeGRBdVoz?= =?utf-8?B?TFFUcjI2dWFuTVZDNHZHSGFOZnRWRW1lN0pRQjFVMUFoblZMUjd3blBJMFo2?= =?utf-8?Q?SFx4deh74H2P8?= 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)(1800799024)(376014)(82310400026)(36860700013); DIR:OUT; SFP:1101; X-OriginatorOrg: ericsson.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Sep 2024 14:41:57.9828 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 85c80ead-5df8-4550-0be1-08dcd726e207 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: DU6PEPF00009525.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR07MB7711 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 | 432 ++++++++++++++++++ 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 | 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 +- 17 files changed, 1326 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