patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH] net/mlx5: fix the drop action memory leak
@ 2023-07-13 11:06 Bing Zhao
  2023-07-13 11:19 ` [PATCH v2] " Bing Zhao
  0 siblings, 1 reply; 3+ messages in thread
From: Bing Zhao @ 2023-07-13 11:06 UTC (permalink / raw)
  To: matan, viacheslavo, orika, suanmingm, rasland; +Cc: dev, stable, David Marchand

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: bc5bee028ebc ("net/mlx5: create drop queue using DevX")
Cc: stable@dpdk.org

Reported-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Bing Zhao <bingz@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
 drivers/net/mlx5/mlx5_devx.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/mlx5/mlx5_devx.c b/drivers/net/mlx5/mlx5_devx.c
index d286cfe864..9fa400fc48 100644
--- a/drivers/net/mlx5/mlx5_devx.c
+++ b/drivers/net/mlx5/mlx5_devx.c
@@ -1134,6 +1134,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)
-- 
2.34.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH v2] net/mlx5: fix the drop action memory leak
  2023-07-13 11:06 [PATCH] net/mlx5: fix the drop action memory leak Bing Zhao
@ 2023-07-13 11:19 ` Bing Zhao
  2023-07-18 11:58   ` Raslan Darawsheh
  0 siblings, 1 reply; 3+ messages in thread
From: Bing Zhao @ 2023-07-13 11:19 UTC (permalink / raw)
  To: matan, viacheslavo, orika, suanmingm, rasland
  Cc: dev, stable, David Marchand, Mário Kuka

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: bc5bee028ebc ("net/mlx5: create drop queue using DevX")
Cc: stable@dpdk.org

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>
---
v2: added the reporter
---
 drivers/net/mlx5/mlx5_devx.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/mlx5/mlx5_devx.c b/drivers/net/mlx5/mlx5_devx.c
index d286cfe864..9fa400fc48 100644
--- a/drivers/net/mlx5/mlx5_devx.c
+++ b/drivers/net/mlx5/mlx5_devx.c
@@ -1134,6 +1134,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)
-- 
2.34.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH v2] net/mlx5: fix the drop action memory leak
  2023-07-13 11:19 ` [PATCH v2] " Bing Zhao
@ 2023-07-18 11:58   ` Raslan Darawsheh
  0 siblings, 0 replies; 3+ messages in thread
From: Raslan Darawsheh @ 2023-07-18 11:58 UTC (permalink / raw)
  To: Bing Zhao, Matan Azrad, Slava Ovsiienko, Ori Kam, Suanming Mou
  Cc: dev, stable, David Marchand, Mário Kuka

,
x
> -----Original Message-----
> From: Bing Zhao <bingz@nvidia.com>
> Sent: Thursday, July 13, 2023 2:20 PM
> To: Matan Azrad <matan@nvidia.com>; Slava Ovsiienko
> <viacheslavo@nvidia.com>; Ori Kam <orika@nvidia.com>; Suanming Mou
> <suanmingm@nvidia.com>; Raslan Darawsheh <rasland@nvidia.com>
> Cc: dev@dpdk.org; stable@dpdk.org; David Marchand
> <david.marchand@redhat.com>; Mário Kuka <kuka@cesnet.cz>
> Subject: [PATCH v2] net/mlx5: fix the drop action memory leak
> 
> 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: bc5bee028ebc ("net/mlx5: create drop queue using DevX")
> Cc: stable@dpdk.org
> 
> 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>
> ---
> v2: added the reporter

Patch applied to next-net-mlx,

Kindest regards
Raslan Darawsheh

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-07-18 11:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-13 11:06 [PATCH] net/mlx5: fix the drop action memory leak Bing Zhao
2023-07-13 11:19 ` [PATCH v2] " Bing Zhao
2023-07-18 11:58   ` Raslan Darawsheh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).