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 96188A0518 for ; Fri, 24 Jul 2020 14:08:56 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8D8931C039; Fri, 24 Jul 2020 14:08:56 +0200 (CEST) Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) by dpdk.org (Postfix) with ESMTP id 936C21C1C6 for ; Fri, 24 Jul 2020 14:08:54 +0200 (CEST) Received: by mail-wr1-f42.google.com with SMTP id 88so8097952wrh.3 for ; Fri, 24 Jul 2020 05:08:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cpktsWIAAZukFCxXHAHd9Yv17InKLGQjyPGerkeaSw8=; b=YCsWl+hdv/lpFZqwqB5zhu6vV7ujC997QaJXx6JxyyEj0z2rZZnV3HWMAHzFiyctjB hVMzzLv/71u67yEUZB7mbMcmB6gE87+HPnCTIlodHsLylQjdYGnFhtsfq3Glz7SYP0Q5 t+fPTY9nXQqhKN8mfUGC9An9wG9KtKploJ0jGoVCiDfbfW2DCBBDPTSiSsZO/zQ3O4L2 A62FsRCnJa9h9z/9rOnumk8qvo/vTeyQPXWPUjMKQJbTrx8VT2/1MM5tT6vTCk1QUDkJ iP+D4rmN74zJmCTMIjJbgDuC4BsnaRXA2OxB9Y2bO/k6+sb4oKEm9ucOqvIn8NmNmsDX lMdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cpktsWIAAZukFCxXHAHd9Yv17InKLGQjyPGerkeaSw8=; b=QcX0t3E+RyELpvbvb6djWMAzwOHXM5mIsec97NN/SZPOSxNZls/feR/OFja6bUNRTh KPnRDi1DKrVJCJnGZddPaqBzmtJrbsFCAGz0R1MTaTE2UpaNbc20eCmjtz5XlVQ94B/J YHCJyR0OUNDE1MODIdsmDlEa1f0spZvQ5ppNL6nw0FFzFEFvUl2hebMWTbmoSKQ71TED zw6CbQK8zG0s10DHZXDKOQEFH/KSo+WhqiNVvgh3ZEg7aw2whNxT/jPucX66KHCY8HV1 g2T1JIhHzJfn+XcVekkDRkQHJ7KyfUiHwwJxwVtt4V8+XUbpLC+VJi3GO8LeewViZ7GO vNiQ== X-Gm-Message-State: AOAM530lH0gD4ZIX+AinAHHoIjqOHunquGzOzmyGjH5jXK1zEzAdUDF7 cIHWbRGa+SrOP5FWPKYfp6okPIYUXR1/RA== X-Google-Smtp-Source: ABdhPJzlfchg6RAo1x7eQ4ZhzCIEzNjl1e3J1nIgliqazze7AvQQWHMRW3XqCkbSLqXaje12Fum15w== X-Received: by 2002:adf:8282:: with SMTP id 2mr8262808wrc.76.1595592534303; Fri, 24 Jul 2020 05:08:54 -0700 (PDT) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id f15sm1049181wrx.91.2020.07.24.05.08.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jul 2020 05:08:53 -0700 (PDT) From: luca.boccassi@gmail.com To: Hongzhi Guo Cc: Olivier Matz , =?UTF-8?q?Morten=20Br=C3=B8rup?= , dpdk stable Date: Fri, 24 Jul 2020 12:59:23 +0100 Message-Id: <20200724120030.1863487-125-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200724120030.1863487-1-luca.boccassi@gmail.com> References: <20200724120030.1863487-1-luca.boccassi@gmail.com> MIME-Version: 1.0 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 stable release 19.11.4 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 stable release 19.11.4 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 07/26/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. Thanks. Luca Boccassi --- >From 5da4bb34fba48f2455382261d59b2c97283bcf6f 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 ece2e433c..6254c5cc6 100644 --- a/lib/librte_net/rte_ip.h +++ b/lib/librte_net/rte_ip.h @@ -324,8 +324,7 @@ rte_ipv4_phdr_cksum(const struct rte_ipv4_hdr *ipv4_hdr, uint64_t ol_flags) * @param l4_hdr * 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 rte_ipv4_udptcp_cksum(const struct rte_ipv4_hdr *ipv4_hdr, const void *l4_hdr) @@ -344,7 +343,12 @@ rte_ipv4_udptcp_cksum(const struct rte_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; return (uint16_t)cksum; @@ -436,7 +440,12 @@ rte_ipv6_udptcp_cksum(const struct rte_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; return (uint16_t)cksum; -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-07-24 12:53:53.360013436 +0100 +++ 0125-net-fix-unneeded-replacement-of-TCP-checksum-0.patch 2020-07-24 12:53:48.419008919 +0100 @@ -1,4 +1,4 @@ -From d5df2ae0428a147b80bbb65d623f88f75d28b226 Mon Sep 17 00:00:00 2001 +From 5da4bb34fba48f2455382261d59b2c97283bcf6f 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 @@ -6,6 +6,8 @@ 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 @@ -14,7 +16,6 @@ RFC793 for TCP has no such special treatment for the checksum of zero. Fixes: 6006818cfb26 ("net: new checksum functions") -Cc: stable@dpdk.org Signed-off-by: Hongzhi Guo Acked-by: Olivier Matz @@ -24,7 +25,7 @@ 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/lib/librte_net/rte_ip.h b/lib/librte_net/rte_ip.h -index 292f63fd7..a9ffc3357 100644 +index ece2e433c..6254c5cc6 100644 --- a/lib/librte_net/rte_ip.h +++ b/lib/librte_net/rte_ip.h @@ -324,8 +324,7 @@ rte_ipv4_phdr_cksum(const struct rte_ipv4_hdr *ipv4_hdr, uint64_t ol_flags) @@ -51,7 +52,7 @@ cksum = 0xffff; return (uint16_t)cksum; -@@ -438,7 +442,12 @@ rte_ipv6_udptcp_cksum(const struct rte_ipv6_hdr *ipv6_hdr, const void *l4_hdr) +@@ -436,7 +440,12 @@ rte_ipv6_udptcp_cksum(const struct rte_ipv6_hdr *ipv6_hdr, const void *l4_hdr) cksum = ((cksum & 0xffff0000) >> 16) + (cksum & 0xffff); cksum = (~cksum) & 0xffff;