patch 'net/hns3: fix VLAN tag loss for short tunnel frame' has been queued to stable release 24.11.4
Kevin Traynor
ktraynor at redhat.com
Fri Oct 31 15:33:41 CET 2025
Hi,
FYI, your patch has been queued to stable release 24.11.4
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/05/25. 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/kevintraynor/dpdk-stable
This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/0d4ac08fdca35ed6ccba96e8e156c1ce0245a6e1
Thanks.
Kevin
---
>From 0d4ac08fdca35ed6ccba96e8e156c1ce0245a6e1 Mon Sep 17 00:00:00 2001
From: Xingui Yang <yangxingui at huawei.com>
Date: Mon, 29 Sep 2025 19:35:53 +0800
Subject: [PATCH] net/hns3: fix VLAN tag loss for short tunnel frame
[ upstream commit 2262fc29485bd863db55e820a194bf1e4be8a87c ]
When the hardware handles short tunnel frames below 65 bytes, the VLAN tag
will be lost if VLAN insert or QinQ insert is enabled. Therefore, the
packet size of the tunnel frame is padded to 65 bytes to fix this issue.
Fixes: de620754a109 ("net/hns3: fix sending packets less than 60 bytes")
Signed-off-by: Xingui Yang <yangxingui at huawei.com>
---
drivers/net/hns3/hns3_ethdev.h | 1 +
drivers/net/hns3/hns3_rxtx.c | 48 +++++++++++++++++++++++-----------
2 files changed, 34 insertions(+), 15 deletions(-)
diff --git a/drivers/net/hns3/hns3_ethdev.h b/drivers/net/hns3/hns3_ethdev.h
index 9b8566139b..70ac2f66f8 100644
--- a/drivers/net/hns3/hns3_ethdev.h
+++ b/drivers/net/hns3/hns3_ethdev.h
@@ -79,4 +79,5 @@
#define HNS3_DEFAULT_FRAME_LEN (HNS3_DEFAULT_MTU + HNS3_ETH_OVERHEAD)
#define HNS3_HIP08_MIN_TX_PKT_LEN 33
+#define HNS3_MIN_TUN_PKT_LEN 65
#define HNS3_BITS_PER_BYTE 8
diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c
index 4d2f77e834..9421fa58e2 100644
--- a/drivers/net/hns3/hns3_rxtx.c
+++ b/drivers/net/hns3/hns3_rxtx.c
@@ -4206,4 +4206,35 @@ hns3_tx_fill_hw_ring(struct hns3_tx_queue *txq,
}
+static bool
+hns3_tx_pktmbuf_append(struct hns3_tx_queue *txq,
+ struct rte_mbuf *tx_pkt)
+{
+ uint16_t add_len = 0;
+ uint32_t ptype;
+ char *appended;
+
+ if (unlikely(tx_pkt->ol_flags & (RTE_MBUF_F_TX_VLAN | RTE_MBUF_F_TX_QINQ) &&
+ rte_pktmbuf_pkt_len(tx_pkt) < HNS3_MIN_TUN_PKT_LEN)) {
+ ptype = rte_net_get_ptype(tx_pkt, NULL, RTE_PTYPE_L2_MASK |
+ RTE_PTYPE_L3_MASK | RTE_PTYPE_L4_MASK |
+ RTE_PTYPE_TUNNEL_MASK);
+ if (ptype & RTE_PTYPE_TUNNEL_MASK)
+ add_len = HNS3_MIN_TUN_PKT_LEN - rte_pktmbuf_pkt_len(tx_pkt);
+ } else if (unlikely(rte_pktmbuf_pkt_len(tx_pkt) < txq->min_tx_pkt_len)) {
+ add_len = txq->min_tx_pkt_len - rte_pktmbuf_pkt_len(tx_pkt);
+ }
+
+ if (unlikely(add_len > 0)) {
+ appended = rte_pktmbuf_append(tx_pkt, add_len);
+ if (appended == NULL) {
+ txq->dfx_stats.pkt_padding_fail_cnt++;
+ return false;
+ }
+ memset(appended, 0, add_len);
+ }
+
+ return true;
+}
+
uint16_t
hns3_xmit_pkts_simple(void *tx_queue,
@@ -4283,19 +4314,6 @@ hns3_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
* error.
*/
- if (unlikely(rte_pktmbuf_pkt_len(tx_pkt) <
- txq->min_tx_pkt_len)) {
- uint16_t add_len;
- char *appended;
-
- add_len = txq->min_tx_pkt_len -
- rte_pktmbuf_pkt_len(tx_pkt);
- appended = rte_pktmbuf_append(tx_pkt, add_len);
- if (appended == NULL) {
- txq->dfx_stats.pkt_padding_fail_cnt++;
- break;
- }
-
- memset(appended, 0, add_len);
- }
+ if (!hns3_tx_pktmbuf_append(txq, tx_pkt))
+ break;
m_seg = tx_pkt;
--
2.51.0
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2025-10-31 13:53:55.250221168 +0000
+++ 0099-net-hns3-fix-VLAN-tag-loss-for-short-tunnel-frame.patch 2025-10-31 13:53:52.278524124 +0000
@@ -1 +1 @@
-From 2262fc29485bd863db55e820a194bf1e4be8a87c Mon Sep 17 00:00:00 2001
+From 0d4ac08fdca35ed6ccba96e8e156c1ce0245a6e1 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 2262fc29485bd863db55e820a194bf1e4be8a87c ]
+
@@ -11 +12,0 @@
-Cc: stable at dpdk.org
@@ -20 +21 @@
-index f6bb1b5d43..209b042816 100644
+index 9b8566139b..70ac2f66f8 100644
@@ -23 +24 @@
-@@ -76,4 +76,5 @@
+@@ -79,4 +79,5 @@
@@ -30 +31 @@
-index aa7ee6f3e8..df703134be 100644
+index 4d2f77e834..9421fa58e2 100644
@@ -33 +34 @@
-@@ -4220,4 +4220,35 @@ hns3_tx_fill_hw_ring(struct hns3_tx_queue *txq,
+@@ -4206,4 +4206,35 @@ hns3_tx_fill_hw_ring(struct hns3_tx_queue *txq,
@@ -69 +70 @@
-@@ -4297,19 +4328,6 @@ hns3_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
+@@ -4283,19 +4314,6 @@ hns3_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
More information about the stable
mailing list