net/bnxt: fix mbuf free when clearing Tx queue
authorLance Richardson <lance.richardson@broadcom.com>
Wed, 23 Oct 2019 14:27:35 +0000 (10:27 -0400)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 25 Oct 2019 17:00:22 +0000 (19:00 +0200)
When freeing pending transmit mbufs, use rte_pktmbuf_free_seg()
instead of rte_pktmbuf_free(), otherwise linked mbufs may be freed
more than once.

Fixes: 6eb3cc2294fd ("net/bnxt: add initial Tx code")
Cc: stable@dpdk.org
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
drivers/net/bnxt/bnxt_txq.c

index ebb9199..6b866d4 100644 (file)
@@ -34,7 +34,7 @@ static void bnxt_tx_queue_release_mbufs(struct bnxt_tx_queue *txq)
        if (sw_ring) {
                for (i = 0; i < txq->tx_ring->tx_ring_struct->ring_size; i++) {
                        if (sw_ring[i].mbuf) {
-                               rte_pktmbuf_free(sw_ring[i].mbuf);
+                               rte_pktmbuf_free_seg(sw_ring[i].mbuf);
                                sw_ring[i].mbuf = NULL;
                        }
                }