net/bnxt: fix memzone free for Tx and Rx rings
authorAjit Khaparde <ajit.khaparde@broadcom.com>
Mon, 20 Sep 2021 23:11:51 +0000 (16:11 -0700)
committerAjit Khaparde <ajit.khaparde@broadcom.com>
Sun, 26 Sep 2021 21:15:37 +0000 (23:15 +0200)
The device cleanup logic was freeing most of the ring related memory,
but was not freeing up the memzone associated with the rings.
This patch fixes the issue.

Fixes: 2eb53b134aae ("net/bnxt: add initial Rx code")
Fixes: 6eb3cc2294fd ("net/bnxt: add initial Tx code")
Cc: stable@dpdk.org
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
drivers/net/bnxt/bnxt_rxr.c
drivers/net/bnxt/bnxt_txr.c

index a40fa50..4c1ee42 100644 (file)
@@ -1207,6 +1207,9 @@ void bnxt_free_rx_rings(struct bnxt *bp)
                rte_free(rxq->cp_ring->cp_ring_struct);
                rte_free(rxq->cp_ring);
 
+               rte_memzone_free(rxq->mz);
+               rxq->mz = NULL;
+
                rte_free(rxq);
                bp->rx_queues[i] = NULL;
        }
index 4782433..9e45ddd 100644 (file)
@@ -38,6 +38,9 @@ void bnxt_free_tx_rings(struct bnxt *bp)
                rte_free(txq->cp_ring->cp_ring_struct);
                rte_free(txq->cp_ring);
 
+               rte_memzone_free(txq->mz);
+               txq->mz = NULL;
+
                rte_free(txq);
                bp->tx_queues[i] = NULL;
        }