The QP can accept receive work requests only when the QP is in the states that allow them to be submitted. This patch updates the QP state judgement based on the specification.
Unified · Split
| @@ -509,7 +509,7 @@ static int hns_roce_v2_post_recv(struct ib_qp *ibqp, struct ib_recv_wr *wr, · 508 unmodified lines | ||
| 509 | 509 | spin_lock_irqsave(&hr_qp->rq.lock, flags); |
| 510 | 510 | ind = hr_qp->rq.head & (hr_qp->rq.wqe_cnt - 1); |
| 511 | 511 | |
| 512 | − if (hr_qp->state == IB_QPS_RESET || hr_qp->state == IB_QPS_ERR) { | |
| 512 | + if (hr_qp->state == IB_QPS_RESET) { | |
| 513 | 513 | spin_unlock_irqrestore(&hr_qp->rq.lock, flags); |
| 514 | 514 | *bad_wr = wr; |
| 515 | 515 | return -EINVAL; |