From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by dpdk.org (Postfix) with ESMTP id 094671B3A4 for ; Wed, 3 Oct 2018 18:52:50 +0200 (CEST) Received: by mail-wr1-f68.google.com with SMTP id w5-v6so6939263wrt.2 for ; Wed, 03 Oct 2018 09:52:49 -0700 (PDT) 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=hVfUxsdsrPguS3TpkZ3w3n5/PvzVnNeTkFge6fdxR94=; b=sjdSIRzjTIqIjg/XkwY28BzABjoOQmiTYrt3nkqnU6Zso/uqPGqlh/G744C9B1SOQ1 SPcEFKx9auyy3IXfz4mrzTTvHZfceeUk4AtgaOT6CG8nJ5zYtoSktENstYX0LTGIz4po lD8YXRQJ+N/fsKOXWGpOSaYe9DjKJNxtMysGbOjZQHpUAJ+SkD4CVCkasP9sXVoUgVIu sOs5h+gEdgcG640a+32xdTejkFcwX/0j4iNmEyzcfGxnagQ/tR5W+juocrYOsnfsLyup tdmEksTbp1oB5IGAi+pdOscSkUegoosh2ZeyWxkT/B2sopfzY0JefLaEnbe+v9cd6Yr9 vtAQ== X-Gm-Message-State: ABuFfohlUIHbpAhuCxRb1xtOv4vvFVM5vv1gYvC0eECDuykovkHpSKYR IwIuOnB4nctIkcSP4fRq33I= X-Google-Smtp-Source: ACcGV61o7Zne7wEAuFQJJR++ztlgRr3l4JrhpMxjRvU9zZfO5z2exxgkzhG/OYWW7JJdpMOV/Jryfw== X-Received: by 2002:adf:81e1:: with SMTP id 88-v6mr2214223wra.19.1538585569295; Wed, 03 Oct 2018 09:52:49 -0700 (PDT) Received: from localhost ([2a01:4b00:f419:6f00:8361:8946:ba2b:d556]) by smtp.gmail.com with ESMTPSA id a105-v6sm3843542wrc.23.2018.10.03.09.52.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Oct 2018 09:52:47 -0700 (PDT) From: Luca Boccassi To: Alejandro Lucero Cc: dpdk stable Date: Wed, 3 Oct 2018 17:52:34 +0100 Message-Id: <20181003165239.8531-1-bluca@debian.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181003162121.16364-1-bluca@debian.org> References: <20181003162121.16364-1-bluca@debian.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/nfp: fix mbuf flags with checksum good' has been queued to LTS release 16.11.9 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: Wed, 03 Oct 2018 16:52:50 -0000 Hi, FYI, your patch has been queued to LTS release 16.11.9 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 10/05/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. Luca Boccassi --- >>From 2a0d7bd97b6fdda48918015f4a6a28772b9991ca 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 85fd6bda05..9548d58af4 100644 --- a/drivers/net/nfp/nfp_net.c +++ b/drivers/net/nfp/nfp_net.c @@ -1567,21 +1567,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 c1809720fb..ce475e39da 100644 --- a/drivers/net/nfp/nfp_net_pmd.h +++ b/drivers/net/nfp/nfp_net_pmd.h @@ -279,6 +279,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.19.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2018-10-03 17:44:54.597757237 +0100 +++ 0001-net-nfp-fix-mbuf-flags-with-checksum-good.patch 2018-10-03 17:44:54.562534580 +0100 @@ -1,13 +1,14 @@ -From 0962b51d3c494b30602897731ef9d598e29b4f3b Mon Sep 17 00:00:00 2001 +From 2a0d7bd97b6fdda48918015f4a6a28772b9991ca 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 168088c6de..170b5d611f 100644 +index 85fd6bda05..9548d58af4 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, +@@ -1567,21 +1567,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 c1b044eea4..b01036df2f 100644 +index c1809720fb..ce475e39da 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 { +@@ -279,6 +279,8 @@ struct nfp_net_txq { #define PCIE_DESC_RX_UDP_CSUM_OK (1 << 1) #define PCIE_DESC_RX_VLAN (1 << 0)