From patchwork Thu Sep 12 08:44:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Mattias_R=C3=B6nnblom?= X-Patchwork-Id: 1346 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org 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_R=C3=B6nnblom?= To: CC: , =?utf-8?q?Morten_Br=C3=B8rup?= , Stephen Hemminger , Konstantin Ananyev , David Marchand , Jerin Jacob , =?utf-8?q?Mattias_R=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 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?q?Bu3Wub4A4Ll0R2snz7pC1lOEjIsN4kB?= =?utf-8?q?bk2Z9Fqu1c4Lr6uPyNrAafkC4KSR7/WOAUbfqQnlsvlKa22JGCKrOFhbO0a5dfCIh?= =?utf-8?q?d6LLYPKyn+HFC2EFM6Ypc8dN5Y0G4/GQneS+lCec7T6GGx1kap9NoAXp2x49K1mW2?= =?utf-8?q?F4k1dUK3g5NJqi+5/zBevikvd8kpIq+kRgI5CtQDqU/f9tPUZ5NKMNLxsVWbKkv9T?= =?utf-8?q?f8qo8Q3404ONVSbwdIO+07FVWbCYkUrnzzFfVwiDpUOuAI//4bFTNBeB6aVFDZffI?= =?utf-8?q?nvw/Iy1ZDX/eq5NHoAgHvxtx1IeO9J9f+I97qtWgBK4jL4f6RWhq/S8sWiUDbzs4J?= =?utf-8?q?fSl6iZxb5rtAR0BJBnoMTuj88hvE0I4TLMEkw4Ptt3Iq/x8OqhS6a7EP2vxUXtE7K?= =?utf-8?q?70nmgDVDsAgFxqKvJe61wK2ctAQEqG/+0EM5Te0IMYN6rqwe9nx0aarh6b85iFOKv?= =?utf-8?q?2GHKfQo05QAkaTboQLu95wOngBzrVdpbxRwVVTHP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Xbp5xSSlB5tMdJtmkFULsQ1?= =?utf-8?q?7skep4+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