rdma-core/0086-libhns-Fix-the-exception-branch-of-wr_start-is-not-l.patch
Xinghai Cen 4ece021efa libhns:Fixes several bugs for hns
driver inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/IALOAP

----------------------------------------------------------------------

Fixes several bugs for hns:
libhns: Fix overwritten SL in DSCP mode
libhns: Support returning the final value of SL configuration
libhns: Fix memory leakage when DCA is enabled
libhns: Fix the exception branch of wr_start() is not locked

Signed-off-by: Xinghai Cen <cenxinghai@h-partners.com>
(cherry picked from commit f7e92a7c61500e17a864d2e016e842436bd1f442)
2024-08-22 21:19:44 +08:00

36 lines
1.1 KiB
Diff

From 41592115435779d7c41e7f1677520b9c641289d9 Mon Sep 17 00:00:00 2001
From: wenglianfa <wenglianfa@huawei.com>
Date: Wed, 12 Jun 2024 17:11:13 +0800
Subject: [PATCH 4/4] libhns: Fix the exception branch of wr_start() is not
locked
The provider should provide locking to ensure that ibv_wr_start()
and ibv_wr_complete()/abort() form a per-QP critical section
where no other threads can enter.
The exception branch of wr_start() is not locked, fix it here.
Because check_qp_send () does not require lock protection,
hns_roce_spin_lock () is placed after check_qp_send ().
Fixes: 36446a56eea5 ("libhns: Extended QP supports the new post send mechanism")
Signed-off-by: wenglianfa <wenglianfa@huawei.com>
---
providers/hns/hns_roce_u_hw_v2.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/providers/hns/hns_roce_u_hw_v2.c b/providers/hns/hns_roce_u_hw_v2.c
index af25e6e..79f225c 100644
--- a/providers/hns/hns_roce_u_hw_v2.c
+++ b/providers/hns/hns_roce_u_hw_v2.c
@@ -2975,6 +2975,7 @@ static void wr_start(struct ibv_qp_ex *ibv_qp)
ret = check_qp_send(qp, ctx);
if (ret) {
+ hns_roce_spin_lock(&qp->sq.hr_lock);
qp->err = ret;
return;
}
--
2.33.0