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 C893EA0543 for ; Tue, 21 Jun 2022 10:09:06 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E262742823; Tue, 21 Jun 2022 10:09:05 +0200 (CEST) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2042.outbound.protection.outlook.com [40.107.220.42]) by mails.dpdk.org (Postfix) with ESMTP id 686DC42B6C for ; Tue, 21 Jun 2022 10:09:04 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hfOpy7Dbe8NVuv+ljRp/peSa2qvlCEjuCV+VME3G0DKFspK61GoLikMNsOqtjAlSyxJ0RPW0C4fQpSxES9mYP9cIvO+NS6o4FBS7T3nwwXmEiBMLZ5A7Ifz+9M8ggtxM/H9/Vw9PflF6wsX58tq1GWrosZoZgVWTmeEJ9H4qYvxfYpDrQ/Zn7f2v7rgEZ1pNlKyHSBoROBzuh2M3Dn4yBZ53ChKOZjcArlHyv6jzT2e5B5Xb7fJr68nmhmF6X2gmp5bGgSHOQNMJgy1dfJw/Cp8+VCsPS0eH8RFWcDYApFI8KrijhCC6g+DypYE2xw2XO7NKJS/zJTih9j6j9lv7hA== 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=QrLHyNCbtlwueRZvCTaGGYr0sv9lqlnypFJxYdb2Obg=; b=NNh/I4ng8oeirN4EYGbNDLbxNIDkYTl+bRKzcEH5knn8kppBBoUM2mSuBTXvvspAkUqEjzkz3qZOY1ovJ7BdbjiG7WGmSMGQBCsKdml8yyg1FHeXfRVbucIwKBb4zfD/de0tWYU0Io1MS+Jt+5pY9dfiCaWNcQHygHlA2Yo+xGZHI1WQ5Va44LQEfvehNWaRabCnyZjLhAm5a9O22an7k8V8OyVUBrDPbk51+eNYBqRUJGMaLdEEP4KzoH2Avy/3wWusRTMmfpaR1ry8j1J5z8vsw+cIovnpCKrQ9mI3Ez6e0ugY4t2fRcDUV0pTMQdcNu7/3LXNV1OHaX53ePRMjg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.235) 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 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=QrLHyNCbtlwueRZvCTaGGYr0sv9lqlnypFJxYdb2Obg=; b=jBbFHwkrtHsU9RErXNu9nQzhiM+dSZzZWFTogAbKK63ygxid6XDeRCOGKTHJhsh1AlHJ8x8eDqpw8PiK/YiTLk7J3XAvRnAw50fIShGVhHM+BBVfZEX5/KK6hQNSMngmN1/Ty9CK15NYsvgf7DykLj8YdIYRypLnbZKFS+UTh96eMFL4eC5guFDIZWCK/s4sggftHY5Foegf5H8k7DX1SrPbA+bcNDi2YAAyLrxAC5encZMmKevW+O3nvr6RGCwRgAjhQFzT4jd4iGYrIbOkUuCjMM4yYE006SNKIPdD6XJx5Ec0hIyRTSl9ZGlMsBIR5+C3p9jeJgn9wQ8+lj/AJg== Received: from MWHPR18CA0038.namprd18.prod.outlook.com (2603:10b6:320:31::24) by PH7PR12MB6490.namprd12.prod.outlook.com (2603:10b6:510:1f5::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5353.15; Tue, 21 Jun 2022 08:09:01 +0000 Received: from CO1NAM11FT043.eop-nam11.prod.protection.outlook.com (2603:10b6:320:31:cafe::45) by MWHPR18CA0038.outlook.office365.com (2603:10b6:320:31::24) 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:09:01 +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 CO1NAM11FT043.mail.protection.outlook.com (10.13.174.193) 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:09:00 +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:09:00 +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:08:58 -0700 From: Xueming Li To: Wenwu Ma CC: Jiayu Hu , Wei Ling , "Yuying Zhang" , dpdk stable Subject: patch 'app/testpmd: perform SW IP checksum for GRO/GSO packets' has been queued to stable release 20.11.6 Date: Tue, 21 Jun 2022 11:02:14 +0300 Message-ID: <20220621080301.2315720-69-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: 689b995f-6f8c-4de7-4b1e-08da535d4cba X-MS-TrafficTypeDiagnostic: PH7PR12MB6490:EE_ 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: pOSb66B6tY4/EPXgpv+l/yvHyBnuHgIUVq2n7e5eNyAY8nwlSeQUtIlVVLElrZiHJ+j7XIhURgovARwR1MVT/t9CzbLUn9+BnPNjA7Pdhx2K7fNkzFC3kIkxfH/pLdARnnLX4sIIyqu88sRxVRf/KVVUsoyarSuukBZCsi0F0KNSa+YmmTXrfoMFd3M9R7d/R6OMdHvbw1H/x7NJUxlbHFKXWOKfh29OFbquNKUoVGSTKzJAKq26q06cQtip3S2aLQshd8l1ZPxOG+9s2en1aNvEumO6MCLKVbGdFA8Bob2OH/RD1Y8NywRbxV4HenFDGBMiRth2BH+ADhI83xzBJQMhUxc/DIHgcgGT+4SVkPerP5ae9tYG0TD5JlSRASScFTAc8+F/Fnz+dAQymyK07i2iiRArj4e3DrwShikU4simzV20pJDsgSR9EDfUKrbXMykI2qU5OzqQiusB8MNQxlVsaPa8axPq5FMd7dOb2oY15DuxtLh2DWOfgTw4kA19vENZm6DjW4OHO4JLNTSVZwI21kMtV6QLNsTewMcJdkVF3F/DmPWwjpPgD1oYaHV8/fnAgVf4YBwH145lHOxA99W2F7OKN7Iy8zSe5QrVTt4++5UQXNPC3d/gcyUQPCjwHiNQNbvQYbt2cbOxkrjEeUOuFzb1ln/TGg84JS7oPsv48ibWMO3lE+9kVhCV7FjvUNiAKx5nD4dZu7540F8AFwIh1vcO/wdKP/2sWz/Dh27PV27d7sYRRrklm14eoc2KwgCsYOhe/TnlTGpA6YFcNj6Z5tsuPspNAw4/CaGt53ivEyowb0rNXJaF7JAN5Fapp+7338nbNJB+Tp4H4j12uYaiP8MGjBVgpo4sUJB5aVI= 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)(39860400002)(396003)(376002)(346002)(136003)(36840700001)(40470700004)(46966006)(186003)(41300700001)(8676002)(83380400001)(2616005)(82740400003)(1076003)(336012)(36756003)(47076005)(40460700003)(8936002)(16526019)(5660300002)(70586007)(966005)(4326008)(81166007)(36860700001)(86362001)(2906002)(7696005)(426003)(356005)(53546011)(6916009)(54906003)(6286002)(478600001)(6666004)(26005)(55016003)(82310400005)(40480700001)(316002)(70206006)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jun 2022 08:09:00.9437 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 689b995f-6f8c-4de7-4b1e-08da535d4cba 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: CO1NAM11FT043.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB6490 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/9463f695d7c8f3f7d54fb575ecf143bcab3e6a7d Thanks. Xueming Li --- >From 9463f695d7c8f3f7d54fb575ecf143bcab3e6a7d Mon Sep 17 00:00:00 2001 From: Wenwu Ma Date: Thu, 12 May 2022 01:07:56 +0000 Subject: [PATCH] app/testpmd: perform SW IP checksum for GRO/GSO packets Cc: Xueming Li [ upstream commit 1945c64674b2b9ad55af0ef31f8a02ae0b747400 ] The GRO/GSO library doesn't re-calculate checksums for merged/fragmented packets. If users want the packets to have correct IP checksums, they should select HW IP checksum calculation for the port which the packets are transmitted to. But if the port doesn't support HW IP checksum, users may perform a SW IP checksum. Fixes: b7091f1dcfbc ("app/testpmd: enable the heavyweight mode TCP/IPv4 GRO") Fixes: 52f38a2055ed ("app/testpmd: enable TCP/IPv4 VxLAN and GRE GSO") Signed-off-by: Wenwu Ma Reviewed-by: Jiayu Hu Tested-by: Wei Ling Acked-by: Yuying Zhang --- app/test-pmd/csumonly.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c index 243ef3e47a..282e87092f 100644 --- a/app/test-pmd/csumonly.c +++ b/app/test-pmd/csumonly.c @@ -760,6 +760,28 @@ pkt_copy_split(const struct rte_mbuf *pkt) return md[0]; } +#if defined(RTE_LIB_GRO) || defined(RTE_LIB_GSO) +/* + * Re-calculate IP checksum for merged/fragmented packets. + */ +static void +pkts_ip_csum_recalc(struct rte_mbuf **pkts_burst, const uint16_t nb_pkts, uint64_t tx_offloads) +{ + int i; + struct rte_ipv4_hdr *ipv4_hdr; + for (i = 0; i < nb_pkts; i++) { + if ((pkts_burst[i]->ol_flags & PKT_TX_IPV4) && + (tx_offloads & DEV_TX_OFFLOAD_IPV4_CKSUM) == 0) { + ipv4_hdr = rte_pktmbuf_mtod_offset(pkts_burst[i], + struct rte_ipv4_hdr *, + pkts_burst[i]->l2_len); + ipv4_hdr->hdr_checksum = 0; + ipv4_hdr->hdr_checksum = rte_ipv4_cksum(ipv4_hdr); + } + } +} +#endif + /* * Receive a burst of packets, and for each packet: * - parse packet, and try to recognize a supported packet type (1) @@ -1072,6 +1094,8 @@ tunnel_update: fs->gro_times = 0; } } + + pkts_ip_csum_recalc(pkts_burst, nb_rx, tx_offloads); } if (gso_ports[fs->tx_port].enable == 0) @@ -1101,6 +1125,8 @@ tunnel_update: tx_pkts_burst = gso_segments; nb_rx = nb_segments; + + pkts_ip_csum_recalc(tx_pkts_burst, nb_rx, tx_offloads); } nb_prep = rte_eth_tx_prepare(fs->tx_port, fs->tx_queue, -- 2.35.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-06-21 15:37:52.379602352 +0800 +++ 0068-app-testpmd-perform-SW-IP-checksum-for-GRO-GSO-packe.patch 2022-06-21 15:37:49.097784798 +0800 @@ -1 +1 @@ -From 1945c64674b2b9ad55af0ef31f8a02ae0b747400 Mon Sep 17 00:00:00 2001 +From 9463f695d7c8f3f7d54fb575ecf143bcab3e6a7d Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 1945c64674b2b9ad55af0ef31f8a02ae0b747400 ] @@ -15 +17,0 @@ -Cc: stable@dpdk.org @@ -26 +28 @@ -index cdb1920763..05763a71e8 100644 +index 243ef3e47a..282e87092f 100644 @@ -29 +31 @@ -@@ -778,6 +778,28 @@ pkt_copy_split(const struct rte_mbuf *pkt) +@@ -760,6 +760,28 @@ pkt_copy_split(const struct rte_mbuf *pkt) @@ -43,2 +45,2 @@ -+ if ((pkts_burst[i]->ol_flags & RTE_MBUF_F_TX_IPV4) && -+ (tx_offloads & RTE_ETH_TX_OFFLOAD_IPV4_CKSUM) == 0) { ++ if ((pkts_burst[i]->ol_flags & PKT_TX_IPV4) && ++ (tx_offloads & DEV_TX_OFFLOAD_IPV4_CKSUM) == 0) { @@ -58 +60 @@ -@@ -1102,6 +1124,8 @@ tunnel_update: +@@ -1072,6 +1094,8 @@ tunnel_update: @@ -65 +66,0 @@ - #endif @@ -67 +68,2 @@ -@@ -1135,6 +1159,8 @@ tunnel_update: + if (gso_ports[fs->tx_port].enable == 0) +@@ -1101,6 +1125,8 @@ tunnel_update: @@ -73,3 +75,3 @@ - } else - #endif - tx_pkts_burst = pkts_burst; + } + + nb_prep = rte_eth_tx_prepare(fs->tx_port, fs->tx_queue,