[dpdk-stable] patch 'net/mlx5: fix assert in doorbell lookup' has been queued to stable release 19.11.3

luca.boccassi at gmail.com luca.boccassi at gmail.com
Tue May 19 15:04:35 CEST 2020


Hi,

FYI, your patch has been queued to stable release 19.11.3

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/21/20. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Thanks.

Luca Boccassi

---
>From fd7ba64cb44468d9c7d91aa60e710dbceb37c301 Mon Sep 17 00:00:00 2001
From: Asaf Penso <asafp at mellanox.com>
Date: Thu, 16 Apr 2020 17:15:09 +0000
Subject: [PATCH] net/mlx5: fix assert in doorbell lookup

[ upstream commit 9b080425e31297199dcbfa35d95d287d729c68a0 ]

The asserts makes sure that 'i' doesn't exceed the expected 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: 21cae8580fd0 ("net/mlx5: allocate door-bells via DevX")

Signed-off-by: Asaf Penso <asafp at mellanox.com>
Reviewed-by: Dekel Peled <dekelp at mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo at 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 6ac387bd24..9ecf31da7c 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -1946,8 +1946,8 @@ mlx5_get_dbr(struct rte_eth_dev *dev, struct mlx5_devx_dbr_page **dbr_page)
 	     i++)
 		; /* Empty. */
 	/* Find the first clear bit. */
+	assert(i < MLX5_DBR_BITMAP_SIZE);
 	j = rte_bsf64(~page->dbr_bitmap[i]);
-	assert(i < (MLX5_DBR_PER_PAGE / 64));
 	page->dbr_bitmap[i] |= (1 << j);
 	page->dbr_count++;
 	*dbr_page = page;
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-05-19 14:04:50.132975267 +0100
+++ 0140-net-mlx5-fix-assert-in-doorbell-lookup.patch	2020-05-19 14:04:44.456652723 +0100
@@ -1,8 +1,10 @@
-From 9b080425e31297199dcbfa35d95d287d729c68a0 Mon Sep 17 00:00:00 2001
+From fd7ba64cb44468d9c7d91aa60e710dbceb37c301 Mon Sep 17 00:00:00 2001
 From: Asaf Penso <asafp at mellanox.com>
 Date: Thu, 16 Apr 2020 17:15:09 +0000
 Subject: [PATCH] net/mlx5: fix assert in doorbell lookup
 
+[ upstream commit 9b080425e31297199dcbfa35d95d287d729c68a0 ]
+
 The asserts makes sure that 'i' doesn't exceed the expected value.
 This to prevent an out of bound access to dbr_bitmap.
 
@@ -13,7 +15,6 @@
 Also, used an existing define for the assert.
 
 Fixes: 21cae8580fd0 ("net/mlx5: allocate door-bells via DevX")
-Cc: stable at dpdk.org
 
 Signed-off-by: Asaf Penso <asafp at mellanox.com>
 Reviewed-by: Dekel Peled <dekelp at mellanox.com>
@@ -23,16 +24,16 @@
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
-index cc13e447d6..75ada96cc5 100644
+index 6ac387bd24..9ecf31da7c 100644
 --- a/drivers/net/mlx5/mlx5.c
 +++ b/drivers/net/mlx5/mlx5.c
-@@ -2149,8 +2149,8 @@ mlx5_get_dbr(struct rte_eth_dev *dev, struct mlx5_devx_dbr_page **dbr_page)
+@@ -1946,8 +1946,8 @@ mlx5_get_dbr(struct rte_eth_dev *dev, struct mlx5_devx_dbr_page **dbr_page)
  	     i++)
  		; /* Empty. */
  	/* Find the first clear bit. */
-+	MLX5_ASSERT(i < MLX5_DBR_BITMAP_SIZE);
++	assert(i < MLX5_DBR_BITMAP_SIZE);
  	j = rte_bsf64(~page->dbr_bitmap[i]);
--	MLX5_ASSERT(i < (MLX5_DBR_PER_PAGE / 64));
+-	assert(i < (MLX5_DBR_PER_PAGE / 64));
  	page->dbr_bitmap[i] |= (1 << j);
  	page->dbr_count++;
  	*dbr_page = page;


More information about the stable mailing list