Skip to content

Commit 10bd2ad

Browse files
Yixian Liujgunthorpe
authored andcommitted
RDMA/hns: Fix QP state judgement before sending work requests
The QP can accept send 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. Signed-off-by: Yixian Liu <[email protected]> Signed-off-by: Shaobo Xu <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent 52e3b42 commit 10bd2ad

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/infiniband/hw/hns/hns_roce_hw_v2.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ static int hns_roce_v2_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
7676
return -EOPNOTSUPP;
7777
}
7878

79-
if (unlikely(qp->state != IB_QPS_RTS && qp->state != IB_QPS_SQD)) {
79+
if (unlikely(qp->state == IB_QPS_RESET || qp->state == IB_QPS_INIT ||
80+
qp->state == IB_QPS_RTR)) {
8081
dev_err(dev, "Post WQE fail, QP state %d err!\n", qp->state);
8182
*bad_wr = wr;
8283
return -EINVAL;

0 commit comments

Comments
 (0)