Blame SOURCES/0001-mlx5-Consider-single-threaded-mode-for-shared-UAR.patch

fa196d
From 0d9ed0f09b92f730ae3a755415c4e68e62c4cf99 Mon Sep 17 00:00:00 2001
fa196d
From: Yishai Hadas <yishaih@nvidia.com>
fa196d
Date: Wed, 9 Dec 2020 09:15:39 +0200
fa196d
Subject: [PATCH] mlx5: Consider single threaded mode for shared UAR
fa196d
fa196d
[ Upstream commit 9d6cbd2858d237d1d56bada430eca032074204c8 ]
fa196d
fa196d
In case application uses a single threaded mode even a UAR that is
fa196d
shared between QPs doesn't need to take a lock.
fa196d
fa196d
Fixes: 7fdcd258bc5f ("mlx5: Move to fully dynamic UAR mode including QPs")
fa196d
Signed-off-by: Yishai Hadas <yishaih@nvidia.com>
fa196d
Signed-off-by: Nicolas Morey-Chaisemartin <nmoreychaisemartin@suse.com>
fa196d
---
fa196d
 providers/mlx5/verbs.c | 2 +-
fa196d
 1 file changed, 1 insertion(+), 1 deletion(-)
fa196d
fa196d
diff --git a/providers/mlx5/verbs.c b/providers/mlx5/verbs.c
fa196d
index 7907218295f6..cc93dc4c366e 100644
fa196d
--- a/providers/mlx5/verbs.c
fa196d
+++ b/providers/mlx5/verbs.c
fa196d
@@ -326,7 +326,7 @@ static void mlx5_insert_dyn_uuars(struct mlx5_context *ctx,
fa196d
 		if (!bf_uar->dyn_alloc_uar)
fa196d
 			bf->bfreg_dyn_index = (ctx->curr_legacy_dyn_sys_uar_page - 1) * num_bfregs_per_page + j;
fa196d
 		bf->dyn_alloc_uar = bf_uar->dyn_alloc_uar;
fa196d
-		bf->need_lock = bf_uar->qp_shared;
fa196d
+		bf->need_lock = bf_uar->qp_shared && !mlx5_single_threaded;
fa196d
 		mlx5_spinlock_init(&bf->lock, bf->need_lock);
fa196d
 		if (j != 0) {
fa196d
 			bf->uar = bf_uar->uar;
fa196d
-- 
fa196d
2.25.4
fa196d