patch 'net/hns3: fix L4 checksum for tunnel packets' has been queued to stable release 24.11.7

luca.boccassi at gmail.com luca.boccassi at gmail.com
Thu Jun 11 15:19:41 CEST 2026


Hi,

FYI, your patch has been queued to stable release 24.11.7

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 06/13/26. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/1b57e80980fc833be05638da505e6badeaf93363

Thanks.

Luca Boccassi

---
>From 1b57e80980fc833be05638da505e6badeaf93363 Mon Sep 17 00:00:00 2001
From: Xingui Yang <yangxingui at huawei.com>
Date: Sat, 9 May 2026 14:47:53 +0800
Subject: [PATCH] net/hns3: fix L4 checksum for tunnel packets

[ upstream commit 05ceff7f4fbf949e7ab823f11054f6ec75d40aed ]

In HIP09 simple BD mode, the driver incorrectly calculates L4_START
position for tunnel packets. The current implementation only uses
l2_len + l3_len without considering outer header lengths (outer_l2_len
and outer_l3_len), causing hardware to calculate checksum from wrong
offset.

For a typical NvGRE tunnel packet with structure:
  Outer Eth(14) + Outer IPv6(40) + NvGRE(8) + Inner Eth(14) +
  Inner IPv6(40) + TCP(20)

Expected L4_START: 116 bytes (from packet start to inner TCP header)
Actual calculation: 62 bytes (missing outer headers)

This results in incorrect TCP/UDP checksum for all tunnel packets when
using simple BD mode, including NvGRE, VxLAN, GRE, GENEVE tunnels.

Fix by adding outer_l2_len and outer_l3_len to L4_START calculation
when RTE_MBUF_F_TX_TUNNEL_MASK flag is set.

Fixes: 6393fc0b823c ("net/hns3: simplify hardware checksum offloading")

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

diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c
index f0ae9c9914..2f2e2fe41e 100644
--- a/drivers/net/hns3/hns3_rxtx.c
+++ b/drivers/net/hns3/hns3_rxtx.c
@@ -3989,9 +3989,13 @@ hns3_handle_simple_bd(struct hns3_tx_queue *txq, struct hns3_desc *desc,
 	    ((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)) {
 		/* set checksum start and offset, defined in 2 Bytes */
+		uint32_t l4_start = m->l2_len + m->l3_len;
+		if (m->ol_flags & RTE_MBUF_F_TX_TUNNEL_MASK)
+			l4_start += m->outer_l2_len + m->outer_l3_len;
+
 		hns3_set_field(desc->tx.type_cs_vlan_tso_len,
 			       HNS3_TXD_L4_START_M, HNS3_TXD_L4_START_S,
-			       (m->l2_len + m->l3_len) >> HNS3_SIMPLE_BD_UNIT);
+			       l4_start >> HNS3_SIMPLE_BD_UNIT);
 		hns3_set_field(desc->tx.ol_type_vlan_len_msec,
 			   HNS3_TXD_L4_CKS_OFFSET_M, HNS3_TXD_L4_CKS_OFFSET_S,
 			   (m->ol_flags & RTE_MBUF_F_TX_L4_MASK) ==
-- 
2.47.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2026-06-11 14:20:02.620202777 +0100
+++ 0032-net-hns3-fix-L4-checksum-for-tunnel-packets.patch	2026-06-11 14:20:01.202745690 +0100
@@ -1 +1 @@
-From 05ceff7f4fbf949e7ab823f11054f6ec75d40aed Mon Sep 17 00:00:00 2001
+From 1b57e80980fc833be05638da505e6badeaf93363 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 05ceff7f4fbf949e7ab823f11054f6ec75d40aed ]
+
@@ -26 +27,0 @@
-Cc: stable at dpdk.org
@@ -35 +36 @@
-index 573604b0cd..faed1d480b 100644
+index f0ae9c9914..2f2e2fe41e 100644
@@ -38 +39 @@
-@@ -4003,9 +4003,13 @@ hns3_handle_simple_bd(struct hns3_tx_queue *txq, struct hns3_desc *desc,
+@@ -3989,9 +3989,13 @@ hns3_handle_simple_bd(struct hns3_tx_queue *txq, struct hns3_desc *desc,


More information about the stable mailing list