DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bing Zhao <bingz@nvidia.com>
To: <matan@nvidia.com>, <viacheslavo@nvidia.com>, <orika@nvidia.com>,
	<suanmingm@nvidia.com>, <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
Date: Thu, 13 Jul 2023 14:19:41 +0300	[thread overview]
Message-ID: <20230713111941.427361-1-bingz@nvidia.com> (raw)
In-Reply-To: <20230713110643.427264-1-bingz@nvidia.com>

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


  reply	other threads:[~2023-07-13 11:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-13 11:06 [PATCH] " Bing Zhao
2023-07-13 11:19 ` Bing Zhao [this message]
2023-07-18 11:58   ` [PATCH v2] " Raslan Darawsheh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230713111941.427361-1-bingz@nvidia.com \
    --to=bingz@nvidia.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=kuka@cesnet.cz \
    --cc=matan@nvidia.com \
    --cc=orika@nvidia.com \
    --cc=rasland@nvidia.com \
    --cc=stable@dpdk.org \
    --cc=suanmingm@nvidia.com \
    --cc=viacheslavo@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).