net/bnxt: fix IP checksum error indication in non-vector mode rx

Message ID 20191115045028.11319-1-somnath.kotur@broadcom.com (mailing list archive)
State Accepted, archived
Delegated to: Ajit Khaparde
Headers
Series net/bnxt: fix IP checksum error indication in non-vector mode rx |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-compilation success Compile Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/travis-robot success Travis build: passed

Commit Message

Somnath Kotur Nov. 15, 2019, 4:50 a.m. UTC
  From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>

Update "mbuf->ol_flags" correctly for 'Checksum Unknown' errors
for both tunneled and non-tunneled IP packets.

Fixes: b875339622a3 ("net/bnxt: fix L4 checksum indication in non-vector Rx")

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

Comments

Ajit Khaparde Nov. 15, 2019, 5:24 a.m. UTC | #1
On Thu, Nov 14, 2019 at 8:58 PM Somnath Kotur <somnath.kotur@broadcom.com>
wrote:

> From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
>
> Update "mbuf->ol_flags" correctly for 'Checksum Unknown' errors
> for both tunneled and non-tunneled IP packets.
>
> Fixes: b875339622a3 ("net/bnxt: fix L4 checksum indication in non-vector
> Rx")
>
> Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
> Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
>
Patch applied to dpdk-next-net-brcm.


> ---
>  drivers/net/bnxt/bnxt_rxr.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c
> index c35bc1afd..3b713c242 100644
> --- a/drivers/net/bnxt/bnxt_rxr.c
> +++ b/drivers/net/bnxt/bnxt_rxr.c
> @@ -515,16 +515,18 @@ static int bnxt_rx_pkt(struct rte_mbuf **rx_pkt,
>         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 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;
>         } 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 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;
> -       } else if (unlikely(RX_CMP_IP_CS_UNKNOWN(rxcmp1))) {
> -               mbuf->ol_flags |= PKT_RX_IP_CKSUM_UNKNOWN;
>         }
>
>         /* L4 Checksum */
> --
> 2.23.0.rc1
>
>
  

Patch

diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c
index c35bc1afd..3b713c242 100644
--- a/drivers/net/bnxt/bnxt_rxr.c
+++ b/drivers/net/bnxt/bnxt_rxr.c
@@ -515,16 +515,18 @@  static int bnxt_rx_pkt(struct rte_mbuf **rx_pkt,
 	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 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;
 	} 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 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;
-	} else if (unlikely(RX_CMP_IP_CS_UNKNOWN(rxcmp1))) {
-		mbuf->ol_flags |= PKT_RX_IP_CKSUM_UNKNOWN;
 	}
 
 	/* L4 Checksum */