patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Yunjian Wang <wangyunjian@huawei.com>
To: <dev@dpdk.org>
Cc: <matan@nvidia.com>, <viacheslavo@nvidia.com>,
	<dkozlyuk@nvidia.com>, <huangshaozhang@huawei.com>,
	Yunjian Wang <wangyunjian@huawei.com>, <stable@dpdk.org>
Subject: [dpdk-dev] [PATCH 1/1] net/mlx5: fix memory leak when releasing a drop action
Date: Sat, 30 Jul 2022 18:40:22 +0800	[thread overview]
Message-ID: <004c86e8ddf05bb9d3df77580357c4eca852c013.1659177063.git.wangyunjian@huawei.com> (raw)

When the memory for hrxq->action is allocated in mlx5_devx_hrxq_new().
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@dpdk.org

Signed-off-by: Yunjian Wang <wangyunjian@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
 }
 
 /**
-- 
2.27.0


             reply	other threads:[~2022-07-30 10:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-30 10:40 Yunjian Wang [this message]
2022-07-31  7:02 ` Matan Azrad
2022-08-03 13:23   ` wangyunjian

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=004c86e8ddf05bb9d3df77580357c4eca852c013.1659177063.git.wangyunjian@huawei.com \
    --to=wangyunjian@huawei.com \
    --cc=dev@dpdk.org \
    --cc=dkozlyuk@nvidia.com \
    --cc=huangshaozhang@huawei.com \
    --cc=matan@nvidia.com \
    --cc=stable@dpdk.org \
    --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).