From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id AD1965688 for ; Tue, 20 Nov 2018 20:15:52 +0100 (CET) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1E763300157B; Tue, 20 Nov 2018 19:15:52 +0000 (UTC) Received: from ktraynor.remote.csb (unknown [10.36.118.7]) by smtp.corp.redhat.com (Postfix) with ESMTP id 47C92600C3; Tue, 20 Nov 2018 19:15:51 +0000 (UTC) From: Kevin Traynor To: Alejandro Lucero Cc: dpdk stable Date: Tue, 20 Nov 2018 19:12:40 +0000 Message-Id: <20181120191252.30277-50-ktraynor@redhat.com> In-Reply-To: <20181120191252.30277-1-ktraynor@redhat.com> References: <20181120191252.30277-1-ktraynor@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Tue, 20 Nov 2018 19:15:52 +0000 (UTC) Subject: [dpdk-stable] patch 'net/nfp: fix mbuf flags with checksum good' has been queued to stable release 18.08.1 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: , X-List-Received-Date: Tue, 20 Nov 2018 19:15:53 -0000 Hi, FYI, your patch has been queued to stable release 18.08.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 11/23/18. 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. If the code is different (ie: not only metadata diffs), due for example to a change in context or macro names, please double check it. Thanks. Kevin Traynor --- >>From 6a81b56797da0aeb14a32582c1ef57335dc8577b Mon Sep 17 00:00:00 2001 From: Alejandro Lucero Date: Thu, 6 Sep 2018 17:02:56 +0100 Subject: [PATCH] net/nfp: fix mbuf flags with checksum good [ upstream commit 0962b51d3c494b30602897731ef9d598e29b4f3b ] If checksum offload enabled and hardware reports checksum as good, update mbuf ol_flags with proper *_CKSUM_GOOD bits. Fixes: b812daadad0d ("nfp: add Rx and Tx") Signed-off-by: Alejandro Lucero --- drivers/net/nfp/nfp_net.c | 15 +++++++-------- drivers/net/nfp/nfp_net_pmd.h | 2 ++ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c index ee743e975..a588a3fe0 100644 --- a/drivers/net/nfp/nfp_net.c +++ b/drivers/net/nfp/nfp_net.c @@ -1787,7 +1787,9 @@ nfp_net_rx_cksum(struct nfp_net_rxq *rxq, struct nfp_net_rx_desc *rxd, /* If IPv4 and IP checksum error, fail */ - if ((rxd->rxd.flags & PCIE_DESC_RX_IP4_CSUM) && - !(rxd->rxd.flags & PCIE_DESC_RX_IP4_CSUM_OK)) + if (unlikely((rxd->rxd.flags & PCIE_DESC_RX_IP4_CSUM) && + !(rxd->rxd.flags & PCIE_DESC_RX_IP4_CSUM_OK))) mb->ol_flags |= PKT_RX_IP_CKSUM_BAD; + else + mb->ol_flags |= PKT_RX_IP_CKSUM_GOOD; /* If neither UDP nor TCP return */ @@ -1796,10 +1798,7 @@ nfp_net_rx_cksum(struct nfp_net_rxq *rxq, struct nfp_net_rx_desc *rxd, return; - if ((rxd->rxd.flags & PCIE_DESC_RX_TCP_CSUM) && - !(rxd->rxd.flags & PCIE_DESC_RX_TCP_CSUM_OK)) - mb->ol_flags |= PKT_RX_L4_CKSUM_BAD; - - if ((rxd->rxd.flags & PCIE_DESC_RX_UDP_CSUM) && - !(rxd->rxd.flags & PCIE_DESC_RX_UDP_CSUM_OK)) + if (likely(rxd->rxd.flags & PCIE_DESC_RX_L4_CSUM_OK)) + mb->ol_flags |= PKT_RX_L4_CKSUM_GOOD; + else mb->ol_flags |= PKT_RX_L4_CKSUM_BAD; } diff --git a/drivers/net/nfp/nfp_net_pmd.h b/drivers/net/nfp/nfp_net_pmd.h index c1b044eea..b01036df2 100644 --- a/drivers/net/nfp/nfp_net_pmd.h +++ b/drivers/net/nfp/nfp_net_pmd.h @@ -294,4 +294,6 @@ struct nfp_net_txq { #define PCIE_DESC_RX_VLAN (1 << 0) +#define PCIE_DESC_RX_L4_CSUM_OK (PCIE_DESC_RX_TCP_CSUM_OK | \ + PCIE_DESC_RX_UDP_CSUM_OK) struct nfp_net_rx_desc { union { -- 2.19.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2018-11-20 17:53:08.643099349 +0000 +++ 0050-net-nfp-fix-mbuf-flags-with-checksum-good.patch 2018-11-20 17:53:07.000000000 +0000 @@ -1,13 +1,14 @@ -From 0962b51d3c494b30602897731ef9d598e29b4f3b Mon Sep 17 00:00:00 2001 +From 6a81b56797da0aeb14a32582c1ef57335dc8577b Mon Sep 17 00:00:00 2001 From: Alejandro Lucero Date: Thu, 6 Sep 2018 17:02:56 +0100 Subject: [PATCH] net/nfp: fix mbuf flags with checksum good +[ upstream commit 0962b51d3c494b30602897731ef9d598e29b4f3b ] + If checksum offload enabled and hardware reports checksum as good, update mbuf ol_flags with proper *_CKSUM_GOOD bits. Fixes: b812daadad0d ("nfp: add Rx and Tx") -Cc: stable@dpdk.org Signed-off-by: Alejandro Lucero --- @@ -16,10 +17,10 @@ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c -index 168088c6d..170b5d611 100644 +index ee743e975..a588a3fe0 100644 --- a/drivers/net/nfp/nfp_net.c +++ b/drivers/net/nfp/nfp_net.c -@@ -1780,7 +1780,9 @@ nfp_net_rx_cksum(struct nfp_net_rxq *rxq, struct nfp_net_rx_desc *rxd, +@@ -1787,7 +1787,9 @@ nfp_net_rx_cksum(struct nfp_net_rxq *rxq, struct nfp_net_rx_desc *rxd, /* If IPv4 and IP checksum error, fail */ - if ((rxd->rxd.flags & PCIE_DESC_RX_IP4_CSUM) && @@ -31,7 +32,7 @@ + mb->ol_flags |= PKT_RX_IP_CKSUM_GOOD; /* If neither UDP nor TCP return */ -@@ -1789,10 +1791,7 @@ nfp_net_rx_cksum(struct nfp_net_rxq *rxq, struct nfp_net_rx_desc *rxd, +@@ -1796,10 +1798,7 @@ nfp_net_rx_cksum(struct nfp_net_rxq *rxq, struct nfp_net_rx_desc *rxd, return; - if ((rxd->rxd.flags & PCIE_DESC_RX_TCP_CSUM) &&