path: root/drivers/net/mlx5/mlx5_mr.c
diff options
authorXueming Li <>2018-05-26 21:27:35 +0800
committerShahaf Shuler <>2018-05-28 16:28:43 +0200
commit0ace586dee70ce1842c858e27a3590417f8fb40c (patch)
tree9b6ce626318e268289d205a8a8e0d5c27dbe29af /drivers/net/mlx5/mlx5_mr.c
parente89c15b6971e5040296dc69f8739dd629f56a4b2 (diff)
net/mlx5: fix memory region cache init
MR cache init takes place on the device configuration. When the device is re-configured multiple times, for example when changing the number of queue on the flight, deadlock can happen. This patch moved MR cache init from device configuration function to probe function to make sure init only once. Fixes: 974f1e7ef146 ("net/mlx5: add new memory region support") Signed-off-by: Xueming Li <> Acked-by: Yongseok Koh <>
Diffstat (limited to 'drivers/net/mlx5/mlx5_mr.c')
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/mlx5/mlx5_mr.c b/drivers/net/mlx5/mlx5_mr.c
index abb1f51..08105a4 100644
--- a/drivers/net/mlx5/mlx5_mr.c
+++ b/drivers/net/mlx5/mlx5_mr.c
@@ -191,6 +191,7 @@ mlx5_mr_btree_init(struct mlx5_mr_btree *bt, int n, int socket)
rte_errno = EINVAL;
return -rte_errno;
+ assert(!bt->table && !bt->size);
memset(bt, 0, sizeof(*bt));
bt->table = rte_calloc_socket("B-tree table",
n, sizeof(struct mlx5_mr_cache),