[2/2] net/mlx5: fix resource leak when releasing a drop action
Checks
Commit Message
Currently, the resources for hrxq->action are allocated in
mlx5_devx_hrxq_new(). But it was not being freed when the
drop action was released in mlx5_devx_drop_action_destroy().
So, fix is to free the resources in mlx5_devx_tir_destroy().
Fixes: bc5bee028ebc ("net/mlx5: create drop queue using DevX")
Cc: stable@dpdk.org
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
---
drivers/net/mlx5/mlx5_devx.c | 6 ++++++
drivers/net/mlx5/mlx5_rxq.c | 6 ------
2 files changed, 6 insertions(+), 6 deletions(-)
@@ -907,6 +907,12 @@ mlx5_devx_hrxq_new(struct rte_eth_dev *dev, struct mlx5_hrxq *hrxq,
static void
mlx5_devx_tir_destroy(struct mlx5_hrxq *hrxq)
{
+#if defined(HAVE_IBV_FLOW_DV_SUPPORT) || !defined(HAVE_INFINIBAND_VERBS_H)
+ if (hrxq->hws_flags)
+ mlx5dr_action_destroy(hrxq->action);
+ else
+ mlx5_glue->destroy_flow_action(hrxq->action);
+#endif
claim_zero(mlx5_devx_cmd_destroy(hrxq->tir));
}
@@ -2861,12 +2861,6 @@ __mlx5_hrxq_remove(struct rte_eth_dev *dev, struct mlx5_hrxq *hrxq)
{
struct mlx5_priv *priv = dev->data->dev_private;
-#ifdef HAVE_IBV_FLOW_DV_SUPPORT
- if (hrxq->hws_flags)
- mlx5dr_action_destroy(hrxq->action);
- else
- mlx5_glue->destroy_flow_action(hrxq->action);
-#endif
priv->obj_ops.hrxq_destroy(hrxq);
if (!hrxq->standalone) {
mlx5_ind_table_obj_release(dev, hrxq->ind_table,