net/octeontx2: free CQ ring memzone on queue release

Message ID 20200628233136.2953-1-pbhagavatula@marvell.com (mailing list archive)
State Accepted, archived
Delegated to: Jerin Jacob
Headers
Series net/octeontx2: free CQ ring memzone on queue release |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Performance-Testing fail build patch failure
ci/Intel-compilation fail Compilation issues

Commit Message

Pavan Nikhilesh Bhagavatula June 28, 2020, 11:31 p.m. UTC
  From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Free CQ ring memzone on Rx queue release. This prevents CQ using
incorrect memory size when ring size is reconfigured.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 This patch depends on the following patch
 http://patches.dpdk.org/patch/72035/

 drivers/net/octeontx2/otx2_ethdev.c | 1 +
 1 file changed, 1 insertion(+)

--
2.17.1
  

Comments

Jerin Jacob July 21, 2020, 12:09 p.m. UTC | #1
On Mon, Jun 29, 2020 at 5:03 AM <pbhagavatula@marvell.com> wrote:
>
> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>
> Free CQ ring memzone on Rx queue release. This prevents CQ using
> incorrect memory size when ring size is reconfigured.
>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
> ---
>  This patch depends on the following patch
>  http://patches.dpdk.org/patch/72035/


Acked-by: Jerin Jacob <jerinj@marvell.com>
Applied to dpdk-next-net-mrvl/master. Thanks


>
>  drivers/net/octeontx2/otx2_ethdev.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/octeontx2/otx2_ethdev.c b/drivers/net/octeontx2/otx2_ethdev.c
> index 3f3f0a693..a1084bf96 100644
> --- a/drivers/net/octeontx2/otx2_ethdev.c
> +++ b/drivers/net/octeontx2/otx2_ethdev.c
> @@ -528,6 +528,7 @@ otx2_nix_rx_queue_setup(struct rte_eth_dev *eth_dev, uint16_t rq,
>         if (eth_dev->data->rx_queues[rq] != NULL) {
>                 otx2_nix_dbg("Freeing memory prior to re-allocation %d", rq);
>                 otx2_nix_rx_queue_release(eth_dev->data->rx_queues[rq]);
> +               rte_eth_dma_zone_free(eth_dev, "cq", rq);
>                 eth_dev->data->rx_queues[rq] = NULL;
>         }
>
> --
> 2.17.1
>
  

Patch

diff --git a/drivers/net/octeontx2/otx2_ethdev.c b/drivers/net/octeontx2/otx2_ethdev.c
index 3f3f0a693..a1084bf96 100644
--- a/drivers/net/octeontx2/otx2_ethdev.c
+++ b/drivers/net/octeontx2/otx2_ethdev.c
@@ -528,6 +528,7 @@  otx2_nix_rx_queue_setup(struct rte_eth_dev *eth_dev, uint16_t rq,
 	if (eth_dev->data->rx_queues[rq] != NULL) {
 		otx2_nix_dbg("Freeing memory prior to re-allocation %d", rq);
 		otx2_nix_rx_queue_release(eth_dev->data->rx_queues[rq]);
+		rte_eth_dma_zone_free(eth_dev, "cq", rq);
 		eth_dev->data->rx_queues[rq] = NULL;
 	}