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 D4B4743FC4; Mon, 6 May 2024 10:38:23 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 53417402B9; Mon, 6 May 2024 10:38:23 +0200 (CEST) Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04on2075.outbound.protection.outlook.com [40.107.8.75]) by mails.dpdk.org (Postfix) with ESMTP id 4EB8240270 for ; Mon, 6 May 2024 10:38:22 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=M1+Trca14r1oz8tivHyGWw8sYQfucjmwXzwpafvppv2IoBWTBLDHLe61yrrkmE8EA1CvMNxjJiNGY1j8woDWl9J8BRMI1U3muHZH4mWbojpTx/jsFYnzDT4zf0epP9GB8p8Qrkf7Wqn7SLFyeaUjrvcswiQiEZ681iiH2+4lH/OMIwUcJ3xNO+YqGgZvctxuSA6SU/tQw21YHVu2DshHjUT0GPqT8wuhBx6Xa4ziru2SyOi7Zlz+3ncLcC/oiSAKQu1jNtdHYyGaWAZfJeXXzwlFETiSZCR7pwvhfkWbo62j+rb1UJS+nyYHoboR6+HSTKdf5b+ESXUoxEDP4VdrNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=Lut4OB2YWNLscV0dbr/9KAZii4WWX37Ll5Wfal6HjF8=; b=HTArpoufQaPlEahsDAo3/eJrPx6IpFq/una0GnljZoNg9s5pDfFqwC88fgEsO790YOs24Akot8M7Egfo95ZUK3GoTHXqs/LMI+eITHaUd98gi+nP5TZDYHJZi9iBmsUBO1gISdceQQuk0i4u0W3v7RQVCkbCQ41kaWuxkkIOgkA/Xy245lBEbB+uvu9T+8RCo6kLie73IbcNRRnrUgl+n2xuxSpWgAbu1WPHMOPXP9NI8VVxnOb+o+NAbte3qReEZ4UGBMdJewjeDe4BbQTeyLMijflcUlN7Ujv06uN0ovOJIeH/Up6HAy1wd7cfkyFe+z2NATXwicYVjx0auwLKhQ== 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=Lut4OB2YWNLscV0dbr/9KAZii4WWX37Ll5Wfal6HjF8=; b=STcAkHM6qT3V/raff54MuXmwvQ52SBBVgHJ+vhwtiml+RO1WSSjcgJx09YuqHjnYB188tcFw7x02wmXCfsvjJkTInf79ze0l7grgt7PmG8ec5AlbVNkDipa/8GEEQvouP+TY7mFEtfoEvxV33YqAYo5KS4R+f2hBk6L+5WtIzH1dUTHq1pEg8b7K/sgX5fXw7WKDlUbVSYLJ3yRTxxfyfbRTQJYrqRMNXk5/BTP4WYnIypZVtMYA5lA8hNKiOGiWarWB0zMElr9phQXEiZdbVakqmAkI3HH5vSjhdDPN5az+2PmMlXlYV9zfUpK0BZlGqt7Ni4q6nnkgzdYQWxaQxw== Received: from AM0P190CA0023.EURP190.PROD.OUTLOOK.COM (2603:10a6:208:190::33) by DB8PR07MB6410.eurprd07.prod.outlook.com (2603:10a6:10:13b::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.41; Mon, 6 May 2024 08:38:21 +0000 Received: from AMS0EPF000001AD.eurprd05.prod.outlook.com (2603:10a6:208:190:cafe::c3) by AM0P190CA0023.outlook.office365.com (2603:10a6:208:190::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.39 via Frontend Transport; Mon, 6 May 2024 08:38:20 +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 AMS0EPF000001AD.mail.protection.outlook.com (10.167.16.153) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.18 via Frontend Transport; Mon, 6 May 2024 08:38:20 +0000 Received: from seliicinfr00050.seli.gic.ericsson.se (153.88.142.248) by smtp-central.internal.ericsson.com (100.87.178.64) with Microsoft SMTP Server id 15.2.1544.9; Mon, 6 May 2024 10:38:20 +0200 Received: from breslau.. (seliicwb00002.seli.gic.ericsson.se [10.156.25.100]) by seliicinfr00050.seli.gic.ericsson.se (Postfix) with ESMTP id 8E8FA1C006A; Mon, 6 May 2024 10:38:20 +0200 (CEST) From: =?UTF-8?q?Mattias=20R=C3=B6nnblom?= To: CC: , =?UTF-8?q?Morten=20Br=C3=B8rup?= , Stephen Hemminger , Konstantin Ananyev , =?UTF-8?q?Mattias=20R=C3=B6nnblom?= Subject: [RFC v6 0/6] Lcore variables Date: Mon, 6 May 2024 10:27:15 +0200 Message-ID: <20240506082721.120666-1-mattias.ronnblom@ericsson.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240228100928.524277-2-mattias.ronnblom@ericsson.com> References: <20240228100928.524277-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: AMS0EPF000001AD:EE_|DB8PR07MB6410:EE_ X-MS-Office365-Filtering-Correlation-Id: f63da6bc-c4da-4afa-2da7-08dc6da7e2a6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230031|82310400017|36860700004|1800799015|376005; X-Microsoft-Antispam-Message-Info: =?utf-8?B?Vm9DYmhETXF5V21USEVCZ2VXUTd6MDRBbkNiYkJtSExET3k2NHMyMVoxV3VU?= =?utf-8?B?Q0JzZ1hPR3hZaDhsN01KR084T2twRm12Vnc4WlFvU1VGQzB6cURoYnVzWENY?= =?utf-8?B?U0FJWVFPaTl6dnpWY08vZSsrWmxSRFlUMFRIVkxseUNZc2p6L3FNTHBodXRV?= =?utf-8?B?ZnphM3ZWNkwrR09ndUlxMUlTYStkeXBoMkJveTdJL1pEVkthRlVvVzI0RGtu?= =?utf-8?B?L1Y3elFXR2N0S2ZhU1BXQjM2NVNLU3pvbXJScjYwcjlWaDVzQWQ1TlJXR0xs?= =?utf-8?B?dnM0eEhSc1o4YStDTGRCOGw1NE9GOS9nd0lCZS94NE4zVHdWaUFHSU04aE1z?= =?utf-8?B?ODlUVWlsdlRYMFFkeVQreGxuR1NxOFkzT2NUMEtHVlNsQUlYTDlHTjRzTEdw?= =?utf-8?B?RHRvL0c2ZEZLVGFDZFVjMHYzcUpwYnpId1NRN2luZWt3bUZFTmZsVysvMG9a?= =?utf-8?B?VmN0YUdzZWNEam1qejF0b3V5dU5ab0VzSnlxajZYdkRMQ3dFdHpVb21relhs?= =?utf-8?B?c1RIZGp6L2dSQ3FhR3QxMlBhUUUwTzJBRTZGaGZMV3NGVDZKYk9sU1BqUVBw?= =?utf-8?B?a2JTNXl6djhVTExNckdvWXM3NWttaWIvLzlpVHdQMmk0M2tjQUJ4UEgreUJG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GM2YzFzYytkUExXYXdrZWZIMWN5NDRsNkJ5?= =?utf-8?B?ak1iVVNxVkxUTVBFTDNGZnVUN3ByWThrQzBpMUlYcWtETU9ab1YrYUxzOWVi?= =?utf-8?B?Vkkvb2wrbDBMWFRZOFJBU1pUTHo2TVlMdmw0N0diTnV4SmJOYW1reXRuaFht?= =?utf-8?B?TE9zMU5waDJBbWZNVEJBMURkRjdKWHR6Lzg3cUo5RksyTEQwTlpDb0ZqdlFk?= =?utf-8?B?UDF5YjRINDZlMFlaM2hoeU51TithcXkzemhIMUhmZGdBQ2RwSDIrdkJ0SFZ6?= =?utf-8?B?K2U1RU5WK05VUHAyL2dqbjYzZ3RSbnRVbzVFWjVrcEczSldiRzViSlZ5Ykt1?= =?utf-8?Q?0Lne+Xei2ahKN?= 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:(13230031)(82310400017)(36860700004)(1800799015)(376005); DIR:OUT; SFP:1101; X-OriginatorOrg: ericsson.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 May 2024 08:38:20.8650 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f63da6bc-c4da-4afa-2da7-08dc6da7e2a6 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: AMS0EPF000001AD.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR07MB6410 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 RFC presents 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. One thing is unclear to the author is how this API relates to a potential future per-lcore dynamic allocator (e.g., a per-lcore heap). 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 app/test/meson.build | 1 + app/test/test_lcore_var.c | 432 ++++++++++++++++++++++++++ config/rte_config.h | 1 + doc/api/doxy-api-index.md | 1 + lib/eal/common/eal_common_lcore_var.c | 69 ++++ 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 | 384 +++++++++++++++++++++++ lib/eal/version.map | 3 + lib/eal/x86/rte_power_intrinsics.c | 17 +- lib/power/rte_power_pmd_mgmt.c | 34 +- 13 files changed, 1000 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