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 D9755A0543 for ; Tue, 21 Jun 2022 10:03:51 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D4AE1427F0; Tue, 21 Jun 2022 10:03:51 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2048.outbound.protection.outlook.com [40.107.223.48]) by mails.dpdk.org (Postfix) with ESMTP id 45AB7427F0 for ; Tue, 21 Jun 2022 10:03:51 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=C3pmAuz/ZfDKWoqWlI1zTyD/8eY8fbokFa0+aQ3uYcT6apNhHR4WbPFRpKJzcz1AY9v00P+5/jNJ9ZxRYc6xx+8P2EbtP86IUQLh4Ut4SC/n6ewQ7KV+GMYOWBDfNSxHxoGEXjwjtW6YN86zxDPiym4Q3Jmd+SiCOcaqZoeKFHZ3ngS54UXa3aGKsu18rxRudzxU8pps1KP1pnwiFhJM4Fpj29GKg2uHCmc4soeHaDtzNp2PkHFqEz32imMZ73hQmEn8q+uT14PRW7I09PJh46TjlVntbdBjmndLOdn2gB7NjZZ1JbM9pY2J2hh8gqmr0kTJHvX1+nj0HORU2eagQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=H1sFIJTTXohPN/TlR0iH4pxlsV7WDA5+4PsKuLfbWR0=; b=eycaDgKsh2NMeFepuH/riMggU9QulXm2kB3ZLZVVgq/YLMvdU3hz7mXjeIEMWbicBtm71f/JmKEvX3Oh9Zge2vuzY0aUoEYYcSUBy0e5xVT3yMrYu2wF6DEYZqn8U4OehYgf0zJJ8u80QOoCTXX+0Zczc1/3MpZ0sRDK+z4g9/rZTFmoTq+d5GanFjWBTUnBK5Uu2H1i1gAQ+NYKLUClZuMCWR9njfI5kajx8OyP4vKKhO8TBztJ0jQs3tsDhJtI6Bfh9Tzbsw29kTO7K+A7PAbIjz7TzCcyLMujf+4N4rFTY1M7/qc3BbP/trsqicVvDatN3fqsHCig14oyTNTdQQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.235) smtp.rcpttodomain=xilinx.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 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=H1sFIJTTXohPN/TlR0iH4pxlsV7WDA5+4PsKuLfbWR0=; b=BfBEJ4N/bOw0k1BmcKuw3BCVJlhc3GXripAcGDKYWFgb2iyKkS4rve0GYjASA7A7e0KOAN48CVnqLt3/k3z05NjBPVKGkCtySAIT45aIBSynrQzIBbJOUeAvLjhKJroF3TPG29yZCHLAIlGbzPVJqP/cBYTsfjZkmEo7aXDJeSrOA84113MNY4nd6jDSAudQXsJTN/ak+QN4jXtZrefgrLbZKXbbhZ3hBEWYLT5rNEA7s1NKiNkK8HonXkJii1Jh49JVxqW2C557tORsY/xi8C2p42cwRhL7xGNpaPTL1uP0l7CUnBmpxo91lN4jts8KmdPWUonPUfs4a1GUqvWCeg== Received: from MWHPR18CA0071.namprd18.prod.outlook.com (2603:10b6:300:39::33) by CY4PR12MB1798.namprd12.prod.outlook.com (2603:10b6:903:11a::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5353.18; Tue, 21 Jun 2022 08:03:49 +0000 Received: from CO1NAM11FT042.eop-nam11.prod.protection.outlook.com (2603:10b6:300:39:cafe::2) by MWHPR18CA0071.outlook.office365.com (2603:10b6:300:39::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5353.22 via Frontend Transport; Tue, 21 Jun 2022 08:03:49 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.235) 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 12.22.5.235 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.235; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (12.22.5.235) by CO1NAM11FT042.mail.protection.outlook.com (10.13.174.250) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5353.14 via Frontend Transport; Tue, 21 Jun 2022 08:03:48 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL107.nvidia.com (10.27.9.16) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Tue, 21 Jun 2022 08:03:48 +0000 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.986.22; Tue, 21 Jun 2022 01:03:46 -0700 From: Xueming Li To: Long Li CC: Stephen Hemminger , Ferruh Yigit , dpdk stable Subject: patch 'net/netvsc: fix calculation of checksums based on mbuf flag' has been queued to stable release 20.11.6 Date: Tue, 21 Jun 2022 11:01:14 +0300 Message-ID: <20220621080301.2315720-9-xuemingl@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220621080301.2315720-1-xuemingl@nvidia.com> References: <20220621080301.2315720-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: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: efc33bce-6e1e-45eb-1bbc-08da535c92c5 X-MS-TrafficTypeDiagnostic: CY4PR12MB1798:EE_ X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JxwsC5zDikyqOkJvdWq+6BH25pmFGpc4AcTh//rMmaTy3THLQY7IbaEyuwQIu13pFRBcthlVvNamGi4HfY/jazi26Rr0G5Rn12umpywS3jGt8miQb9iKlhNnjMwc9TowGfu9VjQ3v/Bs5/nm+KeQ066X5bLgmTK5ecl/v7N6tkFaeZLkKHnrE93oMCauUrJf3HyLTO/Xa+QN/bXkyWv+Pbb1TfX4tFfHHOkUWsuULnL8OJw/x3L0vKIvWX3uYyJCueEhSA5npp38EPRIr/i06yuG0xrBESEdJqyR1CigTmb3jGSwwleShty+6adngPO0VaKkdxjd2Tet2GkL+d+4SoxVhkMDwm0Z2Z9x12J2V/jG8I7A2T0l5HdraIlpjVdBFMzNPN+cVYgN8k0Oo7YutVR0AoB9bj2SItLziQ9X5uWj5A2pRLRK6DiQm+Sdf9z/kNqSptpBsPM1KS7OmWwSMJnkP9VL2DyLpZIa6oy1APQLg93eVttQhIhKLoSuVYp8zUVtm+Yc1N10KbafFzTqqLLkRRfbL1LbJMgfXqP2M6WDkN1iS9RpCgw3WJzV6ciEReE8lMKmxyQbmRuzfEFuwYLdA6OVeWxAeGNBppyiS5i5TVckUqzgwk91bj68c777FdaJEM/Pt8Kl1BRCYixp6M9CNzbE1ib1qKhwHXuZcH1tjTPULLUOIKRPuaPzb+8FjR7bKNAy0xQlZuA4Rb7ok29dg1ggUeu71wV8bDywJrzJojNjvxtG6C6ErdneXPWl6tR9Seqf7iBfGYGFhr9PVjhrd0EcgmeorFCsuUJGfLg6cnUwAA3qHTYU5Szw3MBYOQM474/iBTGAwN69t5cXTtZK2Zhi93HMsqYXQxQDLTE= X-Forefront-Antispam-Report: CIP:12.22.5.235; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230016)(4636009)(346002)(39860400002)(136003)(376002)(396003)(36840700001)(46966006)(40470700004)(336012)(26005)(86362001)(53546011)(186003)(2906002)(2616005)(7696005)(6916009)(1076003)(16526019)(5660300002)(966005)(41300700001)(40480700001)(426003)(55016003)(83380400001)(36756003)(36860700001)(6666004)(6286002)(4326008)(70206006)(8676002)(70586007)(45080400002)(478600001)(8936002)(47076005)(356005)(82740400003)(81166007)(82310400005)(54906003)(316002)(40460700003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jun 2022 08:03:48.9741 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: efc33bce-6e1e-45eb-1bbc-08da535c92c5 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[12.22.5.235]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT042.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1798 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 20.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 06/23/22. 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/steevenlee/dpdk This queued commit can be viewed at: https://github.com/steevenlee/dpdk/commit/a61bd9df25dc6bb7d3d2d0e2b2a3fb1ee5266947 Thanks. Xueming Li --- >From a61bd9df25dc6bb7d3d2d0e2b2a3fb1ee5266947 Mon Sep 17 00:00:00 2001 From: Long Li Date: Thu, 24 Mar 2022 10:46:08 -0700 Subject: [PATCH] net/netvsc: fix calculation of checksums based on mbuf flag Cc: Xueming Li [ upstream commit 559a1f2eeaaddccc83e1668a8ee375c34699e48b ] The netvsc should use RTE_MBUF_F_TX_L4_MASK and check the masked value to decide the correct way to calculate checksums. Not checking for RTE_MBUF_F_TX_L4_MASK results in incorrect RNDIS packets sent to VSP and incorrect checksums calculated by the VSP. Fixes: 4e9c73e96e ("net/netvsc: add Hyper-V network device") Signed-off-by: Long Li Acked-by: Stephen Hemminger Reviewed-by: Ferruh Yigit --- drivers/net/netvsc/hn_rxtx.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/net/netvsc/hn_rxtx.c b/drivers/net/netvsc/hn_rxtx.c index 94ca3af20a..44a8eb4c0e 100644 --- a/drivers/net/netvsc/hn_rxtx.c +++ b/drivers/net/netvsc/hn_rxtx.c @@ -1348,8 +1348,11 @@ static void hn_encap(struct rndis_packet_msg *pkt, *pi_data = NDIS_LSO2_INFO_MAKEIPV4(hlen, m->tso_segsz); } - } else if (m->ol_flags & - (PKT_TX_TCP_CKSUM | PKT_TX_UDP_CKSUM | PKT_TX_IP_CKSUM)) { + } else if ((m->ol_flags & PKT_TX_L4_MASK) == + PKT_TX_TCP_CKSUM || + (m->ol_flags & PKT_TX_L4_MASK) == + PKT_TX_UDP_CKSUM || + (m->ol_flags & PKT_TX_IP_CKSUM)) { pi_data = hn_rndis_pktinfo_append(pkt, NDIS_TXCSUM_INFO_SIZE, NDIS_PKTINFO_TYPE_CSUM); *pi_data = 0; @@ -1363,9 +1366,11 @@ static void hn_encap(struct rndis_packet_msg *pkt, *pi_data |= NDIS_TXCSUM_INFO_IPCS; } - if (m->ol_flags & PKT_TX_TCP_CKSUM) + if ((m->ol_flags & PKT_TX_L4_MASK) == + PKT_TX_TCP_CKSUM) *pi_data |= NDIS_TXCSUM_INFO_MKTCPCS(hlen); - else if (m->ol_flags & PKT_TX_UDP_CKSUM) + else if ((m->ol_flags & PKT_TX_L4_MASK) == + PKT_TX_UDP_CKSUM) *pi_data |= NDIS_TXCSUM_INFO_MKUDPCS(hlen); } -- 2.35.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-06-21 15:37:49.656804844 +0800 +++ 0008-net-netvsc-fix-calculation-of-checksums-based-on-mbu.patch 2022-06-21 15:37:48.961117647 +0800 @@ -1 +1 @@ -From 559a1f2eeaaddccc83e1668a8ee375c34699e48b Mon Sep 17 00:00:00 2001 +From a61bd9df25dc6bb7d3d2d0e2b2a3fb1ee5266947 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 559a1f2eeaaddccc83e1668a8ee375c34699e48b ] @@ -13 +15,0 @@ -Cc: stable@dpdk.org @@ -23 +25 @@ -index 3e3488f1b8..1afc14f280 100644 +index 94ca3af20a..44a8eb4c0e 100644 @@ -26 +28 @@ -@@ -1346,8 +1346,11 @@ static void hn_encap(struct rndis_packet_msg *pkt, +@@ -1348,8 +1348,11 @@ static void hn_encap(struct rndis_packet_msg *pkt, @@ -31,6 +33,6 @@ -- (RTE_MBUF_F_TX_TCP_CKSUM | RTE_MBUF_F_TX_UDP_CKSUM | RTE_MBUF_F_TX_IP_CKSUM)) { -+ } else if ((m->ol_flags & RTE_MBUF_F_TX_L4_MASK) == -+ RTE_MBUF_F_TX_TCP_CKSUM || -+ (m->ol_flags & RTE_MBUF_F_TX_L4_MASK) == -+ RTE_MBUF_F_TX_UDP_CKSUM || -+ (m->ol_flags & RTE_MBUF_F_TX_IP_CKSUM)) { +- (PKT_TX_TCP_CKSUM | PKT_TX_UDP_CKSUM | PKT_TX_IP_CKSUM)) { ++ } else if ((m->ol_flags & PKT_TX_L4_MASK) == ++ PKT_TX_TCP_CKSUM || ++ (m->ol_flags & PKT_TX_L4_MASK) == ++ PKT_TX_UDP_CKSUM || ++ (m->ol_flags & PKT_TX_IP_CKSUM)) { @@ -40 +42 @@ -@@ -1361,9 +1364,11 @@ static void hn_encap(struct rndis_packet_msg *pkt, +@@ -1363,9 +1366,11 @@ static void hn_encap(struct rndis_packet_msg *pkt, @@ -44,3 +46,3 @@ -- if (m->ol_flags & RTE_MBUF_F_TX_TCP_CKSUM) -+ if ((m->ol_flags & RTE_MBUF_F_TX_L4_MASK) == -+ RTE_MBUF_F_TX_TCP_CKSUM) +- if (m->ol_flags & PKT_TX_TCP_CKSUM) ++ if ((m->ol_flags & PKT_TX_L4_MASK) == ++ PKT_TX_TCP_CKSUM) @@ -48,3 +50,3 @@ -- else if (m->ol_flags & RTE_MBUF_F_TX_UDP_CKSUM) -+ else if ((m->ol_flags & RTE_MBUF_F_TX_L4_MASK) == -+ RTE_MBUF_F_TX_UDP_CKSUM) +- else if (m->ol_flags & PKT_TX_UDP_CKSUM) ++ else if ((m->ol_flags & PKT_TX_L4_MASK) == ++ PKT_TX_UDP_CKSUM)