DPDK patches and discussions
 help / color / mirror / Atom feed
From: Xingui Yang <yangxingui@huawei.com>
To: <dev@dpdk.org>
Cc: <stephen@networkplumber.org>, <david.marchand@redhat.com>,
	<fengchengwen@huawei.com>, <lihuisong@huawei.com>,
	<liuyonglong@huawei.com>, <kangfenglong@huawei.com>
Subject: [PATCH] net/hns3: fix outer UDP checksum fail with simple BD
Date: Fri, 5 Dec 2025 15:39:55 +0800	[thread overview]
Message-ID: <20251205073955.3225775-1-yangxingui@huawei.com> (raw)

From: Chengwen Feng <fengchengwen@huawei.com>

On the hardware platform that supports simple BD, if outer-ip, outer-udp
and udp checksum offloading are enabled, the hardware incorrectly
processes the ether+ipv6+vxlan+ether+ipv4+udp packet (the incorrect
field is modified).

The root cause is that the simple BD feature does not exclude outer-udp
checksum. This commit add it.

Fixes: 6393fc0b823c ("net/hns3: simplify hardware checksum offloading")
Cc: stable@dpdk.org

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Xingui Yang <yangxingui@huawei.com>
---
 drivers/net/hns3/hns3_rxtx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c
index 3a99923220..573604b0cd 100644
--- a/drivers/net/hns3/hns3_rxtx.c
+++ b/drivers/net/hns3/hns3_rxtx.c
@@ -3999,8 +3999,9 @@ hns3_handle_simple_bd(struct hns3_tx_queue *txq, struct hns3_desc *desc,
 	if (txq->simple_bd_enable && !(m->ol_flags & RTE_MBUF_F_TX_IP_CKSUM) &&
 	    !(m->ol_flags & RTE_MBUF_F_TX_TCP_SEG) &&
 	    !(m->ol_flags & RTE_MBUF_F_TX_OUTER_IP_CKSUM) &&
+	    !(m->ol_flags & RTE_MBUF_F_TX_OUTER_UDP_CKSUM) &&
 	    ((m->ol_flags & RTE_MBUF_F_TX_L4_MASK) == RTE_MBUF_F_TX_TCP_CKSUM ||
-	    (m->ol_flags & RTE_MBUF_F_TX_L4_MASK) == RTE_MBUF_F_TX_UDP_CKSUM)) {
+	     (m->ol_flags & RTE_MBUF_F_TX_L4_MASK) == RTE_MBUF_F_TX_UDP_CKSUM)) {
 		/* set checksum start and offset, defined in 2 Bytes */
 		hns3_set_field(desc->tx.type_cs_vlan_tso_len,
 			       HNS3_TXD_L4_START_M, HNS3_TXD_L4_START_S,
-- 
2.33.0


                 reply	other threads:[~2025-12-05  7:40 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20251205073955.3225775-1-yangxingui@huawei.com \
    --to=yangxingui@huawei.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=fengchengwen@huawei.com \
    --cc=kangfenglong@huawei.com \
    --cc=lihuisong@huawei.com \
    --cc=liuyonglong@huawei.com \
    --cc=stephen@networkplumber.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).