<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
Hi Dengdui,</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
Thanks for your backport, patch enqueued to 23.11 LTS release candidate queue.</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
Regards,</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
Xueming Li</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Dengdui Huang <huangdengdui@huawei.com><br>
<b>Sent:</b> Tuesday, July 15, 2025 11:16 AM<br>
<b>To:</b> stable@dpdk.org <stable@dpdk.org><br>
<b>Cc:</b> Xueming Li <xuemingl@nvidia.com><br>
<b>Subject:</b> [PATCH 23.11 2/2] net/hns3: fix Rx packet without CRC data</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">[ upstream commit 99c065da47c432e9529f761b457cde1fd8c89f20 ]<br>
<br>
When KEEP_CRC offload is enabled, the CRC data is still stripped<br>
in following cases:<br>
1. For HIP08 network engine, the packet type is TCP and the length<br>
   is less than or equal to 60B.<br>
2. For HIP09 network engine, the packet type is IP and the length<br>
   is less than or equal to 60B.<br>
<br>
So driver has to recaculate packet CRC for this rare scenarios.<br>
<br>
In addition, to avoid impacting performance, KEEP_CRC is not<br>
supported when NEON or SVE algorithm is used.<br>
<br>
Fixes: 8973d7c4ca12 ("net/hns3: support keeping CRC")<br>
Cc: stable@dpdk.org<br>
<br>
Signed-off-by: Dengdui Huang <huangdengdui@huawei.com><br>
Acked-by: Huisong Li <lihuisong@huawei.com><br>
Acked-by: Jie Hai <haijie1@huawei.com><br>
---<br>
 drivers/net/hns3/hns3_ethdev.c        |   2 +<br>
 drivers/net/hns3/hns3_ethdev.h        |  23 +++++<br>
 drivers/net/hns3/hns3_rxtx.c          | 119 +++++++++++++++++++++-----<br>
 drivers/net/hns3/hns3_rxtx.h          |   3 +<br>
 drivers/net/hns3/hns3_rxtx_vec.c      |   3 +-<br>
 drivers/net/hns3/hns3_rxtx_vec_neon.h |  19 ----<br>
 drivers/net/hns3/hns3_rxtx_vec_sve.c  |   3 +-<br>
 7 files changed, 128 insertions(+), 44 deletions(-)<br>
<br>
diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c<br>
index dd450cddaa..b2294e68cb 100644<br>
--- a/drivers/net/hns3/hns3_ethdev.c<br>
+++ b/drivers/net/hns3/hns3_ethdev.c<br>
@@ -2739,6 +2739,7 @@ hns3_get_capability(struct hns3_hw *hw)<br>
                 hw->udp_cksum_mode = HNS3_SPECIAL_PORT_SW_CKSUM_MODE;<br>
                 pf->support_multi_tc_pause = false;<br>
                 hw->rx_dma_addr_align = HNS3_RX_DMA_ADDR_ALIGN_64;<br>
+               hw->strip_crc_ptype = HNS3_STRIP_CRC_PTYPE_TCP;<br>
                 return 0;<br>
         }<br>
 <br>
@@ -2760,6 +2761,7 @@ hns3_get_capability(struct hns3_hw *hw)<br>
         hw->udp_cksum_mode = HNS3_SPECIAL_PORT_HW_CKSUM_MODE;<br>
         pf->support_multi_tc_pause = true;<br>
         hw->rx_dma_addr_align = HNS3_RX_DMA_ADDR_ALIGN_128;<br>
+       hw->strip_crc_ptype = HNS3_STRIP_CRC_PTYPE_IP;<br>
 <br>
         return 0;<br>
 }<br>
diff --git a/drivers/net/hns3/hns3_ethdev.h b/drivers/net/hns3/hns3_ethdev.h<br>
index 00d226d71c..0ce4974da6 100644<br>
--- a/drivers/net/hns3/hns3_ethdev.h<br>
+++ b/drivers/net/hns3/hns3_ethdev.h<br>
@@ -54,6 +54,10 @@<br>
 #define HNS3_SPECIAL_PORT_SW_CKSUM_MODE         0<br>
 #define HNS3_SPECIAL_PORT_HW_CKSUM_MODE         1<br>
 <br>
