Skip to content

Commit

Permalink
libhns: Bugfix for wrong timing of modifying ibv_qp state to err
Browse files Browse the repository at this point in the history
Currently the QPC state in HW is modified inside the critical section
of spinlock but the ibv_qp state is modified outside. There will be
a short period when QPC state has been modified to err with ibv_qp
state still remaining RTS. WQEs during this period will still be
post-send by RTS-state ibv_qp but then dropped by err-state HW with
no flush CQEs generated.

To fix this problem, the QPC state in HW and ibv_qp state should be
both modified to err inside the critical section of spinlock.

Fixes: f1a80cc ("libhns: Bugfix for flush cqe in case multi-process")
Signed-off-by: Yangyang Li <liyangyang20@huawei.com>
Signed-off-by: Junxian Huang <huangjunxian6@hisilicon.com>
  • Loading branch information
l00436852 authored and Junxian Huang committed Dec 8, 2023
1 parent 886b17c commit 886cf76
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions providers/hns/hns_roce_u_hw_v2.c
Expand Up @@ -1552,6 +1552,8 @@ static int hns_roce_u_v2_modify_qp(struct ibv_qp *qp, struct ibv_qp_attr *attr,
ret = ibv_cmd_modify_qp(qp, attr, attr_mask, &cmd, sizeof(cmd));

if (flag) {
if (!ret)
qp->state = IBV_QPS_ERR;
pthread_spin_unlock(&hr_qp->rq.lock);
pthread_spin_unlock(&hr_qp->sq.lock);
}
Expand Down

0 comments on commit 886cf76

Please sign in to comment.