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 30BF245B12; Fri, 11 Oct 2024 10:28:24 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E34F1402E8; Fri, 11 Oct 2024 10:28:20 +0200 (CEST) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2082.outbound.protection.outlook.com [40.107.21.82]) by mails.dpdk.org (Postfix) with ESMTP id 4FE7D400D5 for ; Fri, 11 Oct 2024 10:28:19 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=FNfmogSlok9mvWk5lR2RBu+D+aKYc/NY/JrEk/2AWUtOQDtm/GapZuXSQu4xYmstM3OqgW+NdI/flRrUIk4FySPqejYrcz4XntDIj1Cx+6lQlr4H0by5qm5LWyIyV0SDhD5XIrQxEH9WjEaAA/pI/JQq88wrRiAhsS1muxhVn53LLSZtTFdeY/YvNi/GBP6lz4+VsyY8mChspwGBvuU9eY6oG9R7NspmqcUMSEkhd+skWF3GCPMmJ0rJ1srQ5twMb4AmCPO0Z1Dg85yGD0IyQD2OpX/dvJL33SPJ8IP/Z+UPmKbFVh3W5xn2BU/koNDi1jZwQd/32Zfvw1qyzFtHjQ== 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=uAqgUzqxGk0KKyEOi6gXNwSfh+wfGTrJOuWboiE0Wu4=; b=j9yA98T7GrPr1hiumkqqhzrNlpHOfD66ROg7QA3CiNX34hKmgSdLUxbiqWL/OB5EmlYRVWBsEzNz4nQ3QCvS/lqUQ1c5mRt/6ijqRFKvG8gUH8EetSMtfm3IrQiqaE41Fl0IxypIPRyqPr/TtAoZu+toUYfz6BlH3wt3arVOCPWH70XLZbPB4zY8+JUm6TBlf19dEtyI4SbcvpRITmgPesFrZ+ovWeImS/fFO6KXXPUuag/z38mBHo4b2MP8MeIzYxIXCHvwTrDAfqnDxjrSMUG2c+oPOYJTG0T4HRnBTxOY07FNsaz43NVTlTBNxJZ+dPNuO8K9vH0Wy0Qu37fZaQ== 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=uAqgUzqxGk0KKyEOi6gXNwSfh+wfGTrJOuWboiE0Wu4=; b=KonPWrnjoW0y5EdwqAPW3UPCRrCV4s5pbV48635ftGSHBzJnkJpMuMEXf/jYeXTHxc5DniwCo3kcxqex+piA8OsKbwg13vOdPNHmL77q5krUstEYtfFMBli8FyaFrYTFoVHJt/h3B/ltsz5npbLBSp5GXzBkC5bHJ8w9HXzPDa3KgfcL1yjHZMazxuJSLBOwxCtdAq8qYWSVrRMIJfkfGup/NcuecBRO49dZzhGtFPZCmdrMhYozrvuwGyzQpJwRQtneW3MYVvNStzeRJZmXz0qtOEKjOQZyPeGeJjS+wFMgZ0fiCw6ivhvXr6+wX2+tyOr2+YrVzILF5+PmNOhkUA== Received: from AS9PR05CA0025.eurprd05.prod.outlook.com (2603:10a6:20b:488::20) by GV1PR07MB9117.eurprd07.prod.outlook.com (2603:10a6:150:a6::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.23; Fri, 11 Oct 2024 08:28:16 +0000 Received: from AMS0EPF000001A5.eurprd05.prod.outlook.com (2603:10a6:20b:488:cafe::68) by AS9PR05CA0025.outlook.office365.com (2603:10a6:20b:488::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7982.34 via Frontend Transport; Fri, 11 Oct 2024 08:28:16 +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 AMS0EPF000001A5.mail.protection.outlook.com (10.167.16.232) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.13 via Frontend Transport; Fri, 11 Oct 2024 08:28:16 +0000 Received: from seliicinfr00049.seli.gic.ericsson.se (153.88.142.248) by smtp-central.internal.ericsson.com (100.87.178.63) with Microsoft SMTP Server id 15.2.1544.11; Fri, 11 Oct 2024 10:28:15 +0200 Received: from breslau.. (seliicwb00002.seli.gic.ericsson.se [10.156.25.100]) by seliicinfr00049.seli.gic.ericsson.se (Postfix) with ESMTP id A4E92380070; Fri, 11 Oct 2024 10:28:15 +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 v10 0/7] Lcore variables Date: Fri, 11 Oct 2024 10:18:54 +0200 Message-ID: <20241011081901.816211-1-mattias.ronnblom@ericsson.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241010142205.813134-2-mattias.ronnblom@ericsson.com> References: <20241010142205.813134-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: AMS0EPF000001A5:EE_|GV1PR07MB9117:EE_ X-MS-Office365-Filtering-Correlation-Id: 11c5a0e5-8bb3-4d81-060a-08dce9cea77b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|82310400026|36860700013|1800799024; X-Microsoft-Antispam-Message-Info: =?utf-8?B?MEdnOTZlVTFEMXJjUUJtUWg1NGlQWTZZQmxnSTRVSENIRUU5aVNOWjVuZ0Z1?= =?utf-8?B?ZXJibk9NZDYvdjQrakExZzN6N2szOFcyc3pndXZQVjFXbmFSd21xcjArNlAz?= =?utf-8?B?VEszTFI3UEo0WjlQa1pDN2ZIZXM4YURtMTNlZ1FWSXhEbTdxMDBYejRhallS?= =?utf-8?B?djU2NFBIdlRBYTlDM1d2OC8wOG50am9hK1BBcjhwZGp2QVpmd0RiVjZFUW1V?= =?utf-8?B?NzIyWk4xTiszbEg2ZjE2OFMrdzZFclNHQXUzTTNqdmlYUUliRnJqK1N4UC91?= =?utf-8?B?dkxhQ0pWa3crbktxZjBsQUFqcVJoMzhNSHM0SWpKL3dvYTIwbStnUk8wM2hm?= =?utf-8?B?MTFBTXhRRmtuZS80SlJ0OFQ4TVNFOVNuYStkeHA2MVhsR2E5bFk1Ly9iYjJw?= =?utf-8?B?ZVVFOTBzZzF2aEduUkEzekNnWGY0N3hjbkcvL0dTeGRRazVJSU05bjhLSXRG?= =?utf-8?B?TWsxYXZOdjBuYWhIOW82MkxwUkV6VTJBZ1NqTURFQStHaEZFM2lPMmxJS0sw?= =?utf-8?B?Y3dPMFIzdU9ta2F5RWQ0MnRWVHdXT01ObENQTk0zUk9NdEdCS2FsNWVWc3do?= =?utf-8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aFdOQ3VnWGFC?= =?utf-8?B?Zm96VnpWeUNoRXRsTStXdEFmK0FkRS9vK0ZIVHovNEx6U2dRbnVmc3pwZG9y?= =?utf-8?B?VHpnYlZ0dGszNkRCVnJCZVNLNUlKWFVIOWV0UDNtYXNwNllaL1NGNm4vdWFo?= =?utf-8?B?a1hXaitvakdLZ3hlRjBpZVpXdEw0dmY4ZFhJNnhyMVBIUFlTbGljNG5hSzha?= =?utf-8?B?cmpvUHltVkFzMHVqL2NEcG9nS3VmWlRXTDYyN1pIc3FsaDErQlh6TnRvVStR?= =?utf-8?B?SHdMYTBLUjNZam9IcGcxcDgvWnNOVklyWWFOY2RLK1ppdWJ6SDIrWkZDZWcv?= =?utf-8?B?QWd0VlBDdW1lZmd0cStLczQrMW9NWEdpS1RlK1hyL0Uzc2gvSjFPeVlacTZ3?= =?utf-8?Q?GoGWP4z2Vut6O?= 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)(376014)(82310400026)(36860700013)(1800799024); DIR:OUT; SFP:1101; X-OriginatorOrg: ericsson.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2024 08:28:16.1691 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 11c5a0e5-8bb3-4d81-060a-08dce9cea77b 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: AMS0EPF000001A5.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR07MB9117 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 | 43 +- doc/guides/rel_notes/release_24_11.rst | 14 + lib/eal/common/eal_common_lcore_var.c | 85 ++++ 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 | 389 ++++++++++++++++ lib/eal/version.map | 3 + lib/eal/x86/rte_power_intrinsics.c | 17 +- lib/power/rte_power_pmd_mgmt.c | 35 +- 17 files changed, 1343 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.43.0