+#define HNS3_STRIP_CRC_PTYPE_NONE         0<br>
+#define HNS3_STRIP_CRC_PTYPE_TCP          1<br>
+#define HNS3_STRIP_CRC_PTYPE_IP           2<br>
+<br>
 #define HNS3_UC_MACADDR_NUM             128<br>
 #define HNS3_VF_UC_MACADDR_NUM          48<br>
 #define HNS3_MC_MACADDR_NUM             128<br>
@@ -655,6 +659,25 @@ struct hns3_hw {<br>
          */<br>
         uint8_t udp_cksum_mode;<br>
 <br>
+       /*<br>
+        * When KEEP_CRC offload is enabled, the CRC data of some type packets<br>
+        * whose length is less than or equal to HNS3_KEEP_CRC_OK_MIN_PKT_LEN<br>
+        * is still be stripped on some network engine. So here has to use this<br>
+        * field to distinguish the difference between different network engines.<br>
+        * value range:<br>
+        *  - HNS3_STRIP_CRC_PTYPE_TCP<br>
+        *     This value for HIP08 network engine.<br>
+        *     Indicates that only the IP-TCP packet type is stripped.<br>
+        *<br>
+        *  - HNS3_STRIP_CRC_PTYPE_IP<br>
+        *     This value for HIP09 network engine.<br>
+        *     Indicates that all IP packet types are stripped.<br>
+        *<br>
+        *  - HNS3_STRIP_CRC_PTYPE_NONE<br>
+        *     Indicates that all packet types are not stripped.<br>
+        */<br>
+       uint8_t strip_crc_ptype;<br>
+<br>
         struct hns3_port_base_vlan_config port_base_vlan_cfg;<br>
 <br>
         pthread_mutex_t flows_lock; /* rte_flow ops lock */<br>
diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c<br>
index 58aa6edff4..5b0916233c 100644<br>
--- a/drivers/net/hns3/hns3_rxtx.c<br>
+++ b/drivers/net/hns3/hns3_rxtx.c<br>
@@ -11,6 +11,7 @@<br>
 #include <rte_io.h><br>
 #include <rte_net.h><br>
 #include <rte_malloc.h><br>
+#include <rte_net_crc.h><br>
 #if defined(RTE_ARCH_ARM64)<br>
 #include <rte_cpuflags.h><br>
 #include <rte_vect.h><br>
@@ -1766,8 +1767,9 @@ hns3_rx_buf_len_calc(struct rte_mempool *mp, uint16_t *rx_buf_len)<br>
 }<br>
 <br>
 static int<br>
-hns3_rxq_conf_runtime_check(struct hns3_hw *hw, uint16_t buf_size,<br>
-                               uint16_t nb_desc)<br>
+hns3_rxq_conf_runtime_check(struct hns3_hw *hw,<br>
+                           const struct rte_eth_rxconf *conf,<br>
+                           uint16_t buf_size, uint16_t nb_desc)<br>
 {<br>
         struct rte_eth_dev *dev = &rte_eth_devices[hw->data->port_id];<br>
         eth_rx_burst_t pkt_burst = dev->rx_pkt_burst;<br>
@@ -1800,6 +1802,14 @@ hns3_rxq_conf_runtime_check(struct hns3_hw *hw, uint16_t buf_size,<br>
                         return -EINVAL;<br>
                 }<br>
         }<br>
+<br>
+       if ((conf->offloads & RTE_ETH_RX_OFFLOAD_KEEP_CRC) &&<br>
+           pkt_burst != hns3_recv_pkts_simple &&<br>
+           pkt_burst != hns3_recv_scattered_pkts) {<br>
+               hns3_err(hw, "KEEP_CRC offload is not supported with the current Rx function.");<br>
+               return -EINVAL;<br>
+       }<br>
+<br>
         return 0;<br>
 }<br>
 <br>
