Skip to content

Commit

Permalink
libhns: Fix no locking in the exception branch of wr start()
Browse files Browse the repository at this point in the history
According to the man page ibv_wr_post.3.md,
"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."

Currently the exception branch of wr_start() is not locked, add
a lock here.

Fixes: 36446a5 ("libhns: Extended QP supports the new post send mechanism")
Signed-off-by: wenglianfa <wenglianfa@huawei.com>
Signed-off-by: Junxian Huang <huangjunxian6@hisilicon.com>
  • Loading branch information
wenglianfa authored and Junxian Huang committed Jul 30, 2024
1 parent a7528e0 commit d1d0ac5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions providers/hns/hns_roce_u_hw_v2.c
Original file line number Diff line number Diff line change
Expand Up @@ -2558,6 +2558,7 @@ static void wr_start(struct ibv_qp_ex *ibv_qp)
if (state == IBV_QPS_RESET ||
state == IBV_QPS_INIT ||
state == IBV_QPS_RTR) {
hns_roce_spin_lock(&qp->sq.hr_lock);
qp->err = EINVAL;
return;
}
Expand Down

0 comments on commit d1d0ac5

Please sign in to comment.