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 B888F45B50; Wed, 16 Oct 2024 15:28:25 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 305534027C; Wed, 16 Oct 2024 15:28:25 +0200 (CEST) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2068.outbound.protection.outlook.com [40.107.20.68]) by mails.dpdk.org (Postfix) with ESMTP id 7120840264 for ; Wed, 16 Oct 2024 15:28:23 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=tbRgyFmKykz3pqe+ym/VDDaEd53gNxajUumsSEx6E5jL01ZsSOclSmA5F8A1qDgwHvUELCuSjO3lNN7ln2fwEjyrQKfWLawuRcIMErY8bjAXEHt6CXWt8cAGwaZGnpw+hZp4Zc7tqb48QfhESfYk+KT1S/rM7uCi/bUN5TzPt756CcF0LB4V6IeI6IKtQwsKe6u5lLE6H0gwCGGnGyKim/tsL4JxLyc3QW9MmKZcr8u1VBF08wC0pSpYNgj3Zy/BBSpLPmCnQKmGLw+gCshG9qdnDsC0SfYbytgK00VJnaS8bIWQTkwSS5kFfiNPJc3X1hsUY4EjpdgyCyc/THgQEQ== 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=26/AyPPgqO0lRttO+yfVmuCaBBuUkJKD/wOdIzzL0+s=; b=JwN2azAMA/nKFVdj2QDK4EKt249xZ6y6h9U1FodmOVAh3Fp/cHBRwByicPphZzn4eKJ1tKIeM/SODfKEsuEatFbVuQJEppLOVaGXcEjEUgGMYr0RrMafUF7v+I70W8/RcYGUJ8VaERcmcf7QazN6Y26QX1VdKwIPNEJ9HxDdoLRF5PDB03oqSzyQfGvBukE1AWy+B7IHNZNupJz03VpBeU6qZmO3SxLazVNdmMV+UH/++aLtyf9lj922XJ81rSgYpaEU44QcDG9vHQvmXcGqZK4WAF5opM3R5VEo+GK3Rycz4GApRdx10hLqKFaMp0ZIQ2LPRlGDYkOTJUogKvI8Og== 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=26/AyPPgqO0lRttO+yfVmuCaBBuUkJKD/wOdIzzL0+s=; b=biuD5Vx+cOVweKZNv94B/A4BVfgD2+BQlGsEFoMbBbkg8wjI1KCC44pcrwmAIKgDEMd/TSlKh0sniCXafxRA9pZ6wjqkpI5NmILScQph+1B+deLVK/A15OIUOB/tN/tEv+A3G3zVW0D2VCXzGBc6DZ9WUZVCOwe9n5wX+Q/QzyUOMnavEK6e2y6Qx7RVKfPvEtAcbMMkqPqIS7FEiAbkGQYH0rsstDkrTe+oNgWLNw9F9Alz2fLNn52k1HIcgV4F9kz0hpOSjbhqRWeufwnG7xyhwY5VJi7qyvkNHivV6ni9V9WBCQDftipbTwyFsFAwJNeI/SIuVwgI6Mps5aK/lg== Received: from DUZPR01CA0028.eurprd01.prod.exchangelabs.com (2603:10a6:10:46b::7) by AM9PR07MB8019.eurprd07.prod.outlook.com (2603:10a6:20b:30e::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.18; Wed, 16 Oct 2024 13:28:21 +0000 Received: from DB1PEPF00039230.eurprd03.prod.outlook.com (2603:10a6:10:46b:cafe::1e) by DUZPR01CA0028.outlook.office365.com (2603:10a6:10:46b::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.27 via Frontend Transport; Wed, 16 Oct 2024 13:28:21 +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 DB1PEPF00039230.mail.protection.outlook.com (10.167.8.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.17 via Frontend Transport; Wed, 16 Oct 2024 13:28:21 +0000 Received: from seliicinfr00050.seli.gic.ericsson.se (153.88.142.248) by smtp-central.internal.ericsson.com (100.87.178.69) with Microsoft SMTP Server id 15.2.1544.11; Wed, 16 Oct 2024 15:28:20 +0200 Received: from breslau.. (seliicwb00002.seli.gic.ericsson.se [10.156.25.100]) by seliicinfr00050.seli.gic.ericsson.se (Postfix) with ESMTP id 937DC1C006B; Wed, 16 Oct 2024 15:28:20 +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 v14 0/7] Lcore variables Date: Wed, 16 Oct 2024 15:19:09 +0200 Message-ID: <20241016131916.827788-1-mattias.ronnblom@ericsson.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241015093344.824073-2-mattias.ronnblom@ericsson.com> References: <20241015093344.824073-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: DB1PEPF00039230:EE_|AM9PR07MB8019:EE_ X-MS-Office365-Filtering-Correlation-Id: 7cbe94b9-75ef-481f-a920-08dcede66769 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|36860700013|376014|82310400026; X-Microsoft-Antispam-Message-Info: =?utf-8?B?UFJIMUZMMmh5R1RuOTFEemZad1BhVFdKTFJqVlltelI2SlFSTS91K3VScWdM?= =?utf-8?B?aDM0M05kT0xFUUo0TVVlK1kzdlJpRm9ZVnEvL2tXTXZ3NDJ1RG5UMzhONTRm?= =?utf-8?B?N3g4cXk3bXE3bE94Y2VjbUpSL0ZVczdhbncvdENDd3h2alhDUHFwcXBBRStF?= =?utf-8?B?SUxuTHc1elI0bE9pcHIvb05XU1BFcStxTXZpeXI1aHZSc0dMWk9ycXV2ZldL?= =?utf-8?B?aWg4MkhxOC80VUx1L0FXeXZJTlgvaTJMeDBoampZdWl4N2lPTFpsVTd2aEtL?= =?utf-8?B?cEdYN3lJbnNkWjJNa3k2K3RGT3dBbzJYQVAyOVZCL0Jsa3NBTEUxLzdvMTRy?= =?utf-8?B?b0grN2JCOFdaNW1BY2VaWTlLU3l6Snc4NzNvT216cnlidFpHa0RUNU9scGNr?= =?utf-8?B?OVJscXczSmdjOXVSaEE4bGkwOHM2bEcxSDE3Q3FFeEovdWdpZm1VazY5clMx?= =?utf-8?B?cS9SQTZiTGdEQ2MyQm4xc0RtZlNzK04rMEt4QnY1V2FtZG1HbmtsbjdRYWZh?= =?utf-8?B?YWVkMjA2M1QxNHRCSUVac0dtSEpYUkVLRW81VU94Tm1uNGZJMjlDVk13T3FY?= =?utf-8?B?VXVDK09WcTZseGtpTUpheV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B?WkZTY3ZiY29DVUhvVFNYcitMT0dXQnoremFDYUNFRHVQQ1RFbGhpZk9HU0J1?= =?utf-8?B?NVFxTTBWNUIyNG1XWXdTYURWSU9GbGl4VGxEWE9LL3RPRmZtVWNIOVVickJt?= =?utf-8?B?T2Z0dk8zK29tcWg0MlV1RlJjVUpUb0dmajhIZCtEMUF5VytvZHdTMFA1eDN2?= =?utf-8?B?dnpvVlR4RjI0akRXT3U2ZFZ4WCtmZGpuVkg2M0JHcDFUSjFCMHg3SGlKZC82?= =?utf-8?B?T2poNnlnalNuYnFrb2UzeVl2Njg2bXF4ZVRnaTdjeStObnMyWi8rRHRNWHEz?= =?utf-8?B?K2dxNTJnSDRaQi9sQVk0MzdUVm1ZVVJVQmNnczBRajU0VjRNRE5rbEtIdVM3?= =?utf-8?Q?wWXqyL9RXjGj4?= 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)(36860700013)(376014)(82310400026); DIR:OUT; SFP:1101; X-OriginatorOrg: ericsson.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2024 13:28:21.2225 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7cbe94b9-75ef-481f-a920-08dcede66769 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: DB1PEPF00039230.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR07MB8019 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 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 | 256 +++++++++++ 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 | 138 ++++++ lib/eal/common/eal_lcore_var.h | 11 + lib/eal/common/meson.build | 1 + lib/eal/common/rte_random.c | 28 +- lib/eal/common/rte_service.c | 116 ++--- lib/eal/freebsd/eal.c | 2 + lib/eal/include/meson.build | 1 + lib/eal/include/rte_lcore_var.h | 394 ++++++++++++++++ lib/eal/linux/eal.c | 2 + lib/eal/version.map | 1 + lib/eal/x86/rte_power_intrinsics.c | 17 +- lib/power/rte_power_pmd_mgmt.c | 35 +- 20 files changed, 1409 insertions(+), 92 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/common/eal_lcore_var.h create mode 100644 lib/eal/include/rte_lcore_var.h -- 2.43.0