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 0E56D4596C; Thu, 12 Sep 2024 10:54:55 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3AD3A427DF; Thu, 12 Sep 2024 10:54:32 +0200 (CEST) Received: from EUR02-AM0-obe.outbound.protection.outlook.com (mail-am0eur02on2044.outbound.protection.outlook.com [40.107.247.44]) by mails.dpdk.org (Postfix) with ESMTP id 172A6427AC for ; Thu, 12 Sep 2024 10:54:29 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=YGShUrnnP9OZsy7RiiUISpiUrviBZBPCwlvKT8gHgPU6laGRRNuLFoQK7KYU3j/DNGy59wP7hewQ/Rp18fkh+d6PdtHKzCbYCK4EAF3G1pmsqlK9vH5GYjH6EN6QFKBZEGZPXVTCDbcjzew1iVAUivFO26t1QGsbQyAVWk+jhWvn9XRVQpb/Ggg3mUhx0MtmBcReK3N7eeUJNw+U5HtesU9W9x14AmfBFlsLah74F6o2UVKo9az0EXRG2vArOS3FWeTrsrNKyGItNhpLHXxa0YI91we6N8erUvnE1c0o5E81fD9NKYuzLu0KjkKj8lZgtKIKEkwU65kNBN0xGPb9fw== 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=BLJwR6TN7OEU5p++qMynx0WhCW3byl3hRDQiFU9sUGI=; b=KtkZzHEJMe9n1aghC5aE9I9/hyY521Ry/CwgeKlbtZwPbfJHEEtPX2lOG8qE4BAJ8fbLubDmHSPw+nd9eEfrn4IZL6eAuR3EsnEOQ7T42MNjoqwuddjvV3jy+auRJmEJDHT29g7fy56elPG9rJlTTPq9vxXKrDKQ6XKwXXcuL+5+cuHu2kbgUrOXHjJLt1ZDwAefjQxHKqhbHhILnd/O1whDOpB0B90MofGfyh+JRYBx7yDmiWan6dywds4UEWulqq0KSNTaQVtH2aPt02AdUh1vTqy/nfm9UBrExlK3Ep+pzTXXFNc+vBQXbh2mcSY4NBXj2dAZLp9439iI4C8fAg== 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=BLJwR6TN7OEU5p++qMynx0WhCW3byl3hRDQiFU9sUGI=; b=cqpySvDM+yDxWQcxhtQEXqbo/ulvSySC8AbFWi5KDms6kFfpQKxoDvJ3tQrnWdhYWNXoMz0BiRo6R05EYvDjEntqmlB69OI7tNQOJBBduzc71N1K6nIrh3pL4LvIJbLhiaJtdZTehfgR7kw/W6XwxJ/xUWKx/m03EpJMxmD9+fuVIv3FhQ4XXOS0iDRLPU8N8ZKarJiiP4LG/G+snDjJivZHsuV6OcTZdT33timeeOEr7Nzg6IwICpzL6CxO9W9C56A48Ajnd0+8EXIRGGd4gXso78+VzpTHxUNgokmJwVC4AHZBJGj8xlSO3rFz6sKX1h8+tJ6n0gv8NJgrutQVLQ== Received: from AS4P189CA0030.EURP189.PROD.OUTLOOK.COM (2603:10a6:20b:5db::17) by AS8PR07MB8005.eurprd07.prod.outlook.com (2603:10a6:20b:38e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7962.17; Thu, 12 Sep 2024 08:54:22 +0000 Received: from AM3PEPF0000A797.eurprd04.prod.outlook.com (2603:10a6:20b:5db:cafe::2b) by AS4P189CA0030.outlook.office365.com (2603:10a6:20b:5db::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7939.26 via Frontend Transport; Thu, 12 Sep 2024 08:54:22 +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 AM3PEPF0000A797.mail.protection.outlook.com (10.167.16.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.13 via Frontend Transport; Thu, 12 Sep 2024 08:54:22 +0000 Received: from seliicinfr00049.seli.gic.ericsson.se (153.88.142.248) by smtp-central.internal.ericsson.com (100.87.178.60) with Microsoft SMTP Server id 15.2.1544.11; Thu, 12 Sep 2024 10:53:51 +0200 Received: from breslau.. (seliicwb00002.seli.gic.ericsson.se [10.156.25.100]) by seliicinfr00049.seli.gic.ericsson.se (Postfix) with ESMTP id 4D6EB380061; Thu, 12 Sep 2024 10:53:51 +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 v3 0/7] Lcore variables Date: Thu, 12 Sep 2024 10:44:22 +0200 Message-ID: <20240912084429.703405-1-mattias.ronnblom@ericsson.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240911170430.701685-2-mattias.ronnblom@ericsson.com> References: <20240911170430.701685-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: AM3PEPF0000A797:EE_|AS8PR07MB8005:EE_ X-MS-Office365-Filtering-Correlation-Id: 20c49b7c-25c3-45c5-e649-08dcd3087eef X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|82310400026|376014|36860700013; X-Microsoft-Antispam-Message-Info: =?utf-8?B?QnUzV3ViNEE0TGwwUjJzbno3cEMxbE9FaklzTjRrQmJrMlo5RnF1MWM0THI2?= =?utf-8?B?dVB5TnJBYWZrQzRLU1I3L1dPQVViZnFRbmxzdmxLYTIySkdDS3JPRmhiTzBh?= =?utf-8?B?NWRmQ0loZDZMTFlQS3luK0hGQzJFRk02WXBjOGRONVkwRzQvR1FuZVMrbENl?= =?utf-8?B?YzdUNkdHeDFrYXA5Tm9BWHAyeDQ5SzFtVzJGNGsxZFVLM2c1TkpxaSs1L3pC?= =?utf-8?B?ZXZpa3ZkOGtwSXEra1JnSTVDdFFEcVUvZjl0UFVaNU5LTU5MeHNWV2JLa3Y5?= =?utf-8?B?VGY4cW84UTM0MDRPTlZTYndkSU8rMDdGVldiQ1lrVXJuenpGZlZ3aURwVU91?= =?utf-8?B?QUkvLzRiRlROQmVCNmFWRkRaZmZJbnZ3L0l5MVpEWC9lcTVOSG9BZ0h2eHR4?= =?utf-8?B?MUllTzlKOWYrSTk3cXRXZ0JLNGpMNGY2UldocS9TOHNXaVVEYnpzNEpmU2w2?= =?utf-8?B?aVp4YjVydEFSMEJKQm5vTVR1ajg4aHZFMEk0VExNRWt3NFB0dDNJcS94OE9x?= =?utf-8?B?aFM2YTdFUDJ2eFVYdEU3Szcwbm1nRFZEc0FnRnhxS3ZKZTYxd0syY3RBUUVx?= =?utf-8?B?Ry8rM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x?= =?utf-8?B?OFFsNWVReGtQdm5CckMrejRqVVE2R0wxNFZ3NG5tcWJnd25mTHJNREhocEN2?= =?utf-8?B?Y216cndLc1cyRTV5VWpLdFhPdFY1cHZQSGtuY0FTY2oycDBJcEZIM0crUTRr?= =?utf-8?B?N1Qzb2VlR3lId25Oc01UU1F6Y2pna29PY0tnWHpSWWdDRVE4Y0ZvVG9nNmNa?= =?utf-8?B?TFFlREhoREVNazI2eVRORjZmYVpYc0M3bzZKbzlGMDdleW40bnYvbWZqOURP?= =?utf-8?B?Yyt1bmRlU1kwZWlMK25URXdqWVVyUmxieHRuQVZRajFzRWdBYWN2TTlBbXNR?= =?utf-8?B?QUp4NkdmeXRwbVdTeFcxeGE3UEhWVm94UGY0cGt4NTFVTnpHb1V2bi8rRGV6?= =?utf-8?B?NkVFelo3NHA5a0lURFl6c2hYRkdzYUhpVVNKWEsvQXZQVG9hc2JwVTVtWVhi?= =?utf-8?Q?p5xSSlB5tMdJtmkFULsQ17skep4+ZrcC?= 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)(82310400026)(376014)(36860700013); DIR:OUT; SFP:1101; X-OriginatorOrg: ericsson.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Sep 2024 08:54:22.2149 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 20c49b7c-25c3-45c5-e649-08dcd3087eef 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: AM3PEPF0000A797.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR07MB8005 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 | 160 +++++++++ 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 +- 16 files changed, 1190 insertions(+), 87 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