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 C5B6446A63 for ; Thu, 26 Jun 2025 14:06:28 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BEF694026B; Thu, 26 Jun 2025 14:06:28 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2070.outbound.protection.outlook.com [40.107.92.70]) by mails.dpdk.org (Postfix) with ESMTP id AA0D8400D6 for ; Thu, 26 Jun 2025 14:06:26 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ZcFiUB8X7UHs5x0mO1XDYN0T08u0gscQV/k4oAs/A3IO7sB+cu0CB7RmHBXNNPonmjxB/CHsohj2Mhl1mpR5lO7F/OIcmaGYg+GU4Q53pdKZHdrPfjZLMNsLWxZhWKBy3c6l9c+F040eMXAZOj0UStOBN9tcnfP8+5l1QsqfFHuOcnW77Nd2W7hXJvg471+mP8PETFkVyiznTNgiqusjMhqZjX4CKSfz9l0fUJYfAYdXaKSjQpDMed3fzQ+r2iti/RVRE3+kicXFbrCY8Cs9bLen/zfwpKdIt5y2zvG+SdrRX3Knjz2Mb3IOnuTCSEQ313clR9FGiWyfM1MvEgwobg== 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=sQ7/0rAQ2xj+UTXBqFb8vCitY/TZaRIXG+K7jYpkKvc=; b=m8egA1VzrffghL38UmQcmAiVXtBNmr/XrCApRaH3aeaF1lekBg2Vskj+IJJT6gc4FYUCWEcwkYjoJKyUoBzTGXqflmLppUtfrmhDvM+KyWp20fnFeym+QdrsAuazfXfMSqsuJOQsCCNPeGSrXTYyx2u2aV5OSfRWFkulw4eTE8zfhax0jqpjM4gNu0fQpZ3RW4rq8Gzhfnx+F0ETrJUPSh56ZKQsXGSBhV2h0p3FY8IPoomWXslombhip0UxPTQKpLGkqGgE/qfLLUoGvTeX2SJATYIUvuRMRHgQWgZoPFUQOmsnKSfC3GB/Pk4YAWyMMLeCSDf6Wb6fH0P6C7fTCA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=microsoft.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=sQ7/0rAQ2xj+UTXBqFb8vCitY/TZaRIXG+K7jYpkKvc=; b=at04I4iqrxMsaKI6zZPzGBb37FxdSqYMwdxgp2MJAD7gfYW/2cb0XvzqPXzytHDyj9J5Zewe7VX6j5WtHxFUFwtyNYPqNOF6DSiZzEKrIbRu/DRY85TRywGoVSStyJJ+sVANgP8y3I3AAh3p8wyN0MB1McvD+xig2fLvd+LGuKr7hnsauDlQfxN2CZo6Cznc0nYGFbXWlWQhPZcYKqhbKKBO8Vi6Uha4nlpAk0UG3JQy1iAvfWqyx153e4h2K9Ohdh6LXzoeZsjgAtzDW/ixupWC7Pp9+IjwL+uYxWgbnTsgTE6VeE04vyLMd1wU0wMLQjUxTm3sMKghacjS2F1tmw== Received: from MW4PR03CA0285.namprd03.prod.outlook.com (2603:10b6:303:b5::20) by PH7PR12MB6737.namprd12.prod.outlook.com (2603:10b6:510:1a8::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8857.20; Thu, 26 Jun 2025 12:06:24 +0000 Received: from SJ5PEPF000001D0.namprd05.prod.outlook.com (2603:10b6:303:b5:cafe::19) by MW4PR03CA0285.outlook.office365.com (2603:10b6:303:b5::20) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8880.21 via Frontend Transport; Thu, 26 Jun 2025 12:06:23 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) 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.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by SJ5PEPF000001D0.mail.protection.outlook.com (10.167.242.52) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8880.14 via Frontend Transport; Thu, 26 Jun 2025 12:06:23 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Thu, 26 Jun 2025 05:06:07 -0700 Received: from nvidia.com (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.14; Thu, 26 Jun 2025 05:06:06 -0700 From: Xueming Li To: Long Li CC: Xueming Li , dpdk stable Subject: patch 'net/netvsc: use Hyper-V page size' has been queued to stable release 23.11.5 Date: Thu, 26 Jun 2025 20:01:08 +0800 Message-ID: <20250626120145.27369-49-xuemingl@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250626120145.27369-1-xuemingl@nvidia.com> References: <20250626120145.27369-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ5PEPF000001D0:EE_|PH7PR12MB6737:EE_ X-MS-Office365-Filtering-Correlation-Id: 53e82476-4f27-40c3-ee2f-08ddb4a9dee4 X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700013|1800799024|82310400026|376014|7053199007; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?MHclxpUemBT+CzG6cntZSASUTd7pMDpVvF3o3Cmj1NrbPkon0IpugVGLXxia?= =?us-ascii?Q?Jjh42Fbl1EupegzoTD73qYhkOfwCt8lZoeBL8DzZvaR3mauDvFtwBCRPjK2l?= =?us-ascii?Q?0ichbrHsR8R1SBY41sfaVmVkrgg5G9xCH1DRNKKcihDzDuCPn9FVaBQ269CR?= =?us-ascii?Q?585ioTgHibVlWdx+BgkRWfd97gDmJzp6js+/gRmtLy0Rq0OFtYw5OIgvIxlB?= =?us-ascii?Q?jVkpPBRZ+Y6w6gtKv7ghjJRrntzBpyxrcWpwG9BprRb5FS3anhIDa7LHHw/s?= =?us-ascii?Q?l2Ylk8+na85cHACT0xlhKd9e1xy32ChCpjbE8lvxvcXiPx26raOv6BFwXOfQ?= =?us-ascii?Q?fMy72jR2DJjYtq0r7qM8i6ndOIfnTeT9IoEqXMlK7xu6SHVR5Dblc9o6UgyM?= =?us-ascii?Q?Wx6u3MbkivoZhzXHPcmUuUTIYCQ/AhkfsSuvOAUC8tEA6/PaSDJsKUM1L4Ju?= =?us-ascii?Q?cbcS6B6ECPvnANXyFfZRnliFaeGYSJSqSS4ny1wiau8p7jtjhS6fkgULYN7U?= =?us-ascii?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fBfI2j8rwIGRe3966uDsDKr3pVlNs?= =?us-ascii?Q?93VPza2zpP6PSfiiT8ubQ/WWITSoYqeXreJKObEhHC2Pg5nlvSAXsFzpwZ89?= =?us-ascii?Q?woB4A36hYKvoR3vuZbE0idQLdhbofoce0qiSorYh9xeGeTjeEv9Xjjo0Cw?= =?us-ascii?Q?=3D=3D?= X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230040)(36860700013)(1800799024)(82310400026)(376014)(7053199007); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jun 2025 12:06:23.8151 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 53e82476-4f27-40c3-ee2f-08ddb4a9dee4 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SJ5PEPF000001D0.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB6737 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.5 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 06/28/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://git.dpdk.org/dpdk-stable/log/?h=23.11-staging This queued commit can be viewed at: https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=8622aa0e758603798b8ae0167358ee005dee7421 Thanks. Xueming Li --- >From 8622aa0e758603798b8ae0167358ee005dee7421 Mon Sep 17 00:00:00 2001 From: Long Li Date: Fri, 18 Apr 2025 12:32:50 -0700 Subject: [PATCH] net/netvsc: use Hyper-V page size Cc: Xueming Li [ upstream commit 2e81551053fcfc7d57b8907a2a8720805298d723 ] The driver should always use Hyper-V page size for implementing RNDIS and calculating PFN (Page Frame Number) for communicating with Hyper-V VSP. It should not use system page size as it may be different to the Hyper-V page size. Fixes: 4e9c73e96e83 ("net/netvsc: add Hyper-V network device") Signed-off-by: Long Li --- drivers/net/netvsc/hn_rndis.c | 14 +++++++------- drivers/net/netvsc/hn_rxtx.c | 16 ++++++++-------- drivers/net/netvsc/hn_var.h | 4 ---- 3 files changed, 15 insertions(+), 19 deletions(-) diff --git a/drivers/net/netvsc/hn_rndis.c b/drivers/net/netvsc/hn_rndis.c index 1ba75ee804..690d1289c2 100644 --- a/drivers/net/netvsc/hn_rndis.c +++ b/drivers/net/netvsc/hn_rndis.c @@ -67,7 +67,7 @@ hn_rndis_rid(struct hn_data *hv) static void *hn_rndis_alloc(size_t size) { - return rte_zmalloc("RNDIS", size, rte_mem_page_size()); + return rte_zmalloc("RNDIS", size, HYPERV_PAGE_SIZE); } #ifdef RTE_LIBRTE_NETVSC_DEBUG_DUMP @@ -265,17 +265,17 @@ static int hn_nvs_send_rndis_ctrl(struct vmbus_channel *chan, return -EINVAL; } - if (unlikely(reqlen > rte_mem_page_size())) { + if (unlikely(reqlen > HYPERV_PAGE_SIZE)) { PMD_DRV_LOG(ERR, "RNDIS request %u greater than page size", reqlen); return -EINVAL; } - sg.page = addr / rte_mem_page_size(); - sg.ofs = addr & PAGE_MASK; + sg.page = addr / HYPERV_PAGE_SIZE; + sg.ofs = addr & HYPERV_PAGE_MASK; sg.len = reqlen; - if (sg.ofs + reqlen > rte_mem_page_size()) { + if (sg.ofs + reqlen > HYPERV_PAGE_SIZE) { PMD_DRV_LOG(ERR, "RNDIS request crosses page boundary"); return -EINVAL; } @@ -480,7 +480,7 @@ hn_rndis_query(struct hn_data *hv, uint32_t oid, return -ENOMEM; comp_len = sizeof(*comp) + odlen; - comp = rte_zmalloc("QUERY", comp_len, rte_mem_page_size()); + comp = rte_zmalloc("QUERY", comp_len, HYPERV_PAGE_SIZE); if (!comp) { error = -ENOMEM; goto done; @@ -737,7 +737,7 @@ hn_rndis_set(struct hn_data *hv, uint32_t oid, const void *data, uint32_t dlen) int error; reqlen = sizeof(*req) + dlen; - req = rte_zmalloc("RNDIS_SET", reqlen, rte_mem_page_size()); + req = rte_zmalloc("RNDIS_SET", reqlen, HYPERV_PAGE_SIZE); if (!req) return -ENOMEM; diff --git a/drivers/net/netvsc/hn_rxtx.c b/drivers/net/netvsc/hn_rxtx.c index eea120ae82..1db0cecd96 100644 --- a/drivers/net/netvsc/hn_rxtx.c +++ b/drivers/net/netvsc/hn_rxtx.c @@ -1443,10 +1443,10 @@ static unsigned int hn_get_slots(const struct rte_mbuf *m) while (m) { unsigned int size = rte_pktmbuf_data_len(m); - unsigned int offs = rte_mbuf_data_iova(m) & PAGE_MASK; + unsigned int offs = rte_mbuf_data_iova(m) & HYPERV_PAGE_MASK; - slots += (offs + size + rte_mem_page_size() - 1) / - rte_mem_page_size(); + slots += (offs + size + HYPERV_PAGE_SIZE - 1) / + HYPERV_PAGE_SIZE; m = m->next; } @@ -1461,13 +1461,13 @@ static unsigned int hn_fill_sg(struct vmbus_gpa *sg, while (m) { rte_iova_t addr = rte_mbuf_data_iova(m); - unsigned int page = addr / rte_mem_page_size(); - unsigned int offset = addr & PAGE_MASK; + unsigned int page = addr / HYPERV_PAGE_SIZE; + unsigned int offset = addr & HYPERV_PAGE_MASK; unsigned int len = rte_pktmbuf_data_len(m); while (len > 0) { unsigned int bytes = RTE_MIN(len, - rte_mem_page_size() - offset); + HYPERV_PAGE_SIZE - offset); sg[segs].page = page; sg[segs].ofs = offset; @@ -1510,8 +1510,8 @@ static int hn_xmit_sg(struct hn_tx_queue *txq, addr = txq->tx_rndis_iova + ((char *)txd->rndis_pkt - (char *)txq->tx_rndis); - sg[0].page = addr / rte_mem_page_size(); - sg[0].ofs = addr & PAGE_MASK; + sg[0].page = addr / HYPERV_PAGE_SIZE; + sg[0].ofs = addr & HYPERV_PAGE_MASK; sg[0].len = RNDIS_PACKET_MSG_OFFSET_ABS(hn_rndis_pktlen(txd->rndis_pkt)); segs = 1; diff --git a/drivers/net/netvsc/hn_var.h b/drivers/net/netvsc/hn_var.h index e37946804d..628c6a5d4b 100644 --- a/drivers/net/netvsc/hn_var.h +++ b/drivers/net/netvsc/hn_var.h @@ -31,10 +31,6 @@ #define HN_RX_EXTMBUF_ENABLE 0 -#ifndef PAGE_MASK -#define PAGE_MASK (rte_mem_page_size() - 1) -#endif - struct hn_data; struct hn_txdesc; -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2025-06-26 19:59:19.691900848 +0800 +++ 0048-net-netvsc-use-Hyper-V-page-size.patch 2025-06-26 19:59:17.394418044 +0800 @@ -1 +1 @@ -From 2e81551053fcfc7d57b8907a2a8720805298d723 Mon Sep 17 00:00:00 2001 +From 8622aa0e758603798b8ae0167358ee005dee7421 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 2e81551053fcfc7d57b8907a2a8720805298d723 ] @@ -13 +15,0 @@ -Cc: stable@dpdk.org @@ -23 +25 @@ -index b2dae6474a..24723ff842 100644 +index 1ba75ee804..690d1289c2 100644 @@ -76 +78 @@ -index 9d3948e03d..c79d971904 100644 +index eea120ae82..1db0cecd96 100644 @@ -79 +81 @@ -@@ -1431,10 +1431,10 @@ static unsigned int hn_get_slots(const struct rte_mbuf *m) +@@ -1443,10 +1443,10 @@ static unsigned int hn_get_slots(const struct rte_mbuf *m) @@ -93 +95 @@ -@@ -1449,13 +1449,13 @@ static unsigned int hn_fill_sg(struct vmbus_gpa *sg, +@@ -1461,13 +1461,13 @@ static unsigned int hn_fill_sg(struct vmbus_gpa *sg, @@ -110 +112 @@ -@@ -1498,8 +1498,8 @@ static int hn_xmit_sg(struct hn_tx_queue *txq, +@@ -1510,8 +1510,8 @@ static int hn_xmit_sg(struct hn_tx_queue *txq, @@ -122 +124 @@ -index 0f638bc5fd..f946b3d8ef 100644 +index e37946804d..628c6a5d4b 100644