From: Konstantin Ananyev Date: Fri, 24 Jul 2015 13:58:11 +0000 (+0100) Subject: ixgbe: revert mbuf refcnt check when clearing a ring X-Git-Tag: spdx-start~8654 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=ae77d1fbffa55109bd7c5c1935848a8dabeaf726;p=dpdk.git ixgbe: revert mbuf refcnt check when clearing a ring The bug fix was incorrect as it did not take account of the fact that the mbufs that were previously freed may have since be re-allocated. Reverts: b35d0d80f0a8 ("ixgbe: check mbuf refcnt when clearing a ring") Signed-off-by: Bruce Richardson Signed-off-by: Konstantin Ananyev Acked-by: Helin Zhang --- diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c index af7e22279f..75c5555c7d 100644 --- a/drivers/net/ixgbe/ixgbe_rxtx.c +++ b/drivers/net/ixgbe/ixgbe_rxtx.c @@ -2272,8 +2272,7 @@ ixgbe_rx_queue_release_mbufs(struct ixgbe_rx_queue *rxq) if (rxq->sw_ring != NULL) { for (i = 0; i < rxq->nb_rx_desc; i++) { - if (rxq->sw_ring[i].mbuf != NULL && - rte_mbuf_refcnt_read(rxq->sw_ring[i].mbuf)) { + if (rxq->sw_ring[i].mbuf != NULL) { rte_pktmbuf_free_seg(rxq->sw_ring[i].mbuf); rxq->sw_ring[i].mbuf = NULL; } diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec.c b/drivers/net/ixgbe/ixgbe_rxtx_vec.c index d3ac74a37b..47ff99031c 100644 --- a/drivers/net/ixgbe/ixgbe_rxtx_vec.c +++ b/drivers/net/ixgbe/ixgbe_rxtx_vec.c @@ -736,13 +736,7 @@ ixgbe_tx_queue_release_mbufs(struct ixgbe_tx_queue *txq) nb_free < max_desc && i != txq->tx_tail; i = (i + 1) & max_desc) { txe = (struct ixgbe_tx_entry_v *)&txq->sw_ring[i]; - /* - * Check for already freed packets. - * Note: ixgbe_tx_free_bufs does not NULL after free, - * so we actually have to check the reference count. - */ - if (txe->mbuf != NULL && - rte_mbuf_refcnt_read(txe->mbuf) != 0) + if (txe->mbuf != NULL) rte_pktmbuf_free_seg(txe->mbuf); } /* reset tx_entry */