net/ixgbe: fix mbuf leak during Rx queue release
For the vector PMD, release all mbufs from the Rx queue if no packets
are received after device start.
Fixes: 11b220c649
("ixgbe: fix release queue mbufs")
Signed-off-by: Yury Kylulin <yury.kylulin@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
This commit is contained in:
parent
dad7734e66
commit
f853230920
@ -204,8 +204,20 @@ _ixgbe_rx_queue_release_mbufs_vec(struct ixgbe_rx_queue *rxq)
|
||||
return;
|
||||
|
||||
/* free all mbufs that are valid in the ring */
|
||||
for (i = rxq->rx_tail; i != rxq->rxrearm_start; i = (i + 1) & mask)
|
||||
if (rxq->rxrearm_nb == 0) {
|
||||
for (i = 0; i < rxq->nb_rx_desc; i++) {
|
||||
if (rxq->sw_ring[i].mbuf != NULL)
|
||||
rte_pktmbuf_free_seg(rxq->sw_ring[i].mbuf);
|
||||
}
|
||||
} else {
|
||||
for (i = rxq->rx_tail;
|
||||
i != rxq->rxrearm_start;
|
||||
i = (i + 1) & mask) {
|
||||
if (rxq->sw_ring[i].mbuf != NULL)
|
||||
rte_pktmbuf_free_seg(rxq->sw_ring[i].mbuf);
|
||||
}
|
||||
}
|
||||
|
||||
rxq->rxrearm_nb = rxq->nb_rx_desc;
|
||||
|
||||
/* set all entries to NULL */
|
||||
|
Loading…
Reference in New Issue
Block a user