patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Raslan Darawsheh <rasland@nvidia.com>
To: Michael Baum <michaelba@nvidia.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: Matan Azrad <matan@nvidia.com>,
	Slava Ovsiienko <viacheslavo@nvidia.com>,
	 "stable@dpdk.org" <stable@dpdk.org>
Subject: RE: [PATCH] common/mlx5: fix memory leak in Windows dereg MR function
Date: Wed, 17 Nov 2021 14:44:29 +0000	[thread overview]
Message-ID: <DM4PR12MB5312A57F86C826D4841B00EACF9A9@DM4PR12MB5312.namprd12.prod.outlook.com> (raw)
In-Reply-To: <20211117110255.2060417-1-michaelba@nvidia.com>

Hi,

> -----Original Message-----
> From: Michael Baum <michaelba@nvidia.com>
> Sent: Wednesday, November 17, 2021 1:03 PM
> To: dev@dpdk.org
> Cc: Matan Azrad <matan@nvidia.com>; Raslan Darawsheh
> <rasland@nvidia.com>; Slava Ovsiienko <viacheslavo@nvidia.com>; Michael
> Baum <michaelba@nvidia.com>; stable@dpdk.org
> Subject: [PATCH] common/mlx5: fix memory leak in Windows dereg MR
> function
> 
> From: Michael Baum <michaelba@nvidia.com>
> 
> The "mlx5_devx_cmd_mkey_create" DevX cmd allocates DevX object using
> mlx5_malloc and then creates MKey using glue function.
> Compatibly, "mlx5_devx_cmd_destroy" cmd releases first the MKey using
> glue function, and then free the DevX object using mlx5_free.
> 
> On Windows OS, the reg_mr function creates Mkey using
> "mlx5_devx_cmd_mkey_create" cmd, but dereg_mr function using directly
> glue function without freeing the object.
> This behavior causes memory leak at each MR release.
> 
> In addition, the dereg_mr function makes sure that the MR pointer is
> valid before destroying its fields, but always calls the memset function
> that makes a difference to it.
> 
> This patch moves the dereg_mr function to use "mlx5_devx_cmd_destroy"
> instead of glue function, and extends the validity test to the whole
> function.
> 
> Fixes: ba420719823c ("common/mlx5: add reg/dereg MR on Windows")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Michael Baum <michaelba@nvidia.com>
> Acked-by: Matan Azrad <matan@nvidia.com>

Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh

      reply	other threads:[~2021-11-17 14:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-17 11:02 michaelba
2021-11-17 14:44 ` Raslan Darawsheh [this message]

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=DM4PR12MB5312A57F86C826D4841B00EACF9A9@DM4PR12MB5312.namprd12.prod.outlook.com \
    --to=rasland@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=matan@nvidia.com \
    --cc=michaelba@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).