DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ajit Khaparde <ajit.khaparde@broadcom.com>
To: dev@dpdk.org
Cc: stable@dpdk.org
Subject: [dpdk-dev] [PATCH v2 7/7] net/bnxt: fix Rx checksum flags
Date: Tue, 22 May 2018 11:13:47 -0700	[thread overview]
Message-ID: <20180522181347.28083-8-ajit.khaparde@broadcom.com> (raw)
In-Reply-To: <20180522181347.28083-1-ajit.khaparde@broadcom.com>

For frames where the hardware is not able to calculate checksum
we are indicating such frames to be bad. And that is incorrect.
Indicate PKT_RX_IP_CKSUM_UNKNOWN or PKT_RX_L4_CKSUM_UNKNOWN
for such frames.

Fixes: 7ec39d8c524b ("net/bnxt: update status of Rx IP/L4 CKSUM")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_rxr.c | 4 ++++
 drivers/net/bnxt/bnxt_rxr.h | 6 ++++++
 2 files changed, 10 insertions(+)

diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c
index a8b5d6683..9d8842926 100644
--- a/drivers/net/bnxt/bnxt_rxr.c
+++ b/drivers/net/bnxt/bnxt_rxr.c
@@ -464,11 +464,15 @@ static int bnxt_rx_pkt(struct rte_mbuf **rx_pkt,
 
 	if (likely(RX_CMP_IP_CS_OK(rxcmp1)))
 		mbuf->ol_flags |= PKT_RX_IP_CKSUM_GOOD;
+	else if (likely(RX_CMP_IP_CS_UNKNOWN(rxcmp1)))
+		mbuf->ol_flags |= PKT_RX_IP_CKSUM_UNKNOWN;
 	else
 		mbuf->ol_flags |= PKT_RX_IP_CKSUM_BAD;
 
 	if (likely(RX_CMP_L4_CS_OK(rxcmp1)))
 		mbuf->ol_flags |= PKT_RX_L4_CKSUM_GOOD;
+	else if (likely(RX_CMP_L4_CS_UNKNOWN(rxcmp1)))
+		mbuf->ol_flags |= PKT_RX_L4_CKSUM_UNKNOWN;
 	else
 		mbuf->ol_flags |= PKT_RX_L4_CKSUM_BAD;
 
diff --git a/drivers/net/bnxt/bnxt_rxr.h b/drivers/net/bnxt/bnxt_rxr.h
index e8c47ca56..5b28f0321 100644
--- a/drivers/net/bnxt/bnxt_rxr.h
+++ b/drivers/net/bnxt/bnxt_rxr.h
@@ -36,6 +36,9 @@
 	    (((rxcmp1)->flags2 & RX_CMP_L4_CS_BITS) &&		\
 	     !((rxcmp1)->errors_v2 & RX_CMP_L4_CS_ERR_BITS))
 
+#define RX_CMP_L4_CS_UNKNOWN(rxcmp1)					\
+	    !((rxcmp1)->flags2 & RX_CMP_L4_CS_BITS)
+
 #define RX_CMP_IP_CS_ERR_BITS	\
 	rte_cpu_to_le_32(RX_PKT_CMPL_ERRORS_IP_CS_ERROR | \
 			 RX_PKT_CMPL_ERRORS_T_IP_CS_ERROR)
@@ -48,6 +51,9 @@
 		(((rxcmp1)->flags2 & RX_CMP_IP_CS_BITS) &&	\
 		!((rxcmp1)->errors_v2 & RX_CMP_IP_CS_ERR_BITS))
 
+#define RX_CMP_IP_CS_UNKNOWN(rxcmp1)					\
+		!((rxcmp1)->flags2 & RX_CMP_IP_CS_BITS)
+
 enum pkt_hash_types {
 	PKT_HASH_TYPE_NONE,	/* Undefined type */
 	PKT_HASH_TYPE_L2,	/* Input: src_MAC, dest_MAC */
-- 
2.15.1 (Apple Git-101)

  parent reply	other threads:[~2018-05-22 18:13 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-18 14:39 [dpdk-dev] [PATCH 0/7] bnxt patchset Ajit Khaparde
2018-05-18 14:39 ` [dpdk-dev] [PATCH 1/7] net/bnxt: add fallthrough comments for cascading switch cases Ajit Khaparde
2018-05-18 14:39 ` [dpdk-dev] [PATCH 2/7] net/bnxt: fix to initialize tx and rx burst for secondary processes Ajit Khaparde
2018-05-18 14:39 ` [dpdk-dev] [PATCH 3/7] net/bnxt: fix rss hash configuration Ajit Khaparde
2018-05-18 14:39 ` [dpdk-dev] [PATCH 4/7] net/bnxt: fix to use 1st completion ring for forwarding and async events Ajit Khaparde
2018-05-18 14:39 ` [dpdk-dev] [PATCH 5/7] net/bnxt: fix VF resource allocation Ajit Khaparde
2018-05-18 14:40 ` [dpdk-dev] [PATCH 6/7] net/bnxt: fix xstats support for VF Ajit Khaparde
2018-05-18 14:40 ` [dpdk-dev] [PATCH 7/7] net/bnxt: fix Rx checksum flags Ajit Khaparde
2018-05-18 17:01 ` [dpdk-dev] [PATCH 0/7] bnxt patchset Ferruh Yigit
2018-05-22 18:13   ` [dpdk-dev] [PATCH v2 " Ajit Khaparde
2018-05-22 18:13     ` [dpdk-dev] [PATCH v2 1/7] net/bnxt: add fallthrough comment Ajit Khaparde
2018-05-22 18:13     ` [dpdk-dev] [PATCH v2 2/7] net/bnxt: fix Tx and Rx burst for secondary processes Ajit Khaparde
2018-05-22 18:13     ` [dpdk-dev] [PATCH v2 3/7] net/bnxt: fix RSS hash configuration Ajit Khaparde
2018-05-22 18:13     ` [dpdk-dev] [PATCH v2 4/7] net/bnxt: fix to use 1st cmpl ring for fwd and async event Ajit Khaparde
2018-05-22 18:13     ` [dpdk-dev] [PATCH v2 5/7] net/bnxt: fix VF resource allocation Ajit Khaparde
2018-05-22 18:13     ` [dpdk-dev] [PATCH v2 6/7] net/bnxt: fix xstats support for VF Ajit Khaparde
2018-05-22 18:13     ` Ajit Khaparde [this message]
2018-05-22 20:42     ` [dpdk-dev] [PATCH v2 0/7] bnxt patchset Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180522181347.28083-8-ajit.khaparde@broadcom.com \
    --to=ajit.khaparde@broadcom.com \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).