[PATCH v4 1/2] net/ice: fix scalar Rx path segment
Mingjin Ye
mingjinx.ye at intel.com
Fri Nov 11 17:01:39 CET 2022
CRC is stripped by the hardware in the scattered Rx path. The last buffer
is invalid if it's packet length is zero.
This patch adds a judgment for the last buffer length to fix this issue,
it would free the mbuf associated to the last one if the last buffer is
empty.
Fixes: 6eac0b7fde95 ("net/ice: support advance Rx/Tx")
Cc: stable at dpdk.org
Signed-off-by: Mingjin Ye <mingjinx.ye at intel.com>
---
drivers/net/ice/ice_rxtx.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/ice/ice_rxtx.c b/drivers/net/ice/ice_rxtx.c
index 0a2b0376ac..e6ddd2513d 100644
--- a/drivers/net/ice/ice_rxtx.c
+++ b/drivers/net/ice/ice_rxtx.c
@@ -2111,6 +2111,10 @@ ice_recv_scattered_pkts(void *rx_queue,
} else
rxm->data_len = (uint16_t)(rx_packet_len -
RTE_ETHER_CRC_LEN);
+ } else if (rx_packet_len == 0) {
+ rte_pktmbuf_free_seg(rxm);
+ first_seg->nb_segs--;
+ last_seg->next = NULL;
}
first_seg->port = rxq->port_id;
--
2.34.1
More information about the stable
mailing list