From: Yangyang Li liyangyang20@huawei.com
driver inclusion category: bugfix bugzilla: https://gitee.com/src-openeuler/rdma-core/issues/I8KG9M
--------------------------------------------------------------------------
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: f1a80cc3dfe2 ("libhns: Bugfix for flush cqe in case multi-process") Signed-off-by: Yangyang Li liyangyang20@huawei.com --- providers/hns/hns_roce_u_hw_v2.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/providers/hns/hns_roce_u_hw_v2.c b/providers/hns/hns_roce_u_hw_v2.c index 2fb738d..68d7110 100644 --- a/providers/hns/hns_roce_u_hw_v2.c +++ b/providers/hns/hns_roce_u_hw_v2.c @@ -1936,6 +1936,8 @@ static int hns_roce_u_v2_modify_qp(struct ibv_qp *qp, struct ibv_qp_attr *attr, sizeof(resp_ex));
if (flag) { + if (!ret) + qp->state = IBV_QPS_ERR; hns_roce_spin_unlock(&hr_qp->sq.hr_lock); hns_roce_spin_unlock(&hr_qp->rq.hr_lock); } -- 2.30.0