[dpdk-dev] [PATCH 1/1] net/mlx5: fix memory leak when releasing a drop action

Matan Azrad matan at nvidia.com
Sun Jul 31 09:02:27 CEST 2022


Hi Yunjian

From: Yunjian Wang
> When the memory for hrxq->action is allocated in mlx5_devx_hrxq_new().

Memory -> resources .. are

> But it was not being freed when the drop action was released in
> mlx5_devx_drop_action_destroy(). These cause a memory leak.
> 
> Fixes: bc5bee028ebc ("net/mlx5: create drop queue using DevX")
> Cc: stable at dpdk.org
> 
> Signed-off-by: Yunjian Wang <wangyunjian at huawei.com>
> ---
>  drivers/net/mlx5/mlx5_devx.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/net/mlx5/mlx5_devx.c b/drivers/net/mlx5/mlx5_devx.c
> index 6886ae1f22..171ce5c08a 100644
> --- a/drivers/net/mlx5/mlx5_devx.c
> +++ b/drivers/net/mlx5/mlx5_devx.c
> @@ -1097,6 +1097,12 @@ mlx5_devx_drop_action_destroy(struct
> rte_eth_dev *dev)
>                 mlx5_devx_ind_table_destroy(hrxq->ind_table);
>         if (priv->drop_queue.rxq->devx_rq.rq != NULL)
>                 mlx5_rxq_devx_obj_drop_release(dev);
> +#ifdef HAVE_IBV_FLOW_DV_SUPPORT
> +       if (hrxq->action != NULL) {
> +               mlx5_glue->destroy_flow_action(hrxq->action);
> +               hrxq->action = NULL;
> +       }
> +#endif

Good catch for the leak.
I think the issue is in mlx5_devx_tir_destroy and not related only to the drop queue management.
So the fix should be for the mlx5_devx_tir_destroy. What do you think?



>  }
> 
>  /**
> --
> 2.27.0



More information about the stable mailing list