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 BF0E0A0C4C for ; Mon, 12 Jul 2021 15:13:41 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BA1AA40685; Mon, 12 Jul 2021 15:13:41 +0200 (CEST) Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) by mails.dpdk.org (Postfix) with ESMTP id D7CF44119C for ; Mon, 12 Jul 2021 15:13:40 +0200 (CEST) Received: by mail-wr1-f46.google.com with SMTP id l7so24638284wrv.7 for ; Mon, 12 Jul 2021 06:13:40 -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=+lbPZ6z0AGdfeKl97w+S/hIqG6Up91bVXW+Yah6rNVE=; b=lpQp9CkEUFSg0a3knZf0ix5/Onk1Y8FwErypeGu5+vA/JiEytINpE5NLggMxC07Mt4 /QyD6lQiST7tiz7tYHfwGSnqDysyDpqutJ280OLta84d8vClcGDFpTtOyFsWnCPxB1Ol 0Zs3vezzGWaOApLVL8czelXsL8tShFbbHp+nU2eYLYq5EcjzxQ2tO4R0IKjvvEWhSfca bRMM66APb4gL+IPrQEeISaLjVZ7GSxhc9sYHnwxvFIGxIbBdq9zpsFgDEnsn/QpnvyLk yKcKlA4rnJNWyataXq2yFZO367Opyb+7h4gooelPcUIIFvQgRmvDkYaleWf5wfQftMrs IcbA== 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=+lbPZ6z0AGdfeKl97w+S/hIqG6Up91bVXW+Yah6rNVE=; b=kM8hI0wUQRAx2YodEjkmOVW9tKxEtPimEx1WkHS8vp4GA/ehZ9E9F7aq3eGex7oHXH 4KtJ4LssdtU2BpfkT02RGq8qsboqP0E/iAbYiQdlOitBOpupauBaW7J3e/zrNr0dWgVY 9CpyiUE+owLepmjqbqaqo8jw2PM3MaPkfZ+1aVP22PNke0eKI2xceRyo6z6Um6n0+YX2 0rVfQPK8jDhM6h7+vP+gMkRavDKLpRXBXekmEgi849K/3BtgKiooH5zch7PCAusVb54c 4ymzjiYG2xp8FrhlKFM7nQBH/UWt67Q04v6OsWVvY3IH+C+R9LT6Z2ftJyKESpCDVbDH 7ldQ== X-Gm-Message-State: AOAM530UgCQKgJat54kZUB8Q1HoQkc6iF9SO1R9GlNpGjyEHW5cU7EdC uQJwg/v/g0yFahkcgYoGG9o= X-Google-Smtp-Source: ABdhPJwmPXs4wGTKTTidcSY093B2Ann9aePmC0EfLWW8BqmV91RK/MUQH8NEr3AeHfp9lUc/eAI2jA== X-Received: by 2002:a05:6000:52:: with SMTP id k18mr24685615wrx.270.1626095620687; Mon, 12 Jul 2021 06:13:40 -0700 (PDT) Received: from localhost ([137.220.125.106]) by smtp.gmail.com with ESMTPSA id 204sm12937856wma.30.2021.07.12.06.13.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jul 2021 06:13:40 -0700 (PDT) From: luca.boccassi@gmail.com To: Olivier Matz Cc: Andrew Rybchenko , dpdk stable Date: Mon, 12 Jul 2021 14:05:03 +0100 Message-Id: <20210712130551.2462159-68-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210712130551.2462159-1-luca.boccassi@gmail.com> References: <20210712130551.2462159-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/tap: fix Rx checksum flags on TCP packets' has been queued to stable release 20.11.3 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 Sender: "stable" Hi, FYI, your patch has been queued to stable release 20.11.3 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/14/21. 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/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/f4a79bb95234970d33823921e19d6f25de3df95b Thanks. Luca Boccassi --- >From f4a79bb95234970d33823921e19d6f25de3df95b Mon Sep 17 00:00:00 2001 From: Olivier Matz Date: Wed, 30 Jun 2021 15:51:56 +0200 Subject: [PATCH] net/tap: fix Rx checksum flags on TCP packets [ upstream commit 375474b4d9a89456bd0d8baa4b610d3157ee262c ] Since commit d5df2ae0428a ("net: fix unneeded replacement of TCP checksum 0"), the functions rte_ipv4_udptcp_cksum() or rte_ipv6_udptcp_cksum() can return either 0x0000 or 0xffff when used to verify a packet containing a valid checksum. This new behavior broke the checksum verification in tap driver for TCP packets: these packets are marked with PKT_RX_L4_CKSUM_BAD. Fix this by checking the 2 possible values. A next commit will introduce a checksum verification helper to simplify this a bit. Fixes: d5df2ae0428a ("net: fix unneeded replacement of TCP checksum 0") Signed-off-by: Olivier Matz Acked-by: Andrew Rybchenko --- drivers/net/tap/rte_eth_tap.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c index cf42809461..691566b263 100644 --- a/drivers/net/tap/rte_eth_tap.c +++ b/drivers/net/tap/rte_eth_tap.c @@ -350,6 +350,8 @@ tap_verify_csum(struct rte_mbuf *mbuf) return; } if (l4 == RTE_PTYPE_L4_UDP || l4 == RTE_PTYPE_L4_TCP) { + int cksum_ok; + l4_hdr = rte_pktmbuf_mtod_offset(mbuf, void *, l2_len + l3_len); /* Don't verify checksum for multi-segment packets. */ if (mbuf->nb_segs > 1) @@ -367,13 +369,13 @@ tap_verify_csum(struct rte_mbuf *mbuf) return; } } - cksum = ~rte_ipv4_udptcp_cksum(l3_hdr, l4_hdr); + cksum = rte_ipv4_udptcp_cksum(l3_hdr, l4_hdr); } else { /* l3 == RTE_PTYPE_L3_IPV6, checked above */ - cksum = ~rte_ipv6_udptcp_cksum(l3_hdr, l4_hdr); + cksum = rte_ipv6_udptcp_cksum(l3_hdr, l4_hdr); } - mbuf->ol_flags |= cksum ? - PKT_RX_L4_CKSUM_BAD : - PKT_RX_L4_CKSUM_GOOD; + cksum_ok = (cksum == 0) || (cksum == 0xffff); + mbuf->ol_flags |= cksum_ok ? + PKT_RX_L4_CKSUM_GOOD : PKT_RX_L4_CKSUM_BAD; } } -- 2.30.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-07-12 13:41:40.200299951 +0100 +++ 0068-net-tap-fix-Rx-checksum-flags-on-TCP-packets.patch 2021-07-12 13:41:36.566124194 +0100 @@ -1 +1 @@ -From 375474b4d9a89456bd0d8baa4b610d3157ee262c Mon Sep 17 00:00:00 2001 +From f4a79bb95234970d33823921e19d6f25de3df95b Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 375474b4d9a89456bd0d8baa4b610d3157ee262c ] + @@ -18 +19,0 @@ -Cc: stable@dpdk.org @@ -27 +28 @@ -index 5513cfd2d7..5429f611c1 100644 +index cf42809461..691566b263 100644