Skip to content

Commit

Permalink
net/bnxt: fix L4 checksum indication in non-vector Rx
Browse files Browse the repository at this point in the history
[ upstream commit b875339 ]

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

Fixes: 65ee636 ("net/bnxt: fix Rx checksum flags")

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
  • Loading branch information
Kalesh AP authored and kevintraynor committed Dec 11, 2019
1 parent aa99674 commit 1ff0885
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions drivers/net/bnxt/bnxt_rxr.c
Expand Up @@ -447,15 +447,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 */
Expand Down

0 comments on commit 1ff0885

Please sign in to comment.