From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id AB6F0A04AF for ; Thu, 20 Aug 2020 17:34:37 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A05261C0B0; Thu, 20 Aug 2020 17:34:37 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by dpdk.org (Postfix) with ESMTP id 1B71E1C0B0 for ; Thu, 20 Aug 2020 17:34:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1597937675; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0AQhOW4q8Xb7vAg5TJ1t88TvwK5uZtbQOucHN1BkTzo=; b=MHuawq79wdYQIBFLVJxW2ZTuZ90aphuEeJmQI7o3LYkaLfqgmODAnGT20wZT4uAaRoskC9 UHn+sVVQJI+qasD6N7DVvGH2+u858Vv7gunfk9ghSak5tXsVhtfLYao6ZLX8rbAld4RP4g +hJIVpVxgVNXdFxDqqFdFDAiFbtxq04= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-340-SzgNcNVUMsmTk-hXsU4EuQ-1; Thu, 20 Aug 2020 11:34:31 -0400 X-MC-Unique: SzgNcNVUMsmTk-hXsU4EuQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 242AA1885D87; Thu, 20 Aug 2020 15:34:30 +0000 (UTC) Received: from rh.redhat.com (unknown [10.33.36.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8CE02100EBAE; Thu, 20 Aug 2020 15:34:28 +0000 (UTC) From: Kevin Traynor To: Hongzhi Guo Cc: Olivier Matz , =?UTF-8?q?Morten=20Br=C3=B8rup?= , dpdk stable Date: Thu, 20 Aug 2020 16:33:24 +0100 Message-Id: <20200820153341.171927-19-ktraynor@redhat.com> In-Reply-To: <20200820153341.171927-1-ktraynor@redhat.com> References: <20200820153341.171927-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ktraynor@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net: fix unneeded replacement of TCP checksum 0' has been queued to LTS release 18.11.10 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 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 Sender: "stable" Hi, FYI, your patch has been queued to LTS release 18.11.10 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 08/25/20. 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/kevintraynor/dpdk-stable-queue This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable-queue/commit/0c4ca42257f40b58bac2e35fbdbc62771eca8cef Thanks. Kevin. --- >From 0c4ca42257f40b58bac2e35fbdbc62771eca8cef Mon Sep 17 00:00:00 2001 From: Hongzhi Guo Date: Fri, 10 Jul 2020 14:55:51 +0800 Subject: [PATCH] net: fix unneeded replacement of TCP checksum 0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [ upstream commit d5df2ae0428a147b80bbb65d623f88f75d28b226 ] Per RFC768: If the computed checksum is zero, it is transmitted as all ones. An all zero transmitted checksum value means that the transmitter generated no checksum. RFC793 for TCP has no such special treatment for the checksum of zero. Fixes: 6006818cfb26 ("net: new checksum functions") Signed-off-by: Hongzhi Guo Acked-by: Olivier Matz Acked-by: Morten Brørup --- lib/librte_net/rte_ip.h | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/lib/librte_net/rte_ip.h b/lib/librte_net/rte_ip.h index 2c78ba6cf6..728a045b9d 100644 --- a/lib/librte_net/rte_ip.h +++ b/lib/librte_net/rte_ip.h @@ -317,6 +317,5 @@ rte_ipv4_phdr_cksum(const struct ipv4_hdr *ipv4_hdr, uint64_t ol_flags) * The pointer to the beginning of the L4 header. * @return - * The complemented checksum to set in the IP packet - * or 0 on error + * The complemented checksum to set in the IP packet. */ static inline uint16_t @@ -337,5 +336,10 @@ rte_ipv4_udptcp_cksum(const struct ipv4_hdr *ipv4_hdr, const void *l4_hdr) cksum = ((cksum & 0xffff0000) >> 16) + (cksum & 0xffff); cksum = (~cksum) & 0xffff; - if (cksum == 0) + /* + * Per RFC 768:If the computed checksum is zero for UDP, + * it is transmitted as all ones + * (the equivalent in one's complement arithmetic). + */ + if (cksum == 0 && ipv4_hdr->next_proto_id == IPPROTO_UDP) cksum = 0xffff; @@ -426,5 +430,10 @@ rte_ipv6_udptcp_cksum(const struct ipv6_hdr *ipv6_hdr, const void *l4_hdr) cksum = ((cksum & 0xffff0000) >> 16) + (cksum & 0xffff); cksum = (~cksum) & 0xffff; - if (cksum == 0) + /* + * Per RFC 768: If the computed checksum is zero for UDP, + * it is transmitted as all ones + * (the equivalent in one's complement arithmetic). + */ + if (cksum == 0 && ipv6_hdr->proto == IPPROTO_UDP) cksum = 0xffff; -- 2.26.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-08-20 16:26:16.560303769 +0100 +++ 0019-net-fix-unneeded-replacement-of-TCP-checksum-0.patch 2020-08-20 16:26:15.805324152 +0100 @@ -1 +1 @@ -From d5df2ae0428a147b80bbb65d623f88f75d28b226 Mon Sep 17 00:00:00 2001 +From 0c4ca42257f40b58bac2e35fbdbc62771eca8cef Mon Sep 17 00:00:00 2001 @@ -8,0 +9,2 @@ +[ upstream commit d5df2ae0428a147b80bbb65d623f88f75d28b226 ] + @@ -17 +18,0 @@ -Cc: stable@dpdk.org @@ -27 +28 @@ -index 292f63fd74..a9ffc33571 100644 +index 2c78ba6cf6..728a045b9d 100644 @@ -30 +31 @@ -@@ -325,6 +325,5 @@ rte_ipv4_phdr_cksum(const struct rte_ipv4_hdr *ipv4_hdr, uint64_t ol_flags) +@@ -317,6 +317,5 @@ rte_ipv4_phdr_cksum(const struct ipv4_hdr *ipv4_hdr, uint64_t ol_flags) @@ -38 +39 @@ -@@ -345,5 +344,10 @@ rte_ipv4_udptcp_cksum(const struct rte_ipv4_hdr *ipv4_hdr, const void *l4_hdr) +@@ -337,5 +336,10 @@ rte_ipv4_udptcp_cksum(const struct ipv4_hdr *ipv4_hdr, const void *l4_hdr) @@ -50 +51 @@ -@@ -439,5 +443,10 @@ rte_ipv6_udptcp_cksum(const struct rte_ipv6_hdr *ipv6_hdr, const void *l4_hdr) +@@ -426,5 +430,10 @@ rte_ipv6_udptcp_cksum(const struct ipv6_hdr *ipv6_hdr, const void *l4_hdr)