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 56FAB470AE for ; Sun, 21 Dec 2025 16:01:33 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5065D4025F; Sun, 21 Dec 2025 16:01:33 +0100 (CET) Received: from PH0PR06CU001.outbound.protection.outlook.com (mail-westus3azon11011010.outbound.protection.outlook.com [40.107.208.10]) by mails.dpdk.org (Postfix) with ESMTP id BFD584025F for ; Sun, 21 Dec 2025 16:01:31 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ciCorG1+r2icY3M3wD3R+U22wrvE0l+YoXMRXGCUD0S+l0eEWHu+RfQYoxT3PpGUhtF85hAMI9bEogIl6zaELJZQraK/0amuPImfJ64BC3gp4UEJoV38ROz2Ef/jxZzyAcP0ts+DydsAZPkLDoZ5DZ22PbFCS5n6wGEaV+rXzwFtdRACRpJqh4ZmizsqFykUWXD1AYk8jPG0IGKeo6L9bVQIWCqMx56VrK65DNbkRKnB5TfeMWPGxgC8H8nZrFQiYSJK3vGaRuJlK2tRrE4icmgtpCuI7/0t0sA3oXPu+O6kByJ6x0BMY3kwIc+25nhOVAdTBA6U/LVZRf7PK/k2pw== 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=PdwZz9OYDjomWL1XzvfG2RVxOyRTjtxt1FOPzA/EJoM=; b=yidiRoeenlFAc1dSGXPD423KxdGle5dmG7MIdxjL0LtEPD6peadNZnrgZr5tlUjSRTxJmdRg734M5l4oKf4mMx7l1CuOLg1DfNnZoV6ROpkPGKZ3hRp9TqnJy8QHwzmqtXk8gtu38sWAlIHmX13qCz5chsjddUEZDi0zRNG0/mdEwuCEaOcZTw/2CZ3hGQJ2W656/g0S+/lA6TyzKGoXOrnjIcTLEThD1xdHvl2rZtfpKw+q4gWz7ef5VAXV0z4s/UfdYP5OD3iOGlaJm+Iw1e9u8G/lPro8Wvr++mka1mw4s+H8NHkiACpVxKcVc6r7U0MfGW+TBOo8py/Yip94eg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.232) smtp.rcpttodomain=intel.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=PdwZz9OYDjomWL1XzvfG2RVxOyRTjtxt1FOPzA/EJoM=; b=SIoo/yXXdEUBK1o4fdIQW9LagrX49WqGBjszuYvdmN0sytUdoTEMG3qtgO4xXj7KTSbUKZ82ODAnBGBDu16JGXMn2umYiX6C7G8QAkCKQutx2bCdF0+rGySQViazsdcuIpf9Gi/fNpUkvhVwj7+j7/4zluRI2k0vF758h49oW6CicNXGZt+Gf5KhSCGWusyFsd4QgGwVLVRHAgOvoJeRiaShYkRJDAU5CCOVzGZmK7q3Fl8zacU6oV6e2qFyt09i6dcbQKtFdoq4eiVRmVAZMoGkdcVi9/nE0BQvnUp1AIzRunZIeKVxDETqjge5anznZiMBcUydJHy30xXrzpCV5w== Received: from DM6PR02CA0038.namprd02.prod.outlook.com (2603:10b6:5:177::15) by IA1PR12MB6260.namprd12.prod.outlook.com (2603:10b6:208:3e4::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9434.10; Sun, 21 Dec 2025 15:01:27 +0000 Received: from CY4PEPF0000E9D6.namprd05.prod.outlook.com (2603:10b6:5:177:cafe::af) by DM6PR02CA0038.outlook.office365.com (2603:10b6:5:177::15) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9434.10 via Frontend Transport; Sun, 21 Dec 2025 15:01:27 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.232) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.118.232 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.232; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.232) by CY4PEPF0000E9D6.mail.protection.outlook.com (10.167.241.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9456.9 via Frontend Transport; Sun, 21 Dec 2025 15:01:27 +0000 Received: from drhqmail201.nvidia.com (10.126.190.180) by mail.nvidia.com (10.127.129.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20; Sun, 21 Dec 2025 07:01:22 -0800 Received: from drhqmail203.nvidia.com (10.126.190.182) by drhqmail201.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20; Sun, 21 Dec 2025 07:01:22 -0800 Received: from nvidia.com (10.127.8.12) by mail.nvidia.com (10.126.190.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20 via Frontend Transport; Sun, 21 Dec 2025 07:01:20 -0800 From: Shani Peretz To: Shani Peretz CC: Anatoly Burakov , dpdk stable Subject: patch 'eal: fix DMA mask validation with IOVA mode option' has been queued to stable release 23.11.6 Date: Sun, 21 Dec 2025 16:56:27 +0200 Message-ID: <20251221145746.763179-39-shperetz@nvidia.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251221145746.763179-1-shperetz@nvidia.com> References: <20251221145746.763179-1-shperetz@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000E9D6:EE_|IA1PR12MB6260:EE_ X-MS-Office365-Filtering-Correlation-Id: 4a63ed12-6e2d-40b0-cb50-08de40a1d0fa X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700013|82310400026|1800799024|376014|13003099007|7053199007; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?jJyYk4+7Qpd5utVoKTXzmmWB+Qn4XIZqk6t9Gtrb/120u2yNRI8h5zUbGxiX?= =?us-ascii?Q?q56s6qnYEfLBV9CYdpgbLzRvdSMZZaxt149kTBfHO2KiZeArp6q/b/7epvT1?= =?us-ascii?Q?LdxZGhaS6upbXoBhSxgnCywoqk25Rr0krjj2dKuNERoqScgktFcw+fUUCdDd?= =?us-ascii?Q?tt0JB9zBHeoqBkyCQz6oac66JR+EHfgUzBSI3FDr7fqHya8AeIRPT8DdgBMJ?= =?us-ascii?Q?anqUbonyPwrskb6gocRUwI2i8l5bj2Vj+Fhnu/bWdcOaO8oaGNjeHZW7fTqG?= =?us-ascii?Q?NocGASqvyz6U1d6+1f8KmrL0kX/L6c0N1bh4pYynC+ug96ie0nRr34ni2rl/?= =?us-ascii?Q?5bkdxJwvaXeBz/kGFL1jQuODJ3udQmzsBiSNHuvzWpnfTI89A0wE3KkGm65Q?= =?us-ascii?Q?nZytE0Uq1BYk7CmfODjgjT9CiESxQOYrLUxSo8scv4p6bj4pqzUKwXARQ5G6?= =?us-ascii?Q?B1Sh8QBswJZ0qU4rxELDgwQsvM1RUTBosKLOQs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hP6SOCWQo8kOR52uBTv6v9Lydi4Ic+rTGYNs0kGLjk7dXeIBuMTmBH8LnP?= =?us-ascii?Q?C7AP7krvZucgE2sy43oSWAq0brf+4KO/BzB1S2aJ4A5ZDiEpb1mBpPH8OQlY?= =?us-ascii?Q?T+kpppjshpNvEhSt2M6hSE8utW6JznQMJjaZ6dnPfk3m+bPCXV+7XtNHj4Ap?= =?us-ascii?Q?BV7GO2oDZ2T3Av1zSMYO8V4M88iaXSzswJzBpf0I?= X-Forefront-Antispam-Report: CIP:216.228.118.232; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc7edge1.nvidia.com; CAT:NONE; SFS:(13230040)(36860700013)(82310400026)(1800799024)(376014)(13003099007)(7053199007); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Dec 2025 15:01:27.2735 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4a63ed12-6e2d-40b0-cb50-08de40a1d0fa X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.118.232]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CY4PEPF0000E9D6.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB6260 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 23.11.6 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 12/26/25. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/shanipr/dpdk-stable This queued commit can be viewed at: https://github.com/shanipr/dpdk-stable/commit/3fb6becd148b561613b8bbf643d7b2d0211d30e9 Thanks. Shani --- >From 3fb6becd148b561613b8bbf643d7b2d0211d30e9 Mon Sep 17 00:00:00 2001 From: Shani Peretz Date: Thu, 18 Sep 2025 09:47:54 +0300 Subject: [PATCH] eal: fix DMA mask validation with IOVA mode option [ upstream commit e37ff4ef296f33e4c3a0e9306241c4f8fcae5061 ] When --iova-mode is explicitly specified in command line, DMA mask constraints were not being validated, leading to potential runtime failures when device DMA capabilities are exceeded. The issue occurred because rte_bus_get_iommu_class() was only called during IOVA mode auto-detection, but this function has the important side effect of triggering DMA mask detection (e.g., Intel IOMMU address width checking via pci_device_iommu_support_va()). This created an inconsistency, when choosing explicit mode, the DMA checks are bypassed, but when choosing auto-detection mode, the constraints are checked and enforced. The fix moves rte_bus_get_iommu_class() outside the conditional logic to ensure it's always called during EAL initialization. Fixes: 4374ebc24bc1 ("malloc: modify error message for DMA mask check") Signed-off-by: Shani Peretz Acked-by: Anatoly Burakov --- lib/eal/freebsd/eal.c | 6 +++++- lib/eal/linux/eal.c | 5 ++++- lib/eal/windows/eal.c | 5 ++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/lib/eal/freebsd/eal.c b/lib/eal/freebsd/eal.c index eb62bfdcd3..bf9ff1d5cc 100644 --- a/lib/eal/freebsd/eal.c +++ b/lib/eal/freebsd/eal.c @@ -693,12 +693,16 @@ rte_eal_init(int argc, char **argv) * with a message describing the cause. */ has_phys_addr = internal_conf->no_hugetlbfs == 0; + + /* Always call rte_bus_get_iommu_class() to trigger DMA mask detection and validation */ + enum rte_iova_mode bus_iova_mode = rte_bus_get_iommu_class(); + iova_mode = internal_conf->iova_mode; if (iova_mode == RTE_IOVA_DC) { RTE_LOG(DEBUG, EAL, "Specific IOVA mode is not requested, autodetecting\n"); if (has_phys_addr) { RTE_LOG(DEBUG, EAL, "Selecting IOVA mode according to bus requests\n"); - iova_mode = rte_bus_get_iommu_class(); + iova_mode = bus_iova_mode; if (iova_mode == RTE_IOVA_DC) { if (!RTE_IOVA_IN_MBUF) { iova_mode = RTE_IOVA_VA; diff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c index b3b69a090a..b132ebad51 100644 --- a/lib/eal/linux/eal.c +++ b/lib/eal/linux/eal.c @@ -1067,10 +1067,13 @@ rte_eal_init(int argc, char **argv) phys_addrs = rte_eal_using_phys_addrs() != 0; + /* Always call rte_bus_get_iommu_class() to trigger DMA mask detection and validation */ + enum rte_iova_mode bus_iova_mode = rte_bus_get_iommu_class(); + /* if no EAL option "--iova-mode=", use bus IOVA scheme */ if (internal_conf->iova_mode == RTE_IOVA_DC) { /* autodetect the IOVA mapping mode */ - enum rte_iova_mode iova_mode = rte_bus_get_iommu_class(); + enum rte_iova_mode iova_mode = bus_iova_mode; if (iova_mode == RTE_IOVA_DC) { RTE_LOG(DEBUG, EAL, "Buses did not request a specific IOVA mode.\n"); diff --git a/lib/eal/windows/eal.c b/lib/eal/windows/eal.c index 7ec2152211..ede69f120b 100644 --- a/lib/eal/windows/eal.c +++ b/lib/eal/windows/eal.c @@ -361,12 +361,15 @@ rte_eal_init(int argc, char **argv) has_phys_addr = false; } + /* Always call rte_bus_get_iommu_class() to trigger DMA mask detection and validation */ + enum rte_iova_mode bus_iova_mode = rte_bus_get_iommu_class(); + iova_mode = internal_conf->iova_mode; if (iova_mode == RTE_IOVA_DC) { RTE_LOG(DEBUG, EAL, "Specific IOVA mode is not requested, autodetecting\n"); if (has_phys_addr) { RTE_LOG(DEBUG, EAL, "Selecting IOVA mode according to bus requests\n"); - iova_mode = rte_bus_get_iommu_class(); + iova_mode = bus_iova_mode; if (iova_mode == RTE_IOVA_DC) { if (!RTE_IOVA_IN_MBUF) { iova_mode = RTE_IOVA_VA; -- 2.43.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2025-12-21 16:54:19.326237567 +0200 +++ 0039-eal-fix-DMA-mask-validation-with-IOVA-mode-option.patch 2025-12-21 16:54:17.029053000 +0200 @@ -1 +1 @@ -From e37ff4ef296f33e4c3a0e9306241c4f8fcae5061 Mon Sep 17 00:00:00 2001 +From 3fb6becd148b561613b8bbf643d7b2d0211d30e9 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit e37ff4ef296f33e4c3a0e9306241c4f8fcae5061 ] + @@ -23 +24,0 @@ -Cc: stable@dpdk.org @@ -34 +35 @@ -index c1ab8d86d2..0f957919d3 100644 +index eb62bfdcd3..bf9ff1d5cc 100644 @@ -37 +38 @@ -@@ -670,12 +670,16 @@ rte_eal_init(int argc, char **argv) +@@ -693,12 +693,16 @@ rte_eal_init(int argc, char **argv) @@ -47 +48 @@ - EAL_LOG(DEBUG, "Specific IOVA mode is not requested, autodetecting"); + RTE_LOG(DEBUG, EAL, "Specific IOVA mode is not requested, autodetecting\n"); @@ -49 +50 @@ - EAL_LOG(DEBUG, "Selecting IOVA mode according to bus requests"); + RTE_LOG(DEBUG, EAL, "Selecting IOVA mode according to bus requests\n"); @@ -56 +57 @@ -index 52efb8626b..3a0c9c9db6 100644 +index b3b69a090a..b132ebad51 100644 @@ -59 +60 @@ -@@ -1042,10 +1042,13 @@ rte_eal_init(int argc, char **argv) +@@ -1067,10 +1067,13 @@ rte_eal_init(int argc, char **argv) @@ -73 +74 @@ - EAL_LOG(DEBUG, "Buses did not request a specific IOVA mode."); + RTE_LOG(DEBUG, EAL, "Buses did not request a specific IOVA mode.\n"); @@ -75 +76 @@ -index 4f0a164d9b..2502ec3c3d 100644 +index 7ec2152211..ede69f120b 100644 @@ -78 +79 @@ -@@ -348,12 +348,15 @@ rte_eal_init(int argc, char **argv) +@@ -361,12 +361,15 @@ rte_eal_init(int argc, char **argv) @@ -87 +88 @@ - EAL_LOG(DEBUG, "Specific IOVA mode is not requested, autodetecting"); + RTE_LOG(DEBUG, EAL, "Specific IOVA mode is not requested, autodetecting\n"); @@ -89 +90 @@ - EAL_LOG(DEBUG, "Selecting IOVA mode according to bus requests"); + RTE_LOG(DEBUG, EAL, "Selecting IOVA mode according to bus requests\n");