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 B74C643B86 for ; Tue, 5 Mar 2024 10:53:08 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B17FA4026B; Tue, 5 Mar 2024 10:53:08 +0100 (CET) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2064.outbound.protection.outlook.com [40.107.237.64]) by mails.dpdk.org (Postfix) with ESMTP id 898424014F for ; Tue, 5 Mar 2024 10:53:07 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ES+SFKXrv5aunnm4R7bsdB/K5e/GEIvvYNShoS4HpHbzOq3IByjFs8fxUkBT2PY2f2iu/CAK/Pmj6Dvu05d2xGh/fj3Is+FtPp+apSLBgxPfuaIgCJ+hEJ98gfOp54LcFPfSEtB+SBW3LlLzPSOYRjhLjOotKh8jMuYUBcYpanXhRRp6U3ov4UPDIVKGWJJ2KnmVodDktgv6qPWMSHco9aTrxHXAMsZfSfYDPSKhkr89clLv/9ygUc+NJIZ8uWChB6BkWVn8RTldfdKs0qNZADVnAj0t8mcCGR4Dz6/0XbXc0LzdAlKyjtyAjDaIalUySbXodNwljqFsJ3BTlpY15w== 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=NRnrYdDFx3NaQMWbti+N5YjaGw3nCfgd/qEkUOhBkoU=; b=oeNf+R7juTZqKlIG5VMArwsYudW30fF1wWHD2TlYPkPk7VJqiQFMv1a3PmyieqqiGFFpyhmhumFDryikdCfWYbEM4b9YPHLRcf6AoSpbNZ+BUQYF58e3UeoVpeGOl9mKtkt0M9lUKkHjeCMH/ok6TxejK8ARcCrN/jhDwmX51y9p7/ao1CMtgMwiqHI4lIIMWyUBd+I5uTfgGMP74ueVuSByWX0ouloqwtKr4Mufhb+uwQCQCTdyaRFf+Oo9p8PaxJBL0SfMve2hHz/fyvejYnDpD+FpIEGUQ7SoxUhBg8dpdmtme+ffB8hETm9U96VoB7GmxihVYKxjiNhVoCM/dw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) 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=NRnrYdDFx3NaQMWbti+N5YjaGw3nCfgd/qEkUOhBkoU=; b=W4WP5GpN+92NZ5fk4HcF4AF0BNqMZn2KH5e1vAqeRkaXuKN+3DE4Q2edTNyVfE7j0Ykqz977SBUDPQfYJF065nZB8/n4ClkOiOUlW0pNFjOy6YSxXrzeEt6pvEDDlog1J+nQQLFm33Z2rz/pWfaO7M0Ivxb7hfPiYIaDwe7TQFIR26kdZT2z7Dr6VcLPPoGkmSgravZPCZ500NaSiEblZ1FhchWwSLb9kAMlG6Q3+O1dwzAork/v8+Bn65ZDXcgX0ExqrSy4snfM8eu62x6l/VpeYreN29JO8fZMwa78suakZE2VtnxjD3Qn/a34uwZSbI1ku3qREDJuWNvic9e/fg== Received: from PH7PR10CA0010.namprd10.prod.outlook.com (2603:10b6:510:23d::19) by SA1PR12MB6869.namprd12.prod.outlook.com (2603:10b6:806:25d::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7339.38; Tue, 5 Mar 2024 09:53:03 +0000 Received: from SN1PEPF0002BA4D.namprd03.prod.outlook.com (2603:10b6:510:23d:cafe::8c) by PH7PR10CA0010.outlook.office365.com (2603:10b6:510:23d::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7339.39 via Frontend Transport; Tue, 5 Mar 2024 09:53:03 +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 SN1PEPF0002BA4D.mail.protection.outlook.com (10.167.242.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.11 via Frontend Transport; Tue, 5 Mar 2024 09:53:03 +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.986.41; Tue, 5 Mar 2024 01:52:47 -0800 Received: from nvidia.com (10.126.231.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.1258.12; Tue, 5 Mar 2024 01:52:46 -0800 From: Xueming Li To: Kaiwen Deng CC: =?UTF-8?q?Morten=20Br=C3=B8rup?= , dpdk stable Subject: patch 'net: fix TCP/UDP checksum with padding data' has been queued to stable release 23.11.1 Date: Tue, 5 Mar 2024 17:46:35 +0800 Message-ID: <20240305094757.439387-55-xuemingl@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240305094757.439387-1-xuemingl@nvidia.com> References: <20240305094757.439387-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.126.231.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-TrafficTypeDiagnostic: SN1PEPF0002BA4D:EE_|SA1PR12MB6869:EE_ X-MS-Office365-Filtering-Correlation-Id: 1bbcdf2c-6fed-410a-ee49-08dc3cfa0ccd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: F6f5t/N0GXTJ17cFaotrLPYdDGBBf/xHiDn6+LWbGFPAAfzV6ZFGkYxktdlgqF8GxR18AGQIK/JMtSE/xDqYVqgJBEq7NXQXYgee1VoT4ACJF195PdQiP4quOoGRveylvtfDEaAjrnp6qNvZERO99jgonazbSBbu5zp4Vh/0xJBQQk9eO6kHRCBr0atgc54P2Crd32u2/t06KPer7TWS9WR8e02cI+RVcT7K3uP+KMHw75k3vfsq1QQUAF6sDHl566PU4O8Ck+HB/0piY5vmLoM2hfouNHRRfkHS1I1hJL0wWIXN/oJX+PY0/zup6dXY6pJLDdcZNGUd2HPoioLV5T4uAOyB+UVgsbzoKwEbtR2n6VaDgGjWTmx/qTnwQR+IoAjsC7LEQlZDTOOHANaN+Cgjefz3qLZx8RRySVM2gluG1t9W08gwfk2YMC2OKmI91lPekxO/eAD96A3LmLWedmT8Ayhv3kDUpWdf24R48gGwQ9Nh8Irup1ZXPN0hZmAoGhWDu+8ffGgd3tPbmx7KqiucKWMeH7s2LBpdz6ikCydPE3jD73ksB+CVRTdhiLVSis6U4mV4FZcQtTt3zHoVmjAa81P7NK2y9ttRg7nt9D1hCd/pErAekDj+0h9iJktOCUbGMa7MEvn0hUVNCL9DiJhm2sRoZI/T54OiGia84NtlnrLa82hL+T/ZZzDzG5EDgbWKjjv98O+Kwco1HhYSfuSfplmaRjqRhwTpg97AbDs5TmdS0xQg0s3g4KDZDY43 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:(13230031)(82310400014)(36860700004)(376005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Mar 2024 09:53:03.2830 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1bbcdf2c-6fed-410a-ee49-08dc3cfa0ccd 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: SN1PEPF0002BA4D.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB6869 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.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 03/31/24. 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=c139df70dd02ed9031e82d80bd51ba1882157f63 Thanks. Xueming Li --- >From c139df70dd02ed9031e82d80bd51ba1882157f63 Mon Sep 17 00:00:00 2001 From: Kaiwen Deng Date: Thu, 14 Dec 2023 17:22:59 +0800 Subject: [PATCH] net: fix TCP/UDP checksum with padding data MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Xueming Li [ upstream commit e55ea3d5d970dfff2989e4a1c65b76d02512bce0 ] IEEE 802 packets may have a minimum size limit. The data fields should be padded when necessary. In some cases, the padding data is not zero. In 'rte_ipv4_udptcp_cksum_mbuf()', as payload length "mbuf->pkt_len - l4_off" is used, which includes padding and if padding is not zero it will end up producing wrong checksum. This patch will use IP header to get the payload size to calculate TCP/UDP checksum. Fixes: d178f693bbfe ("net: add UDP/TCP checksum in mbuf segments") Signed-off-by: Kaiwen Deng Reviewed-by: Morten Brørup --- lib/net/rte_ip.h | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/net/rte_ip.h b/lib/net/rte_ip.h index 6fa98a5a0f..0d103d4127 100644 --- a/lib/net/rte_ip.h +++ b/lib/net/rte_ip.h @@ -419,11 +419,14 @@ __rte_ipv4_udptcp_cksum_mbuf(const struct rte_mbuf *m, { uint16_t raw_cksum; uint32_t cksum; + uint16_t len; - if (l4_off > m->pkt_len) - return 0; + if (unlikely(l4_off > m->pkt_len)) + return 0; /* invalid params, return a dummy value */ + + len = rte_be_to_cpu_16(ipv4_hdr->total_length) - (uint16_t)rte_ipv4_hdr_len(ipv4_hdr); - if (rte_raw_cksum_mbuf(m, l4_off, m->pkt_len - l4_off, &raw_cksum)) + if (rte_raw_cksum_mbuf(m, l4_off, len, &raw_cksum)) return 0; cksum = raw_cksum + rte_ipv4_phdr_cksum(ipv4_hdr, 0); @@ -663,10 +666,10 @@ __rte_ipv6_udptcp_cksum_mbuf(const struct rte_mbuf *m, uint16_t raw_cksum; uint32_t cksum; - if (l4_off > m->pkt_len) - return 0; + if (unlikely(l4_off > m->pkt_len)) + return 0; /* invalid params, return a dummy value */ - if (rte_raw_cksum_mbuf(m, l4_off, m->pkt_len - l4_off, &raw_cksum)) + if (rte_raw_cksum_mbuf(m, l4_off, rte_be_to_cpu_16(ipv6_hdr->payload_len), &raw_cksum)) return 0; cksum = raw_cksum + rte_ipv6_phdr_cksum(ipv6_hdr, 0); -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-03-05 17:39:32.609662554 +0800 +++ 0054-net-fix-TCP-UDP-checksum-with-padding-data.patch 2024-03-05 17:39:30.763566493 +0800 @@ -1 +1 @@ -From e55ea3d5d970dfff2989e4a1c65b76d02512bce0 Mon Sep 17 00:00:00 2001 +From c139df70dd02ed9031e82d80bd51ba1882157f63 Mon Sep 17 00:00:00 2001 @@ -7,0 +8,3 @@ +Cc: Xueming Li + +[ upstream commit e55ea3d5d970dfff2989e4a1c65b76d02512bce0 ] @@ -21 +23,0 @@ -Cc: stable@dpdk.org