DPDK patches and discussions
 help / color / mirror / Atom feed
From: Suanming Mou <suanmingm@mellanox.com>
To: viacheslavo@mellanox.com, matan@mellanox.com
Cc: rasland@mellanox.com, dev@dpdk.org
Subject: [dpdk-dev] [PATCH 2/2] net/mlx5: fix indexed pool incorrect trunks free
Date: Mon, 20 Apr 2020 10:34:36 +0800	[thread overview]
Message-ID: <1587350076-58468-3-git-send-email-suanmingm@mellanox.com> (raw)
In-Reply-To: <1587350076-58468-1-git-send-email-suanmingm@mellanox.com>

When the allocated trunks are used out, the pool trunk array will be
grown to a larger size to save more trunks.

Currently, when replace the pool trunk array to the new one. The code
wrongly frees the new trunk array.

Should free the old trunk array to fix the bug.

Fixes: 1702f7848f6a ("net/mlx5: add indexed memory pool")

Signed-off-by: Suanming Mou <suanmingm@mellanox.com>
---
 drivers/net/mlx5/mlx5_utils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_utils.c b/drivers/net/mlx5/mlx5_utils.c
index 07a6283..2146ffd 100644
--- a/drivers/net/mlx5/mlx5_utils.c
+++ b/drivers/net/mlx5/mlx5_utils.c
@@ -251,7 +251,7 @@ struct mlx5_indexed_pool *
 		trunk_tmp = pool->trunks;
 		pool->trunks = p;
 		if (trunk_tmp)
-			pool->cfg.free(pool->trunks);
+			pool->cfg.free(trunk_tmp);
 		pool->n_trunk += n_grow;
 	}
 	if (!pool->cfg.release_mem_en) {
-- 
1.8.3.1


  parent reply	other threads:[~2020-04-20  2:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-20  2:34 [dpdk-dev] [PATCH 0/2] net/mlx5: fix indexed pool bugs Suanming Mou
2020-04-20  2:34 ` [dpdk-dev] [PATCH 1/2] net/mlx5: fix incorrect indexed pool configurations Suanming Mou
2020-04-20  2:34 ` Suanming Mou [this message]
2020-04-20 13:15 ` [dpdk-dev] [PATCH 0/2] net/mlx5: fix indexed pool bugs 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=1587350076-58468-3-git-send-email-suanmingm@mellanox.com \
    --to=suanmingm@mellanox.com \
    --cc=dev@dpdk.org \
    --cc=matan@mellanox.com \
    --cc=rasland@mellanox.com \
    --cc=viacheslavo@mellanox.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).