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 5FF56459AD; Mon, 16 Sep 2024 13:02:06 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CC4C940E2A; Mon, 16 Sep 2024 13:01:39 +0200 (CEST) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2079.outbound.protection.outlook.com [40.107.21.79]) by mails.dpdk.org (Postfix) with ESMTP id 5CC2640E22 for ; Mon, 16 Sep 2024 13:01:35 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=LI7jUOuQ413ERUR833A7dnl8r39mE4rsxE8/2L8GMzI3Ogw3GM1oOB3nOIxarAN6/tzcT8yXPPfG8HFdwkoY8MiPHpK+Egswpq8FvAb16auNBfZndjWBp3dPPY+DdQdyD+YCMRHHPruYBpSLl/wHsmJ75RjT3xwbOo4rKirO7Kuhs5kH77sDIgy53qFXZmN4a8cTwYNweFiSmSkbfJOUmIsa2/hbfFW6M+HRKpKlvig5Vvvt1fQMZiHyUoZSdIHhtODl4IXtnox/BlkEfI6ljNUo/1V3c72xYlq7CXVcNG0uJ/3N2OVeSnT5a09KDsEd9N3usEvEEmg+vqR6O7JaXQ== 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=nQWG85uuRsOyfv6Uj3h8hh6uEOc6yWNs9XPEZXZg/I4=; b=PJboA/lEcyl/w8nwiZ+UDpSM4oAAUnnTwIWo1scrNtFFH128kWwzSyW4zz0sxvOkWxWc+nwX9uQcRrJ2g5oRdpGnNiJi/5b0Q2lVGrr4RqsXx7oyJrGs4zAL7Syrsr8zf7AcHpYcO93xap/wd+zgxOJWlS/dDa0AOHAkHpBLEeUBbI2LXgp5sDgANdB8EXlDDEhcF/QuVGZhDCd/EhC0Tv2UmhLVvuQItLKg6zOS5hgcYHylEhW4xGVLw0TqGfu0GIutQocAuN8diux2FTLSL6jgYiG6F14vkF9ox5fqK7KdPa1C+kzRMdSDhLozTEsek/X2UySL7xSWpVejgHh/bA== 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=nQWG85uuRsOyfv6Uj3h8hh6uEOc6yWNs9XPEZXZg/I4=; b=M1hhLwKWbQ7jXGwinuS6ndDJuA2RoFABUQ+nGGPSgf5Jt0efRAimHaMGN+jkcCSxvzCKa1P7ln3F15/JjWosHhv1w9mfy4dYYyNfkyk3q/L1N6M+oEILQHX4/LRL6BGL1+ouEHCOuILH4ADXrNs94XTZVCWnep8zl4qVOjZeZo/H0DroKgeVASS+soT4XAKfY2Jp+I9dY38yvUMZVoALDatQLNzgbJAAtTIhmClroFkBLetQoM4rdy66FTMEbskBfBchTkyJzLZ2UeGtkQJUz5if9/dldxl0Ey9c9JbG1FNzXtudYSjEOXrnWFp2CqSSdUc9RVZrpoHgp1AyyFDJ0w== Received: from DUZPR01CA0253.eurprd01.prod.exchangelabs.com (2603:10a6:10:4b5::7) by DB9PR07MB7836.eurprd07.prod.outlook.com (2603:10a6:10:2a5::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7962.23; Mon, 16 Sep 2024 11:01:30 +0000 Received: from DB5PEPF00014B92.eurprd02.prod.outlook.com (2603:10a6:10:4b5:cafe::91) by DUZPR01CA0253.outlook.office365.com (2603:10a6:10:4b5::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7939.30 via Frontend Transport; Mon, 16 Sep 2024 11:01:30 +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 DB5PEPF00014B92.mail.protection.outlook.com (10.167.8.230) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.13 via Frontend Transport; Mon, 16 Sep 2024 11:01:28 +0000 Received: from seliicinfr00049.seli.gic.ericsson.se (153.88.142.248) by smtp-central.internal.ericsson.com (100.87.178.65) with Microsoft SMTP Server id 15.2.1544.11; Mon, 16 Sep 2024 13:01:28 +0200 Received: from breslau.. (seliicwb00002.seli.gic.ericsson.se [10.156.25.100]) by seliicinfr00049.seli.gic.ericsson.se (Postfix) with ESMTP id 34C62380061; Mon, 16 Sep 2024 13:01:28 +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 v4 0/7] Lcore variables Date: Mon, 16 Sep 2024 12:52:03 +0200 Message-ID: <20240916105210.721315-1-mattias.ronnblom@ericsson.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240912084429.703405-2-mattias.ronnblom@ericsson.com> References: <20240912084429.703405-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: DB5PEPF00014B92:EE_|DB9PR07MB7836:EE_ X-MS-Office365-Filtering-Correlation-Id: 810441d9-8691-4a89-0d3d-08dcd63eeaa4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700013|82310400026|1800799024|376014; X-Microsoft-Antispam-Message-Info: =?utf-8?B?a290SWsxZUhKV2ZQQ25KOWJrMHdlc1BMUHZJOGg1dmJNM1NWcHNPZURKV0VL?= =?utf-8?B?d0dTWlpnZEJ3N25IYlNNWTFzaTExVGpTMWpQRDJBbEJlRUFUeERxQlRpUXVD?= =?utf-8?B?b2FPUHpKeHpGOVZDd2VBc3kzcm5razVUUTdhTkd5ZUI4c0pmT2VBMUhxSHdl?= =?utf-8?B?Zm45cEpZTjNGTjBBM01aRDRwOW5ZUmVUcGRSOVZzSDVvelYyL1l5cEoxOEl4?= =?utf-8?B?blU4aU0wRW5SYzVVZ1o0a09JeWRUWHo1eTBaWjY3UmYraDFjL3JsOHcrWG5m?= =?utf-8?B?YW5Ka2VLMVBBSnkrUlpqZDhZSUZGeHpJcUQ2bmpxV3QrUDJHQjVremU0clJj?= =?utf-8?B?TWlmbWJUbjVkd0hwSjRxNnZNcW5pTFhxVjFFbUwrSlN1NVErbGFBZnp5RVY1?= =?utf-8?B?b3RGNlIzV3lUY01EWExGd1Q4MlBMTjgzemhvcm0xMGFNcS9vZityUGZFVkRp?= =?utf-8?B?aUNBc3hzeWxEY3FpdG9QZmxPUXIvRUtOZTlXdjdsSmlwZ004MFRMWFNHYkpv?= =?utf-8?B?eVl5Vk93Yi9tZ1ordExROVJTVVhxd2NOcW5Nb0tqUm1sQ1YxZ3UxQ3NKOXBF?= =?ut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BSHBX?= =?utf-8?B?MkxpbXdQT0FJcDJkbEhtVDdPYXlvNEhqMU45NGxiVEo4ZmpsSWN3YXhDUVFR?= =?utf-8?B?d1VZUjZSeUQrR1NTYkkyVXFHYVpTWnhWY2IwMDdBeWVSMzVYZ2Y0ckYxRDVS?= =?utf-8?B?aCt5UDB2Y203d0pueEhIaEtuUDlIVWw5a0p3T0YzR2dKQWs0eTZIUXN5S1dL?= =?utf-8?B?ZEMxTkM4UXZyc25taEVmMXBHWUpIRU95VHE3dkNiaEVaWEhmbHNQc0dZNkMv?= =?utf-8?B?SW5JS0hSRktwc2F5dER4UnRjOXpKR2hBMDAxeTVrcTQ2VldmLzVQeDFPWnV5?= =?utf-8?B?c3ZDemVZdk1YRk80RndXdkZNaklONEhDWDYzOStSN3JkdnBQcWllcGtzdDB0?= =?utf-8?Q?gfkXohmq5Supr?= 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)(36860700013)(82310400026)(1800799024)(376014); DIR:OUT; SFP:1101; X-OriginatorOrg: ericsson.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Sep 2024 11:01:28.8641 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 810441d9-8691-4a89-0d3d-08dcd63eeaa4 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: DB5PEPF00014B92.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR07MB7836 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 | 244 ++++++++++++++ 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, 1274 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