From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 93633322C for ; Fri, 30 Nov 2018 00:13:00 +0100 (CET) Received: from Internal Mail-Server by MTLPINE1 (envelope-from yskoh@mellanox.com) with ESMTPS (AES256-SHA encrypted); 30 Nov 2018 01:18:49 +0200 Received: from scfae-sc-2.mti.labs.mlnx (scfae-sc-2.mti.labs.mlnx [10.101.0.96]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id wATNCW7D032075; Fri, 30 Nov 2018 01:12:54 +0200 From: Yongseok Koh To: Alejandro Lucero Cc: dpdk stable Date: Thu, 29 Nov 2018 15:10:07 -0800 Message-Id: <20181129231202.30436-13-yskoh@mellanox.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20181129231202.30436-1-yskoh@mellanox.com> References: <20181129231202.30436-1-yskoh@mellanox.com> Subject: [dpdk-stable] patch 'net/nfp: fix mbuf flags with checksum good' has been queued to LTS release 17.11.5 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: Thu, 29 Nov 2018 23:13:01 -0000 Hi, FYI, your patch has been queued to LTS release 17.11.5 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 12/01/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. Yongseok --- >>From 05ce1e29af1e5f2ece6876728103964dd29c0a9e 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 8ab28ddec..db6f3f465 100644 --- a/drivers/net/nfp/nfp_net.c +++ b/drivers/net/nfp/nfp_net.c @@ -1822,21 +1822,20 @@ nfp_net_rx_cksum(struct nfp_net_rxq *rxq, struct nfp_net_rx_desc *rxd, return; /* 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 */ if (!(rxd->rxd.flags & PCIE_DESC_RX_TCP_CSUM) && !(rxd->rxd.flags & PCIE_DESC_RX_UDP_CSUM)) 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 1ae0ea626..084dfe6b5 100644 --- a/drivers/net/nfp/nfp_net_pmd.h +++ b/drivers/net/nfp/nfp_net_pmd.h @@ -284,6 +284,8 @@ struct nfp_net_txq { #define PCIE_DESC_RX_UDP_CSUM_OK (1 << 1) #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 { /* Freelist descriptor */ -- 2.11.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2018-11-29 15:01:45.875136606 -0800 +++ 0013-net-nfp-fix-mbuf-flags-with-checksum-good.patch 2018-11-29 15:01:44.987962000 -0800 @@ -1,13 +1,14 @@ -From 0962b51d3c494b30602897731ef9d598e29b4f3b Mon Sep 17 00:00:00 2001 +From 05ce1e29af1e5f2ece6876728103964dd29c0a9e 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 8ab28ddec..db6f3f465 100644 --- a/drivers/net/nfp/nfp_net.c +++ b/drivers/net/nfp/nfp_net.c -@@ -1779,21 +1779,20 @@ nfp_net_rx_cksum(struct nfp_net_rxq *rxq, struct nfp_net_rx_desc *rxd, +@@ -1822,21 +1822,20 @@ nfp_net_rx_cksum(struct nfp_net_rxq *rxq, struct nfp_net_rx_desc *rxd, return; /* If IPv4 and IP checksum error, fail */ @@ -49,10 +50,10 @@ } diff --git a/drivers/net/nfp/nfp_net_pmd.h b/drivers/net/nfp/nfp_net_pmd.h -index c1b044eea..b01036df2 100644 +index 1ae0ea626..084dfe6b5 100644 --- a/drivers/net/nfp/nfp_net_pmd.h +++ b/drivers/net/nfp/nfp_net_pmd.h -@@ -293,6 +293,8 @@ struct nfp_net_txq { +@@ -284,6 +284,8 @@ struct nfp_net_txq { #define PCIE_DESC_RX_UDP_CSUM_OK (1 << 1) #define PCIE_DESC_RX_VLAN (1 << 0)