DPDK patches and discussions
 help / color / mirror / Atom feed
From: Rongwei Liu <rongweil@nvidia.com>
To: <matan@nvidia.com>, <viacheslavo@nvidia.com>, <orika@nvidia.com>,
	<thomas@monjalon.net>, Dariusz Sosnowski <dsosnowski@nvidia.com>,
	Bing Zhao <bingz@nvidia.com>, Suanming Mou <suanmingm@nvidia.com>,
	Shani Peretz <shperetz@nvidia.com>
Cc: <dev@dpdk.org>, <rasland@nvidia.com>
Subject: [PATCH] net/mlx5: fix ipool memory leak
Date: Wed, 23 Jul 2025 09:49:22 +0300	[thread overview]
Message-ID: <20250723064923.1805575-1-rongweil@nvidia.com> (raw)

When ipool debug is enabled, there is internal memory
to maintain the ipool cache allocation. Need to free it
when destroying the ipool.

Fixes: 3a2bda363 ("net/mlx5: add ipool debug checks")
Cc: shperetz@nvidia.com
Signed-off-by: Rongwei Liu <rongweil@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
 drivers/net/mlx5/mlx5_utils.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/mlx5/mlx5_utils.c b/drivers/net/mlx5/mlx5_utils.c
index ac218868e6..58249b596f 100644
--- a/drivers/net/mlx5/mlx5_utils.c
+++ b/drivers/net/mlx5/mlx5_utils.c
@@ -871,6 +871,10 @@ mlx5_ipool_destroy(struct mlx5_indexed_pool *pool)
 		pool->cfg.free(trunks);
 	if (gc)
 		pool->cfg.free(gc);
+#ifdef POOL_DEBUG
+	if (pool->cache_validator.bmp_mem)
+		pool->cfg.free(pool->cache_validator.bmp_mem);
+#endif
 	mlx5_ipool_unlock(pool);
 	mlx5_free(pool);
 	return 0;
-- 
2.27.0


                 reply	other threads:[~2025-07-23  6:50 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20250723064923.1805575-1-rongweil@nvidia.com \
    --to=rongweil@nvidia.com \
    --cc=bingz@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=dsosnowski@nvidia.com \
    --cc=matan@nvidia.com \
    --cc=orika@nvidia.com \
    --cc=rasland@nvidia.com \
    --cc=shperetz@nvidia.com \
    --cc=suanmingm@nvidia.com \
    --cc=thomas@monjalon.net \
    --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).