@@ -1836,7 +1846,7 @@ hns3_rx_queue_conf_check(struct hns3_hw *hw, const struct rte_eth_rxconf *conf,<br>
         }<br>
 <br>
         if (hw->data->dev_started) {<br>
-               ret = hns3_rxq_conf_runtime_check(hw, *buf_size, nb_desc);<br>
+               ret = hns3_rxq_conf_runtime_check(hw, conf, *buf_size, nb_desc);<br>
                 if (ret) {<br>
                         hns3_err(hw, "Rx queue runtime setup fail.");<br>
                         return ret;<br>
@@ -1957,6 +1967,8 @@ hns3_rx_queue_setup(struct rte_eth_dev *dev, uint16_t idx, uint16_t nb_desc,<br>
         else<br>
                 rxq->crc_len = 0;<br>
 <br>
+       rxq->keep_crc_fail_ptype = hw->strip_crc_ptype;<br>
+<br>
         rxq->bulk_mbuf_num = 0;<br>
 <br>
         rte_spinlock_lock(&hw->lock);<br>
@@ -2430,6 +2442,55 @@ hns3_rx_ptp_timestamp_handle(struct hns3_rx_queue *rxq, struct rte_mbuf *mbuf,<br>
         pf->rx_timestamp = timestamp;<br>
 }<br>
 <br>
+static inline bool<br>
+hns3_need_recalculate_crc(struct hns3_rx_queue *rxq, struct rte_mbuf *m)<br>
+{<br>
+       uint32_t ptype = m->packet_type;<br>
+<br>
+       if (rxq->keep_crc_fail_ptype == HNS3_STRIP_CRC_PTYPE_NONE)<br>
+               return false;<br>
+<br>
+       if (m->pkt_len > HNS3_KEEP_CRC_OK_MIN_PKT_LEN)<br>
+               return false;<br>
+<br>
+       if (!(RTE_ETH_IS_IPV4_HDR(ptype) || RTE_ETH_IS_IPV6_HDR(ptype)))<br>
+               return false;<br>
+<br>
+       if (rxq->keep_crc_fail_ptype == HNS3_STRIP_CRC_PTYPE_TCP)<br>
+               return (ptype & RTE_PTYPE_L4_MASK) == RTE_PTYPE_L4_TCP;<br>
+<br>
+       return true;<br>
+}<br>
+<br>
+/*<br>
+ * The hns3 driver requires that mbuf size must be at least 512B.<br>
+ * When CRC is stripped by hardware, the pkt_len must be less than<br>
+ * or equal to 60B. Therefore, the space of the mbuf is enough<br>
+ * to insert the CRC.<br>
+ */<br>
+static_assert(HNS3_KEEP_CRC_OK_MIN_PKT_LEN < HNS3_MIN_BD_BUF_SIZE,<br>
+             "buffer size too small to insert CRC");<br>
+<br>
+static inline void<br>
+hns3_recalculate_crc(struct rte_mbuf *m)<br>
+{<br>
+       char *append_data;<br>
+       uint32_t crc;<br>
+<br>
+       crc = rte_net_crc_calc(rte_pktmbuf_mtod(m, void *),<br>
+                              m->data_len, RTE_NET_CRC32_ETH);<br>
+<br>
+       /*<br>
+        * After CRC is stripped by hardware, pkt_len and data_len do not<br>
+        * contain the CRC length. Therefore, after CRC data is appended<br>
+        * by PMD again.<br>
+        */<br>
+       append_data = rte_pktmbuf_append(m, RTE_ETHER_CRC_LEN);<br>
+<br>
+       /* CRC data is binary data and does not care about the byte order. */<br>
+       memcpy(append_data, &crc, RTE_ETHER_CRC_LEN);<br>
+}<br>
+<br>
 uint16_t<br>
 hns3_recv_pkts_simple(void *rx_queue,<br>
                       struct rte_mbuf **rx_pkts,<br>
@@ -2500,8 +2561,7 @@ hns3_recv_pkts_simple(void *rx_queue,<br>
                 rxdp->rx.bd_base_info = 0;<br>
 <br>
                 rxm->data_off = RTE_PKTMBUF_HEADROOM;<br>
-               rxm->pkt_len = (uint16_t)(rte_le_to_cpu_16(rxd.rx.pkt_len)) -<br>
-                               rxq->crc_len;<br>
+               rxm->pkt_len = (uint16_t)(rte_le_to_cpu_16(rxd.rx.pkt_len));<br>
                 rxm->data_len = rxm->pkt_len;<br>
                 rxm->port = rxq->port_id;<br>
                 rxm->hash.rss = rte_le_to_cpu_32(rxd.rx.rss_hash);<br>
@@ -2526,6 +2586,12 @@ hns3_recv_pkts_simple(void *rx_queue,<br>
                 if (rxm->packet_type == RTE_PTYPE_L2_ETHER_TIMESYNC)<br>
                         rxm->ol_flags |= RTE_MBUF_F_RX_IEEE1588_PTP;<br>
 <br>
+               if (unlikely(rxq->crc_len > 0) &&<br>
+                   hns3_need_recalculate_crc(rxq, rxm))<br>
+                       hns3_recalculate_crc(rxm);<br>
+               rxm->pkt_len -= rxq->crc_len;<br>
+               rxm->data_len -= rxq->crc_len;<br>
+<br>
                 hns3_rxd_to_vlan_tci(rxq, rxm, l234_info, &rxd);<br>
 <br>
                 /* Increment bytes counter  */<br>
@@ -2692,10 +2758,10 @@ hns3_recv_scattered_pkts(void *rx_queue,<br>
 <br>
                 rxm->data_off = RTE_PKTMBUF_HEADROOM;<br>
                 rxm->data_len = rte_le_to_cpu_16(rxd.rx.size);<br>
+               rxm->next = NULL;<br>
 <br>
                 if (!(bd_base_info & BIT(HNS3_RXD_FE_B))) {<br>
                         last_seg = rxm;<br>
-                       rxm->next = NULL;<br>
                         continue;<br>
                 }<br>
 <br>
@@ -2710,22 +2776,6 @@ hns3_recv_scattered_pkts(void *rx_queue,<br>
                  */<br>
                 first_seg->pkt_len = rte_le_to_cpu_16(rxd.rx.pkt_len);<br>
 <br>
-               /*<br>
-                * This is the last buffer of the received packet. If the CRC<br>
-                * is not stripped by the hardware:<br>
-                *  - Subtract the CRC length from the total packet length.<br>
-                *  - If the last buffer only contains the whole CRC or a part<br>
-                *  of it, free the mbuf associated to the last buffer. If part<br>
-                *  of the CRC is also contained in the previous mbuf, subtract<br>
-                *  the length of that CRC part from the data length of the<br>
-                *  previous mbuf.<br>
-                */<br>
-               rxm->next = NULL;<br>
-               if (unlikely(rxq->crc_len > 0)) {<br>
-                       first_seg->pkt_len -= rxq->crc_len;<br>
-                       recalculate_data_len(last_seg, rxm, rxq);<br>
-               }<br>
-<br>
                 first_seg->port = rxq->port_id;<br>
                 first_seg->hash.rss = rte_le_to_cpu_32(rxd.rx.rss_hash);<br>
                 first_seg->ol_flags |= RTE_MBUF_F_RX_RSS_HASH;<br>
@@ -2754,6 +2804,31 @@ hns3_recv_scattered_pkts(void *rx_queue,<br>
 <br>
                 if (first_seg->packet_type == RTE_PTYPE_L2_ETHER_TIMESYNC)<br>
                         rxm->ol_flags |= RTE_MBUF_F_RX_IEEE1588_PTP;<br>
+               /*<br>
+                * This is the last buffer of the received packet. If the CRC<br>
+                * is not stripped by the hardware:<br>
+                *  - Subtract the CRC length from the total packet length.<br>
+                *  - If the last buffer only contains the whole CRC or a part<br>
+                *  of it, free the mbuf associated to the last buffer. If part<br>
+                *  of the CRC is also contained in the previous mbuf, subtract<br>
+                *  the length of that CRC part from the data length of the<br>
+                *  previous mbuf.<br>
+                *<br>
+                * In addition, the CRC is still stripped for a kind of packets<br>
+                * in hns3 NIC:<br>
+                * 1. All IP-TCP packet whose the length is less than and equal<br>
+                *    to 60 Byte (no CRC) on HIP08 network engine.<br>
+                * 2. All IP packet whose the length is less than and equal to<br>
+                *    60 Byte (no CRC) on HIP09 network engine.<br>
+                * In this case, the PMD calculates the CRC and appends it to<br>
+                * mbuf.<br>
+                */<br>
+               if (unlikely(rxq->crc_len > 0)) {<br>
+                       if (hns3_need_recalculate_crc(rxq, first_seg))<br>
+                               hns3_recalculate_crc(first_seg);<br>
+                       first_seg->pkt_len -= rxq->crc_len;<br>
+                       recalculate_data_len(last_seg, rxm, rxq);<br>
+               }<br>
 <br>
                 hns3_rxd_to_vlan_tci(rxq, first_seg, l234_info, &rxd);<br>
 <br>
diff --git a/drivers/net/hns3/hns3_rxtx.h b/drivers/net/hns3/hns3_rxtx.h<br>
index b6a6513307..f182ff6a9d 100644<br>
--- a/drivers/net/hns3/hns3_rxtx.h<br>
+++ b/drivers/net/hns3/hns3_rxtx.h<br>
@@ -178,6 +178,8 @@<br>
                 (HNS3_TXD_VLD_CMD | HNS3_TXD_FE_CMD | HNS3_TXD_DEFAULT_BDTYPE)<br>
 #define HNS3_TXD_SEND_SIZE_SHIFT        16<br>
 <br>
+#define HNS3_KEEP_CRC_OK_MIN_PKT_LEN   60<br>
+<br>
 enum hns3_pkt_l2t_type {<br>
         HNS3_L2_TYPE_UNICAST,<br>
         HNS3_L2_TYPE_MULTICAST,<br>
@@ -341,6 +343,7 @@ struct hns3_rx_queue {<br>
          */<br>
         uint8_t pvid_sw_discard_en:1;<br>
         uint8_t ptype_en:1;          /* indicate if the ptype field enabled */<br>
+       uint8_t keep_crc_fail_ptype:2;<br>
 <br>
         uint64_t mbuf_initializer; /* value to init mbufs used with vector rx */<br>
         /* offset_table: used for vector, to solve execute re-order problem */<br>
diff --git a/drivers/net/hns3/hns3_rxtx_vec.c b/drivers/net/hns3/hns3_rxtx_vec.c<br>
index 9708ec614e..bf37ce51b1 100644<br>
--- a/drivers/net/hns3/hns3_rxtx_vec.c<br>
+++ b/drivers/net/hns3/hns3_rxtx_vec.c<br>
@@ -185,7 +185,8 @@ hns3_rx_check_vec_support(struct rte_eth_dev *dev)<br>
         struct rte_eth_rxmode *rxmode = &dev->data->dev_conf.rxmode;<br>
         uint64_t offloads_mask = RTE_ETH_RX_OFFLOAD_TCP_LRO |<br>
                                  RTE_ETH_RX_OFFLOAD_VLAN |<br>
-                                RTE_ETH_RX_OFFLOAD_TIMESTAMP;<br>
+                                RTE_ETH_RX_OFFLOAD_TIMESTAMP |<br>
+                                RTE_ETH_RX_OFFLOAD_KEEP_CRC;<br>
 <br>
         if (dev->data->scattered_rx)<br>
                 return -ENOTSUP;<br>
diff --git a/drivers/net/hns3/hns3_rxtx_vec_neon.h b/drivers/net/hns3/hns3_rxtx_vec_neon.h<br>
index 0dc6b9f0a2..60ec501a2a 100644<br>
--- a/drivers/net/hns3/hns3_rxtx_vec_neon.h<br>
+++ b/drivers/net/hns3/hns3_rxtx_vec_neon.h<br>
@@ -148,14 +148,6 @@ hns3_recv_burst_vec(struct hns3_rx_queue *__restrict rxq,<br>
                 8, 9, 10, 11,            /* rx.rss_hash to rte_mbuf.hash.rss */<br>
         };<br>
 <br>
-       uint16x8_t crc_adjust = {<br>
-               0, 0,         /* ignore pkt_type field */<br>
-               rxq->crc_len, /* sub crc on pkt_len */<br>
-               0,            /* ignore high-16bits of pkt_len */<br>
-               rxq->crc_len, /* sub crc on data_len */<br>
-               0, 0, 0,      /* ignore non-length fields */<br>
-       };<br>
-<br>
         /* compile-time verifies the shuffle mask */<br>
         RTE_BUILD_BUG_ON(offsetof(struct rte_mbuf, pkt_len) !=<br>
                          offsetof(struct rte_mbuf, rx_descriptor_fields1) + 4);<br>
@@ -171,7 +163,6 @@ hns3_recv_burst_vec(struct hns3_rx_queue *__restrict rxq,<br>
                 uint8x16_t pkt_mb1, pkt_mb2, pkt_mb3, pkt_mb4;<br>
                 uint64x2_t mbp1, mbp2;<br>
                 uint16x4_t bd_vld = {0};<br>
-               uint16x8_t tmp;<br>
                 uint64_t stat;<br>
 <br>
                 /* calc how many bd valid */<br>
@@ -225,16 +216,6 @@ hns3_recv_burst_vec(struct hns3_rx_queue *__restrict rxq,<br>
                 pkt_mb3 = vqtbl2q_u8(pkt_mbuf3, shuf_desc_fields_msk);<br>
                 pkt_mb4 = vqtbl2q_u8(pkt_mbuf4, shuf_desc_fields_msk);<br>
 <br>
-               /* 4 packets remove crc */<br>
-               tmp = vsubq_u16(vreinterpretq_u16_u8(pkt_mb1), crc_adjust);<br>
-               pkt_mb1 = vreinterpretq_u8_u16(tmp);<br>
-               tmp = vsubq_u16(vreinterpretq_u16_u8(pkt_mb2), crc_adjust);<br>
-               pkt_mb2 = vreinterpretq_u8_u16(tmp);<br>
-               tmp = vsubq_u16(vreinterpretq_u16_u8(pkt_mb3), crc_adjust);<br>
-               pkt_mb3 = vreinterpretq_u8_u16(tmp);<br>
-               tmp = vsubq_u16(vreinterpretq_u16_u8(pkt_mb4), crc_adjust);<br>
-               pkt_mb4 = vreinterpretq_u8_u16(tmp);<br>
-<br>
                 /* save packet info to rx_pkts mbuf */<br>
                 vst1q_u8((void *)&sw_ring[pos + 0].mbuf->rx_descriptor_fields1,<br>
                          pkt_mb1);<br>
diff --git a/drivers/net/hns3/hns3_rxtx_vec_sve.c b/drivers/net/hns3/hns3_rxtx_vec_sve.c<br>
index 8aa4448558..67c87f570e 100644<br>
--- a/drivers/net/hns3/hns3_rxtx_vec_sve.c<br>
+++ b/drivers/net/hns3/hns3_rxtx_vec_sve.c<br>
@@ -36,8 +36,7 @@ hns3_desc_parse_field_sve(struct hns3_rx_queue *rxq,<br>
                 /* init rte_mbuf.rearm_data last 64-bit */<br>
                 rx_pkts[i]->ol_flags = RTE_MBUF_F_RX_RSS_HASH;<br>
                 rx_pkts[i]->hash.rss = rxdp[i].rx.rss_hash;<br>
-               rx_pkts[i]->pkt_len = rte_le_to_cpu_16(rxdp[i].rx.pkt_len) -<br>
-                                       rxq->crc_len;<br>
+               rx_pkts[i]->pkt_len = rte_le_to_cpu_16(rxdp[i].rx.pkt_len);<br>
                 rx_pkts[i]->data_len = rx_pkts[i]->pkt_len;<br>
 <br>
                 l234_info = rxdp[i].rx.l234_info;<br>
-- <br>
2.33.0<br>
<br>
</div>
</span></font></div>
</body>
</html>