Skip to content

Commit

Permalink
net/ena: fix checksum flag for L4
Browse files Browse the repository at this point in the history
[ upstream commit b2d2f1c ]

Some HW may invalidly set checksum error bit for the valid L4 checksum.
To avoid drop of the packets in that situation, do not indicate bad
checksum for L4 Rx csum offloads. Instead, set it as unknown, so the
application will re-verify this value.

The statistics counters will still work as previously.

Fixes: 0581705 ("net/ena: fix indication of bad L4 Rx checksums")

Signed-off-by: Michal Krawczyk <mk@semihalf.com>
  • Loading branch information
Gerwand authored and bluca committed Feb 28, 2022
1 parent c73e88d commit b94aa34
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drivers/net/ena/ena_ethdev.c
Expand Up @@ -337,7 +337,13 @@ static inline void ena_rx_mbuf_prepare(struct rte_mbuf *mbuf,
ol_flags |= PKT_RX_L4_CKSUM_UNKNOWN;
else
if (unlikely(ena_rx_ctx->l4_csum_err))
ol_flags |= PKT_RX_L4_CKSUM_BAD;
/*
* For the L4 Rx checksum offload the HW may indicate
* bad checksum although it's valid. Because of that,
* we're setting the UNKNOWN flag to let the app
* re-verify the checksum.
*/
ol_flags |= PKT_RX_L4_CKSUM_UNKNOWN;
else
ol_flags |= PKT_RX_L4_CKSUM_GOOD;

Expand Down

0 comments on commit b94aa34

Please sign in to comment.