DPDK patches and discussions
 help / color / mirror / Atom feed
From: edwin.brossette@6wind.com
To: dev@dpdk.org
Cc: olivier.matz@6wind.com, didier.pallard@6wind.com,
	lauren.hardy@6wind.com, dsinghrawat@marvell.com,
	palok@marvell.com, stable@dpdk.org,
	Edwin Brossette <edwin.brossette@6wind.com>
Subject: [PATCH 1/5] qede: fix tunnel checksums offload flags
Date: Tue, 22 Apr 2025 17:51:39 +0200	[thread overview]
Message-ID: <20250422155143.3893525-1-edwin.brossette@6wind.com> (raw)
In-Reply-To: <CANDF9xDNq9Yy+FujvGcc3r1ycjbJDJmnP4_ih+LEm-07=jHDcA@mail.gmail.com>

From: Didier Pallard <didier.pallard@6wind.com>

In tunnel case, L3 bad checksum is properly setting
RTE_MBUF_F_RX_OUTER_IP_CKSUM_BAD while all other flags are set in inner
part of offload flags, this can cause both L4 flags BAD and GOOD to be set
in inner offloads when a tunnel packet is processed, changing these flags
to RTE_MBUF_F_RX_L4_CKSUM_NONE instead of GOOD/BAD values. This in turn can
cause upper layers to take incorrect decision on what to do with the
packet.

Remove IP_CKSUM_GOOD flag on outer IP layer, since there is currently no
way to indicate that this csum is good using DPDK offload flags.

Fixes: 81f8804992c9 ("net/qede: enhance Rx CPU utilization")
Fixes: 3d4bb4411683 ("net/qede: add fastpath support for VXLAN tunneling")
CC: stable@dpdk.org

Signed-off-by: Edwin Brossette <edwin.brossette@6wind.com>
Signed-off-by: Didier Pallard <didier.pallard@6wind.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
---
 drivers/net/qede/qede_rxtx.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/net/qede/qede_rxtx.c b/drivers/net/qede/qede_rxtx.c
index 25e28fd9f61b..c764e3d83763 100644
--- a/drivers/net/qede/qede_rxtx.c
+++ b/drivers/net/qede/qede_rxtx.c
@@ -1617,9 +1617,9 @@ qede_recv_pkts_regular(void *p_rxq, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
 					    "L4 csum failed, flags = 0x%x",
 					    parse_flag);
 				rxq->rx_hw_errors++;
-				ol_flags |= RTE_MBUF_F_RX_L4_CKSUM_BAD;
+				ol_flags |= RTE_MBUF_F_RX_OUTER_L4_CKSUM_BAD;
 			} else {
-				ol_flags |= RTE_MBUF_F_RX_L4_CKSUM_GOOD;
+				ol_flags |= RTE_MBUF_F_RX_OUTER_L4_CKSUM_GOOD;
 			}
 
 			if (unlikely(qede_check_tunn_csum_l3(parse_flag))) {
@@ -1628,8 +1628,6 @@ qede_recv_pkts_regular(void *p_rxq, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
 					parse_flag);
 				rxq->rx_hw_errors++;
 				ol_flags |= RTE_MBUF_F_RX_OUTER_IP_CKSUM_BAD;
-			} else {
-				ol_flags |= RTE_MBUF_F_RX_IP_CKSUM_GOOD;
 			}
 
 			flags = fp_cqe->tunnel_pars_flags.flags;
@@ -1887,9 +1885,9 @@ qede_recv_pkts(void *p_rxq, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
 					    "L4 csum failed, flags = 0x%x",
 					    parse_flag);
 				rxq->rx_hw_errors++;
-				ol_flags |= RTE_MBUF_F_RX_L4_CKSUM_BAD;
+				ol_flags |= RTE_MBUF_F_RX_OUTER_L4_CKSUM_BAD;
 			} else {
-				ol_flags |= RTE_MBUF_F_RX_L4_CKSUM_GOOD;
+				ol_flags |= RTE_MBUF_F_RX_OUTER_L4_CKSUM_GOOD;
 			}
 
 			if (unlikely(qede_check_tunn_csum_l3(parse_flag))) {
@@ -1898,8 +1896,6 @@ qede_recv_pkts(void *p_rxq, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
 					parse_flag);
 				  rxq->rx_hw_errors++;
 				ol_flags |= RTE_MBUF_F_RX_OUTER_IP_CKSUM_BAD;
-			} else {
-				ol_flags |= RTE_MBUF_F_RX_IP_CKSUM_GOOD;
 			}
 
 			if (tpa_start_flg)
-- 
2.35.0.4.g44a5d4affccf


  reply	other threads:[~2025-04-22 15:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-22 15:39 QEDE bug report Edwin Brossette
2025-04-22 15:51 ` edwin.brossette [this message]
2025-04-22 15:51   ` [PATCH 2/5] net/qede: fix bad sanity check on Rx queue release edwin.brossette
2025-04-23 15:30     ` Stephen Hemminger
2025-04-22 15:51   ` [PATCH 3/5] Revert "net/qede: fix maximum Rx packet length" edwin.brossette
2025-04-22 15:51   ` [PATCH 4/5] net/qede: fix QEDE_ETH_OVERHEAD being counted twice in rx_buf_size edwin.brossette
2025-04-22 15:51   ` [PATCH 5/5] net/qede: fix rx_buf_size calculation edwin.brossette

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=20250422155143.3893525-1-edwin.brossette@6wind.com \
    --to=edwin.brossette@6wind.com \
    --cc=dev@dpdk.org \
    --cc=didier.pallard@6wind.com \
    --cc=dsinghrawat@marvell.com \
    --cc=lauren.hardy@6wind.com \
    --cc=olivier.matz@6wind.com \
    --cc=palok@marvell.com \
    --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).