Skip to content

Commit

Permalink
net/mlx5: fix drop action memory leak
Browse files Browse the repository at this point in the history
[ upstream commit 177d90ddd6e0e223966c2fb8a55e036cfb47db7a ]

In DV mode, when quitting an application, the default drop action
and its resources should be released. The Devx action for the TIR
was not destroyed and it would cause 80B memory leak.

With this commit, in DV mode, the action should be destroyed in the
mlx5_devx_drop_action_destroy() explicitly.

Bugzilla ID: 1192
Bugzilla ID: 1255

Fixes: bc5bee0 ("net/mlx5: create drop queue using DevX")

Reported-by: David Marchand <david.marchand@redhat.com>
Reported-by: Mário Kuka <kuka@cesnet.cz>
Signed-off-by: Bing Zhao <bingz@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
  • Loading branch information
zorrohahaha authored and kevintraynor committed Jul 21, 2023
1 parent c7a2de8 commit bdcd430
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/net/mlx5/mlx5_devx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1018,6 +1018,10 @@ mlx5_devx_drop_action_destroy(struct rte_eth_dev *dev)
struct mlx5_priv *priv = dev->data->dev_private;
struct mlx5_hrxq *hrxq = priv->drop_queue.hrxq;

#if defined(HAVE_IBV_FLOW_DV_SUPPORT) || !defined(HAVE_INFINIBAND_VERBS_H)
if (hrxq->action != NULL)
mlx5_flow_os_destroy_flow_action(hrxq->action);
#endif
if (hrxq->tir != NULL)
mlx5_devx_tir_destroy(hrxq);
if (hrxq->ind_table->ind_table != NULL)
Expand Down

0 comments on commit bdcd430

Please sign in to comment.