patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Raslan Darawsheh <rasland@mellanox.com>
To: Asaf Penso <asafp@mellanox.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: Slava Ovsiienko <viacheslavo@mellanox.com>,
	Dekel Peled <dekelp@mellanox.com>,
	"stable@dpdk.org" <stable@dpdk.org>
Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH] net/mlx5: fix location of assert function
Date: Wed, 29 Apr 2020 10:36:16 +0000	[thread overview]
Message-ID: <VI1PR05MB671851206ACFD948AA9BBB0AC2AD0@VI1PR05MB6718.eurprd05.prod.outlook.com> (raw)
In-Reply-To: <1587057309-2947-1-git-send-email-asafp@mellanox.com>

Hi,
> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Asaf Penso
> Sent: Thursday, April 16, 2020 8:15 PM
> To: dev@dpdk.org
> Cc: Slava Ovsiienko <viacheslavo@mellanox.com>; Dekel Peled
> <dekelp@mellanox.com>; stable@dpdk.org
> Subject: [dpdk-dev] [PATCH] net/mlx5: fix location of assert function
> 
> The asserts makes sure that 'i' doesn't exceed the exepcted value.
> This to prevent an out of bound access to dbr_bitmap.
> 
> The current location of the assert protects the assignment of
> dbr_bitmap, but not the access to it.
> 
> Moved the assert to the correct place, to protect both cases.
> Also, used an existing define for the assert.
> 
> Fixes: 21cae858 ("net/mlx5: allocate door-bells via DevX")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Asaf Penso <asafp@mellanox.com>
> Reviewed-by: Dekel Peled <dekelp@mellanox.com>
> Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
> ---
>  drivers/net/mlx5/mlx5.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
> index f8b134c..df12a3b 100644
> --- a/drivers/net/mlx5/mlx5.c
> +++ b/drivers/net/mlx5/mlx5.c
> @@ -1989,8 +1989,8 @@ struct mlx5_flow_id_pool *
>  	     i++)
>  		; /* Empty. */
>  	/* Find the first clear bit. */
> +	MLX5_ASSERT(i < MLX5_DBR_BITMAP_SIZE);
>  	j = rte_bsf64(~page->dbr_bitmap[i]);
> -	MLX5_ASSERT(i < (MLX5_DBR_PER_PAGE / 64));
>  	page->dbr_bitmap[i] |= (1 << j);
>  	page->dbr_count++;
>  	*dbr_page = page;
> --
> 1.8.3.1


Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh


      reply	other threads:[~2020-04-29 10:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-16 17:15 [dpdk-stable] " Asaf Penso
2020-04-29 10:36 ` 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=VI1PR05MB671851206ACFD948AA9BBB0AC2AD0@VI1PR05MB6718.eurprd05.prod.outlook.com \
    --to=rasland@mellanox.com \
    --cc=asafp@mellanox.com \
    --cc=dekelp@mellanox.com \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    --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).