Skip to content

Commit

Permalink
net/bnxt: fix memzone free for Tx and Rx rings
Browse files Browse the repository at this point in the history
[ upstream commit 64a4d59 ]

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: 2eb53b1 ("net/bnxt: add initial Rx code")
Fixes: 6eb3cc2 ("net/bnxt: add initial Tx code")

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>
  • Loading branch information
ajitkhaparde authored and cpaelzer committed Nov 30, 2021
1 parent fdfed7e commit 20c6894
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/net/bnxt/bnxt_rxr.c
Expand Up @@ -849,6 +849,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;
}
Expand Down
3 changes: 3 additions & 0 deletions drivers/net/bnxt/bnxt_txr.c
Expand Up @@ -37,6 +37,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;
}
Expand Down

0 comments on commit 20c6894

Please sign in to comment.