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

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