DPDK patches and discussions
 help / color / mirror / Atom feed
From: Kalesh A P <kalesh-anakkur.purayil@broadcom.com>
To: dev@dpdk.org
Cc: ferruh.yigit@intel.com
Subject: [dpdk-dev] [PATCH 1/5] net/bnxt: fix L4 checksum error indication in non-vector mode rx
Date: Wed, 30 Oct 2019 13:34:34 +0530	[thread overview]
Message-ID: <20191030080438.27530-2-kalesh-anakkur.purayil@broadcom.com> (raw)
In-Reply-To: <20191030080438.27530-1-kalesh-anakkur.purayil@broadcom.com>

From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>

Update "mbuf->ol_flags" correctly for inner and ourter ip checksum
errors in case of tunnel and non-tunnel packets.

Fixes: 65ee636872eb ("net/bnxt: fix Rx checksum flags")
Cc: stable@dpdk.org

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
---
 drivers/net/bnxt/bnxt_rxr.c | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c
index ee1444c..c35bc1a 100644
--- a/drivers/net/bnxt/bnxt_rxr.c
+++ b/drivers/net/bnxt/bnxt_rxr.c
@@ -512,15 +512,19 @@ static int bnxt_rx_pkt(struct rte_mbuf **rx_pkt,
 
 	flags2_f = flags2_0xf(rxcmp1);
 	/* IP Checksum */
-	if (unlikely(((IS_IP_NONTUNNEL_PKT(flags2_f)) &&
-		      (RX_CMP_IP_CS_ERROR(rxcmp1))) ||
-		     (IS_IP_TUNNEL_PKT(flags2_f) &&
-		      (RX_CMP_IP_OUTER_CS_ERROR(rxcmp1))))) {
-		mbuf->ol_flags |= PKT_RX_IP_CKSUM_BAD;
+	if (likely(IS_IP_NONTUNNEL_PKT(flags2_f))) {
+		if (unlikely(RX_CMP_IP_CS_ERROR(rxcmp1)))
+			mbuf->ol_flags |= PKT_RX_IP_CKSUM_BAD;
+		else
+			mbuf->ol_flags |= PKT_RX_IP_CKSUM_GOOD;
+	} else if (IS_IP_TUNNEL_PKT(flags2_f)) {
+		if (unlikely(RX_CMP_IP_OUTER_CS_ERROR(rxcmp1) ||
+			     RX_CMP_IP_CS_ERROR(rxcmp1)))
+			mbuf->ol_flags |= PKT_RX_IP_CKSUM_BAD;
+		else
+			mbuf->ol_flags |= PKT_RX_IP_CKSUM_GOOD;
 	} else if (unlikely(RX_CMP_IP_CS_UNKNOWN(rxcmp1))) {
 		mbuf->ol_flags |= PKT_RX_IP_CKSUM_UNKNOWN;
-	} else {
-		mbuf->ol_flags |= PKT_RX_IP_CKSUM_GOOD;
 	}
 
 	/* L4 Checksum */
-- 
1.8.3.1


  reply	other threads:[~2019-10-30  7:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-30  8:04 [dpdk-dev] [PATCH 0/5] bnxt patchset with bug fixes Kalesh A P
2019-10-30  8:04 ` Kalesh A P [this message]
2019-10-30  8:04 ` [dpdk-dev] [PATCH 2/5] net/bnxt: refactor vlan filtering code Kalesh A P
2019-10-30  8:04 ` [dpdk-dev] [PATCH 3/5] net/bnxt: fix vnic allocation failure on port toggle Kalesh A P
2019-10-30  8:04 ` [dpdk-dev] [PATCH 4/5] net/bnxt: fix a failure case during initialization Kalesh A P
2019-10-30  8:04 ` [dpdk-dev] [PATCH 5/5] net/bnxt: fix incorrect COS queue mapping Kalesh A P

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=20191030080438.27530-2-kalesh-anakkur.purayil@broadcom.com \
    --to=kalesh-anakkur.purayil@broadcom.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    /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).