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 C77C845B42; Tue, 15 Oct 2024 11:43:09 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A09F64065A; Tue, 15 Oct 2024 11:43:06 +0200 (CEST) Received: from EUR02-DB5-obe.outbound.protection.outlook.com (mail-db5eur02on2078.outbound.protection.outlook.com [40.107.249.78]) by mails.dpdk.org (Postfix) with ESMTP id 3769F4027C for ; Tue, 15 Oct 2024 11:43:04 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Nj0mkwFDdkZx5cdtOP/Rx2+vIo6d9UCq3GexfDWhMEfqnHdqvD2tMsha/Lt0uR+fO/sHgnKyUWtfTQbUwR1V9yi9i8zhkUbzbVzhxyounZcsf8xktWJCui28KhzJDsHOyBeDMGJppezJjEo1ihaYFZ+026yKzIUvvrHDHIeJ+UsRyCJXMDbcAKZqApXPxgRWQn8kpHOn0WsSU4tvXsvDPEAE1MznbGxAq9joc10k/tg6vzBcCRAC+AR4Omf4SbN74WClbpqOvfKsbCys6sg1B01CHW8rHCHbLvSOHaFvBA70+3lkQPEW/RLi22EVyRiTnzDj6Pdjc0usCKh5+xxSqQ== 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=7OQrg7A6NK8BYV2v9IF4l48WDuky+GMN5OPZvUlzruU=; b=cgh8/pMyY2xvsqcpjjBi4IjbeGP7x+m4ksXcPbp3zPqX2I2o2ghiYe2FYSzOIbIgUk0bF3Ax+NfvigbB4Vmc8s7G+bbHyVUS1DJRUi2sXuyarn9cYrAfWi0R8m5hYbSqO3a94jn/Lf/IROKqj8XChQ+qHrUUJc7YmIJnsPbjwUo/xsAaSGOLa8+abfAGVn9tnke2jvSJJjGwVIQv0gmPsq3zjDGpETMCILtO5ebAfkci68mPlN5dw41Ua1jktY84r/5l5zCCJBn1PiN6p88KRxe5Rxm3in0+MX1bmrm5g3wbCKp/3D8mRg4Y5wdmK8RSSEGXgrUb0Ng9sidBF9YOJw== 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=7OQrg7A6NK8BYV2v9IF4l48WDuky+GMN5OPZvUlzruU=; b=jiC7qlArq4WYqGKx1vDXo/51UObEzA6pGkh0UG4WFHK7kskiOX1wa14xkJPbTccF6VUcFN70e+lJcsJi0Iskw+3/T93x/onakV0HQhOFrfLNiShQPPXV+jFlOcMSV9BPzYJhwDYCgRYlZPdCod7AiuqchmQVy9dP72600nX5chImGo1z/2fSez3f5UPTYDhkrx71+TYDhoqaENLVdXB2YUk4+o+tMiF+rbq6GF4upEs4Cb38E1dEwuSIphe0zbmdNpQkd956LdEx4HPkfb+7iOmKjHdiGLRoKvVOVIw6fxTx+RaKU/oQpwFyXhfcTkKm+ea/YyxnsAiwGcrMzbh4EA== Received: from DB9PR05CA0020.eurprd05.prod.outlook.com (2603:10a6:10:1da::25) by PAWPR07MB9903.eurprd07.prod.outlook.com (2603:10a6:102:388::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.26; Tue, 15 Oct 2024 09:43:01 +0000 Received: from DB1PEPF000509FF.eurprd03.prod.outlook.com (2603:10a6:10:1da:cafe::e0) by DB9PR05CA0020.outlook.office365.com (2603:10a6:10:1da::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7982.34 via Frontend Transport; Tue, 15 Oct 2024 09:43:01 +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 DB1PEPF000509FF.mail.protection.outlook.com (10.167.242.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.17 via Frontend Transport; Tue, 15 Oct 2024 09:42:59 +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; Tue, 15 Oct 2024 11:42:59 +0200 Received: from breslau.. (seliicwb00002.seli.gic.ericsson.se [10.156.25.100]) by seliicinfr00049.seli.gic.ericsson.se (Postfix) with ESMTP id 0796B380070; Tue, 15 Oct 2024 11:42:59 +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 v13 0/7] Lcore variables Date: Tue, 15 Oct 2024 11:33:37 +0200 Message-ID: <20241015093344.824073-1-mattias.ronnblom@ericsson.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241015065505.823840-2-mattias.ronnblom@ericsson.com> References: <20241015065505.823840-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: DB1PEPF000509FF:EE_|PAWPR07MB9903:EE_ X-MS-Office365-Filtering-Correlation-Id: fcacd490-cc07-453e-803a-08dcecfdc179 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|376014|1800799024|36860700013; X-Microsoft-Antispam-Message-Info: =?utf-8?B?U1FXSDAycWFjSDNhVWt1cndpc09Xc1FJQk5HZmZ0TVIwb3NDNWwwN3hEWWtt?= =?utf-8?B?amJrYzB2MnRrWmNSVDg2VFlScnFlTFBrRFpEZkJ4MW1yajVid28vdWJ5U253?= =?utf-8?B?Y1JGY3U4NjBGaUZuYUM2dUI1NW95U3R6WTZFdEo4cWp1L0MwV3hmNDhkR1o4?= =?utf-8?B?cGtOa1dxWis2ZHltOHUyQUV4aCtYL3lHb0pjNTRFNFo3a2t6bTNkUC83MFVn?= =?utf-8?B?ZSsyUmwzd0NVM21GdkY2SHpqLzJiRWZmUXZIR1FRczF6VlIzQm81L3FuWTFC?= =?utf-8?B?dTlBdTBYSmF4bDNtVzJmMlQ1anloV3lyTHV0enFrdzlQYVorcTRJeCtadjN1?= =?utf-8?B?eFVKbXNFVzVFTXRFdzVhQlpOd2pwNEMyOGZqWVRCWU1WdTd4YXdRUHlIVEd5?= =?utf-8?B?V0NqR3RXOHIzM2poYUhaMVdsT0gxbWRTU1ZNN2tiQXo3bWFvazhUeHl2K2ZE?= =?utf-8?B?Ky9SMHMwN0dMOVkvcjRlaUppYUFnV3piKzdxMWhOSnI3SjQyQ0h5RGpSWERG?= =?utf-8?B?YktLMW5Hckh0R3lUd3dZWTZRTkw1MFpkTUcwc1NkclhtOWZLamFwS3VDcG53?= =?utf-8?B?aHRXTHR2SDllOXhNa2N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EJTYjRISkFRd2RyQWpRRnBoQnhCYndEOW1HQURsM2ZyRHN5VUNhSWFq?= =?utf-8?B?WkJrQ2lUcnpLbEE0Y3drVWROdFZkTHRFZ0VuU21HRnptU2hGVUhndUtMTU1Q?= =?utf-8?B?SHEvWG1EODZZc0loN1NxR2srbnpqVVBWMmtYbCtuNEg1RDlkTWRFZTh1VGFr?= =?utf-8?B?UFdnb0ljcVhhVDJKYytCQTY3WVdLV1dlV0pTR1hqRWN4SmdTU3RTbktOcUpq?= =?utf-8?B?VVFuOTYxbGh1Y1BtN0V0TnFGVTBrRlFINzhTL3BodUZHQzNWK0h6ak8wMEg4?= =?utf-8?B?aVQ1S2RsTEV2eHB5azkyMTdGQ1crTzlDSExXeStnejZPSWprc1pZbC9rdkFa?= =?utf-8?Q?01tHjTYO/rS3t?= 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:ErrorRetry; CAT:NONE; SFS:(13230040)(82310400026)(376014)(1800799024)(36860700013); DIR:OUT; SFP:1101; X-OriginatorOrg: ericsson.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Oct 2024 09:42:59.5832 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fcacd490-cc07-453e-803a-08dcecfdc179 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: DB1PEPF000509FF.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR07MB9903 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 | 391 ++++++++++++++++ lib/eal/linux/eal.c | 2 + lib/eal/version.map | 3 + lib/eal/x86/rte_power_intrinsics.c | 17 +- lib/power/rte_power_pmd_mgmt.c | 35 +- 20 files changed, 1407 insertions(+), 93 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