net/bnxt: fix mem zone free for Tx and Rx rings

Message ID 20210925005702.50971-1-ajit.khaparde@broadcom.com (mailing list archive)
State Accepted, archived
Delegated to: Ajit Khaparde
Headers
Series net/bnxt: fix mem zone free for Tx and Rx rings |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/github-robot: build success github build: passed
ci/iol-testing warning apply patch failure

Commit Message

Ajit Khaparde Sept. 25, 2021, 12:57 a.m. UTC
  The device cleanup logic was freeing most of the ring related memory,
but was not freeing up the mem zone 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 | 3 +++
 drivers/net/bnxt/bnxt_txr.c | 3 +++
 2 files changed, 6 insertions(+)
  

Comments

Ajit Khaparde Sept. 26, 2021, 9:18 p.m. UTC | #1
On Fri, Sep 24, 2021 at 5:57 PM Ajit Khaparde
<ajit.khaparde@broadcom.com> wrote:
>
> The device cleanup logic was freeing most of the ring related memory,
> but was not freeing up the mem zone 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>
Patch applied to dpdk-next-net-brcm.

> ---
>  drivers/net/bnxt/bnxt_rxr.c | 3 +++
>  drivers/net/bnxt/bnxt_txr.c | 3 +++
>  2 files changed, 6 insertions(+)
>
> diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c
> index a40fa50138..4c1ee4294e 100644
> --- a/drivers/net/bnxt/bnxt_rxr.c
> +++ b/drivers/net/bnxt/bnxt_rxr.c
> @@ -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;
>         }
> diff --git a/drivers/net/bnxt/bnxt_txr.c b/drivers/net/bnxt/bnxt_txr.c
> index 47824334ae..9e45ddd7a8 100644
> --- a/drivers/net/bnxt/bnxt_txr.c
> +++ b/drivers/net/bnxt/bnxt_txr.c
> @@ -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;
>         }
> --
> 2.30.1 (Apple Git-130)
>
  

Patch

diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c
index a40fa50138..4c1ee4294e 100644
--- a/drivers/net/bnxt/bnxt_rxr.c
+++ b/drivers/net/bnxt/bnxt_rxr.c
@@ -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;
 	}
diff --git a/drivers/net/bnxt/bnxt_txr.c b/drivers/net/bnxt/bnxt_txr.c
index 47824334ae..9e45ddd7a8 100644
--- a/drivers/net/bnxt/bnxt_txr.c
+++ b/drivers/net/bnxt/bnxt_txr.c
@@ -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;
 	}