patch 'net/hns3: fix CRC data segment' has been queued to stable release 23.11.5

Xueming Li xuemingl at nvidia.com
Thu Jun 26 14:01:12 CEST 2025


Hi,

FYI, your patch has been queued to stable release 23.11.5

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/28/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://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=25938ace6365eb3b15f2178657c77c427ce6993e

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 25938ace6365eb3b15f2178657c77c427ce6993e Mon Sep 17 00:00:00 2001
From: Dengdui Huang <huangdengdui at huawei.com>
Date: Fri, 16 May 2025 15:15:18 +0800
Subject: [PATCH] net/hns3: fix CRC data segment
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit 7a99b6ca9d079e9364ba61d3fe802a4761739c8f ]

When the packet is received into a multisegment mbuf and
the last segment contains only CRC data, the driver should
not release this segment. Otherwise, the application cannot
look the CRC data. This patch fixes it.

Fixes: 8973d7c4ca12 ("net/hns3: support keeping CRC")

Signed-off-by: Dengdui Huang <huangdengdui at huawei.com>
---
 drivers/net/hns3/hns3_rxtx.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c
index ab4789c2f1..58aa6edff4 100644
--- a/drivers/net/hns3/hns3_rxtx.c
+++ b/drivers/net/hns3/hns3_rxtx.c
@@ -2383,18 +2383,16 @@ hns3_rxd_to_vlan_tci(struct hns3_rx_queue *rxq, struct rte_mbuf *mb,
 }
 
 static inline void
-recalculate_data_len(struct rte_mbuf *first_seg, struct rte_mbuf *last_seg,
-		    struct rte_mbuf *rxm, struct hns3_rx_queue *rxq,
-		    uint16_t data_len)
+recalculate_data_len(struct rte_mbuf *last_seg, struct rte_mbuf *rxm,
+		     struct hns3_rx_queue *rxq)
 {
+	uint16_t data_len = rxm->data_len;
 	uint8_t crc_len = rxq->crc_len;
 
 	if (data_len <= crc_len) {
-		rte_pktmbuf_free_seg(rxm);
-		first_seg->nb_segs--;
+		rxm->data_len = 0;
 		last_seg->data_len = (uint16_t)(last_seg->data_len -
 			(crc_len - data_len));
-		last_seg->next = NULL;
 	} else
 		rxm->data_len = (uint16_t)(data_len - crc_len);
 }
@@ -2725,8 +2723,7 @@ hns3_recv_scattered_pkts(void *rx_queue,
 		rxm->next = NULL;
 		if (unlikely(rxq->crc_len > 0)) {
 			first_seg->pkt_len -= rxq->crc_len;
-			recalculate_data_len(first_seg, last_seg, rxm, rxq,
-				rxm->data_len);
+			recalculate_data_len(last_seg, rxm, rxq);
 		}
 
 		first_seg->port = rxq->port_id;
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2025-06-26 19:59:19.828784142 +0800
+++ 0052-net-hns3-fix-CRC-data-segment.patch	2025-06-26 19:59:17.418418043 +0800
@@ -1 +1 @@
-From 7a99b6ca9d079e9364ba61d3fe802a4761739c8f Mon Sep 17 00:00:00 2001
+From 25938ace6365eb3b15f2178657c77c427ce6993e Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 7a99b6ca9d079e9364ba61d3fe802a4761739c8f ]
@@ -12 +14,0 @@
-Cc: stable at dpdk.org
@@ -20 +22 @@
-index bb7ffee12c..49b6f16ccd 100644
+index ab4789c2f1..58aa6edff4 100644
@@ -23 +25 @@
-@@ -2386,18 +2386,16 @@ hns3_rxd_to_vlan_tci(struct hns3_rx_queue *rxq, struct rte_mbuf *mb,
+@@ -2383,18 +2383,16 @@ hns3_rxd_to_vlan_tci(struct hns3_rx_queue *rxq, struct rte_mbuf *mb,
@@ -46 +48 @@
-@@ -2728,8 +2726,7 @@ hns3_recv_scattered_pkts(void *rx_queue,
+@@ -2725,8 +2723,7 @@ hns3_recv_scattered_pkts(void *rx_queue,


More information about the stable mailing list