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 626D745BA1; Wed, 30 Oct 2024 05:41:44 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4FAE442FB9; Wed, 30 Oct 2024 05:41:44 +0100 (CET) Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2089.outbound.protection.outlook.com [40.107.102.89]) by mails.dpdk.org (Postfix) with ESMTP id 26ADC42EC5 for ; Wed, 30 Oct 2024 05:41:42 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=GAjB5yUAAxbWrzvDAKWOcXksBlwnNc9KBXVHQRFpR2ieYAj5XgE+Yvg9je6Dr54HYzba1Wn/ug+S967jtZws+V11n1qOW9TedcRTyYZ6iO3UtT9P4O8nO1724dpVEbJlJC2XL99pcWH/ouomDaZB2fsgGUycZDfcoVEY59O2yGwzCgoNd1p/CoOa9qY1AFmVhn9hwkmbaYMBqAAqZ7cGFKFuFFlnKk25eOlmLQ87m/vD1gf8MVi8cLfF9Y9Mh29IT4sqexd1GCZe8v6aGT5DSBXmbgiCqXvMZ3l8WoiB7J4AFOqy9F76h0VgMhBWlU4Us325FsJ459MdCJkwu/81iw== 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=c+TnBRnQ9y+48u+r1ISq6xiy/lGMa2W0rDSzCcMc1zU=; b=woRKna3hWkaMbC4lwO52nLJWsWSIpBEXIJFGS9rmVRWKB9yxxAHAaCAF7Q6kqignrxpPwrTcuuA5+oQnI7kw8YT2EkQ75fLy/OJC4LihqN5c+4t01JtWI0CcpE0acYhXe9AiTzRwAuoCgYIKScENZgT4zRu27LolMsGluTHeGlk5YvGZP1SRG1pzBNQF36iQ42BJRHQ50TzrJkyXR4csW9BTKLiwNtKCt34WL8miqfTQhf2E1P/QluNK266Pz8CH9L38WxibMoUCyGSCVV7EKTESpAsHVptW+qerGMiuoefQ6uphN+Bxhw6lgK3eP0RTzPv9gm/5jeEICkjHkOIi9g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=dpdk.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=c+TnBRnQ9y+48u+r1ISq6xiy/lGMa2W0rDSzCcMc1zU=; b=itX2M2cYvQDGmAQ6yhSf2wH51JJ7RbychS4vUJc9e/zqDfayBB1jAnBaozqOuUCe1d/BsSrOsVn4E4csR998FPulT4y/rtwlq9lfgUONoYrYaXp2iHSsGT9TL18P+kIu/5wmSSdbhYYFossjzLu0zSSZXr3iZVb54veK5aOJMIs= Received: from MN2PR01CA0009.prod.exchangelabs.com (2603:10b6:208:10c::22) by MW6PR12MB7085.namprd12.prod.outlook.com (2603:10b6:303:238::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.29; Wed, 30 Oct 2024 04:41:33 +0000 Received: from BL02EPF0001A106.namprd05.prod.outlook.com (2603:10b6:208:10c:cafe::17) by MN2PR01CA0009.outlook.office365.com (2603:10b6:208:10c::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.17 via Frontend Transport; Wed, 30 Oct 2024 04:41:33 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BL02EPF0001A106.mail.protection.outlook.com (10.167.241.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8114.16 via Frontend Transport; Wed, 30 Oct 2024 04:41:33 +0000 Received: from BLRVIVARGHE.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Tue, 29 Oct 2024 23:41:02 -0500 From: Vipin Varghese To: , , , , , CC: , , , , , , , Subject: [RFC v2 0/3] Introduce Topology NUMA grouping for lcores Date: Wed, 30 Oct 2024 10:10:24 +0530 Message-ID: <20241030044035.1201-1-vipin.varghese@amd.com> X-Mailer: git-send-email 2.47.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF0001A106:EE_|MW6PR12MB7085:EE_ X-MS-Office365-Filtering-Correlation-Id: 8aa53c91-585e-4468-42f9-08dcf89d2145 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|376014|7416014|36860700013|82310400026; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?8ltwZHhXomv1+aKfJk5gH2umgPDCWzyA6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us-ascii?Q?OniTeNrIh9kmqBeyytV55Oz3Phtg8beoXMhZPtkotYRqUPoo1n+nFaLtJL/4?= =?us-ascii?Q?s8/T4pj3fdgc0r00iDMU//tKt3OJFsobxyj03CxHNnyXH92n+vAXeTi4rJhM?= =?us-ascii?Q?GllrZNDaXqX4l+vRY2TXRA+ph1x1YKMS4bKwh0K97wnoHw5vKRykDTax9jvy?= =?us-ascii?Q?2Nm77gs+6leKx42ZEkLlg0k4zrY5cX5U95r6eYdhloksrkFg2e/OeMqktLCK?= =?us-ascii?Q?0ThrtHNSQasoZq1ZnQQ9VtPJoNaw0PYaBh0wvkvoP+CuzFVVFfFYVwsTWYVl?= =?us-ascii?Q?aVm6oLZmAptDb8Yc/vyO2JucmN3gty/jcz+Zc6kPF3mjqk0HaXMucKpG63A8?= =?us-ascii?Q?quhO3LiLZ6kqevFG7USgKSy6mrJcs0J9q6FefdC5IRZtP6HpGj6mzozPq+zk?= =?us-ascii?Q?Geg76OXSqi1ZDIRyztTD+6FaIpUPNULCxRZycyAlFJxn/iyr7OGEQLSmZSCu?= =?us-ascii?Q?82QKIqgfuhHM+4TtUBqwdzm07MZjHxNzZCprD1sqmuxZsps7Lg=3D=3D?= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(1800799024)(376014)(7416014)(36860700013)(82310400026); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Oct 2024 04:41:33.0884 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8aa53c91-585e-4468-42f9-08dcf89d2145 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BL02EPF0001A106.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW6PR12MB7085 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 One of the way to increase core density in a given physical package is to use easy to replicate tiles. These tiles are either core complexes or core complexes with IO (memory and PCIe). This results to possibility of having two types NUMA topology. - CPU topology & IO topology - CPU+IO topology For platforms like - AMD SoC EPYC, core complexes are in separate CPU domain and IO are in different NUMA domain (except for zen1 Naples) - Intel 4th Xeon (SPR) & above, the CPU+IO NUMA partitioning is achieved by BIOS option `SNC as 1, 2 or 4`. - Ampere One allow CPU NUMA paritioning by BIOS option `SLC`. - while other platforms has 2 or 4 cores sharing same L2 cache. Grouping DPDK logical cores within the same Cache and IO, helps to leverage application same cache or IO locality. For applications to leverage cache or IO locality, ones needs to use lcores sharing same topology. This approach ensures more consistent latencies by minimizing the dispersion of lcores across different tiles. Using lcores in same NUMA domain shows imporvement for applications - using pipline staging - each lcore processing part of payload - eventual hit in either L2 or L3 Library dependency: hwloc Topology Flags: --------------- - RTE_LCORE_DOMAIN_L1: to group cores sharing same L1 cache - RTE_LCORE_DOMAIN_SMT: same as RTE_LCORE_DOMAIN_L1 - RTE_LCORE_DOMAIN_L2: group cores sharing same L2 cache - RTE_LCORE_DOMAIN_L3: group cores sharing same L3 cache - RTE_LCORE_DOMAIN_IO: group cores sharing same IO < Function: Purpose > --------------------- - rte_get_domain_count: get domain count based on Topology Flag - rte_lcore_count_from_domain: get valid lcores count under each domain - rte_get_lcore_in_domain: valid lcore id based on index - rte_get_next_lcore_from_domain: next valid lcore within domain - rte_get_next_lcore_from_next_domain: next valid lcore from next domain Note: 1. Topology is NUMA grouping. 2. Domain is various sub-groups within a specific Topology. Topology example: L1, L2, L3, IO Domian example: IO-A, IO-B < MACRO: Purpose > ------------------ - RTE_LCORE_FOREACH_DOMAIN: iterate lcores from all domains - RTE_LCORE_FOREACH_WORKER_DOMAIN: iterate worker lcores from all domains - RTE_LCORE_FORN_NEXT_DOMAIN: iterate domain select n'th lcore - RTE_LCORE_FORN_WORKER_NEXT_DOMAIN: iterate domain for worker n'th lcore. Future work (after merge): -------------------------- - dma-perf per IO NUMA - eventdev per L3 NUMA - pipeline per SMT|L3 NUMA - distributor per L3 for Port-Queue - l2fwd-power per SMT - testpmd option for IO NUMA per port Platform tested on: ------------------- - INTEL(R) XEON(R) PLATINUM 8562Y+ (support IO numa 1 & 2) - AMD EPYC 8534P (supports IO numa 1 & 2) - AMD EPYC 9554 (supports IO numa 1, 2, 4) Logs: ----- 1. INTEL(R) XEON(R) PLATINUM 8562Y+: - SNC=1 Domain (IO): at index (0) there are 48 core, with (0) at index 0 - SNC=2 Domain (IO): at index (0) there are 24 core, with (0) at index 0 Domain (IO): at index (1) there are 24 core, with (12) at index 0 2. AMD EPYC 8534P: - NPS=1: Domain (IO): at index (0) there are 128 core, with (0) at index 0 - NPS=2: Domain (IO): at index (0) there are 64 core, with (0) at index 0 Domain (IO): at index (1) there are 64 core, with (32) at index 0 Signed-off-by: Vipin Varghese Vipin Varghese (3): eal/lcore: add topology based functions test/lcore: enable tests for topology examples: add lcore topology API calls app/test/test_lcores.c | 189 ++++++++++ config/meson.build | 18 + examples/helloworld/main.c | 142 +++++++- examples/l2fwd/main.c | 56 ++- examples/skeleton/basicfwd.c | 22 ++ lib/eal/common/eal_common_lcore.c | 580 ++++++++++++++++++++++++++++++ lib/eal/common/eal_private.h | 48 +++ lib/eal/freebsd/eal.c | 10 + lib/eal/include/rte_lcore.h | 168 +++++++++ lib/eal/linux/eal.c | 11 + lib/eal/meson.build | 4 + lib/eal/version.map | 9 + lib/eal/windows/eal.c | 12 + 13 files changed, 1259 insertions(+), 10 deletions(-) -- 2.34.1