DPDK patches and discussions
 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: [dpdk-dev] [PATCH 1/6] net/mlx5: fix shared device context creation error flow
Date: Sun, 5 Sep 2021 08:46:15 +0000	[thread overview]
Message-ID: <DM4PR12MB50540C3ADC9C3EB13FA54C1CCFD19@DM4PR12MB5054.namprd12.prod.outlook.com> (raw)
In-Reply-To: <20210831203732.3411134-2-michaelba@nvidia.com>

Hi,

> -----Original Message-----
> From: Michael Baum <michaelba@nvidia.com>
> Sent: Tuesday, August 31, 2021 11:37 PM
> To: dev@dpdk.org
> Cc: Matan Azrad <matan@nvidia.com>; Raslan Darawsheh
> <rasland@nvidia.com>; Slava Ovsiienko <viacheslavo@nvidia.com>;
> stable@dpdk.org
> Subject: [PATCH 1/6] net/mlx5: fix shared device context creation error flow
How about something like this:
fix memory leak in the shared device context creation
> 
> In shared device context creation, there are two validations after MR
> btree memory allocation.
> 
> When one of them fails, the MR btree memory was not freed what caused a
> memory leak.
> 
> Free it.
How about changing it to something like this:

In shared device context creation, there is a missing validation when one of
the btree memory allocation fails that will cause a memory leak.

This adds a proper check to clean resources in case of failure.

> 
> Fixes: 632f0f19056f ("net/mlx5: manage shared counters in three-level
> table")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Michael Baum <michaelba@nvidia.com>
> ---
>  drivers/net/mlx5/mlx5.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
> index f84e061fe7..f0ec2d1279 100644
> --- a/drivers/net/mlx5/mlx5.c
> +++ b/drivers/net/mlx5/mlx5.c
> @@ -1254,6 +1254,8 @@ mlx5_alloc_shared_dev_ctx(const struct
> mlx5_dev_spawn_data *spawn,
>  	MLX5_ASSERT(sh);
>  	if (sh->cnt_id_tbl)
>  		mlx5_l3t_destroy(sh->cnt_id_tbl);
> +	if (sh->share_cache.cache.table)
> +		mlx5_mr_btree_free(&sh->share_cache.cache);
>  	if (sh->tis)
>  		claim_zero(mlx5_devx_cmd_destroy(sh->tis));
>  	if (sh->td)
> --
> 2.25.1


  reply	other threads:[~2021-09-05  8:46 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-31 20:37 [dpdk-dev] [PATCH 0/6] mlx5: some independent fixes Michael Baum
2021-08-31 20:37 ` [dpdk-dev] [PATCH 1/6] net/mlx5: fix shared device context creation error flow Michael Baum
2021-09-05  8:46   ` Raslan Darawsheh [this message]
2021-08-31 20:37 ` [dpdk-dev] [PATCH 2/6] net/mlx5: fix PCI probing " Michael Baum
2021-09-05  8:53   ` Raslan Darawsheh
2021-08-31 20:37 ` [dpdk-dev] [PATCH 3/6] net/mlx5: fix allow duplicate pattern devarg default Michael Baum
2021-08-31 20:37 ` [dpdk-dev] [PATCH 4/6] common/mlx5: fix class combination validation Michael Baum
2021-08-31 20:37 ` [dpdk-dev] [PATCH 5/6] common/mlx5: fix device list operation concurrency Michael Baum
2021-08-31 20:37 ` [dpdk-dev] [PATCH 6/6] common/mlx5: fix resource cleanliness in a device remove Michael Baum
2021-09-01  7:46 ` [dpdk-dev] [PATCH 0/6] mlx5: some independent fixes Matan Azrad
2021-09-12 10:36 ` [dpdk-dev] [PATCH v2 " Michael Baum
2021-09-12 10:36   ` [dpdk-dev] [PATCH v2 1/6] net/mlx5: fix memory leak in the SH creation Michael Baum
2021-09-12 10:36   ` [dpdk-dev] [PATCH v2 2/6] net/mlx5: fix memory leak in PCI probe Michael Baum
2021-09-12 10:36   ` [dpdk-dev] [PATCH v2 3/6] net/mlx5: fix allow duplicate pattern devarg default Michael Baum
2021-09-12 10:36   ` [dpdk-dev] [PATCH v2 4/6] common/mlx5: fix class combination validation Michael Baum
2021-09-12 10:36   ` [dpdk-dev] [PATCH v2 5/6] common/mlx5: fix device list operation concurrency Michael Baum
2021-09-12 10:36   ` [dpdk-dev] [PATCH v2 6/6] common/mlx5: fix resource cleanliness in a device remove Michael Baum
2021-09-20 21:25   ` [dpdk-dev] [PATCH v2 0/6] mlx5: some independent fixes Thomas Monjalon

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=DM4PR12MB50540C3ADC9C3EB13FA54C1CCFD19@DM4PR12MB5054.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).