浏览代码

IB/ehca: Reject send WRs only for RESET, INIT and RTR state

Signed-off-by: Joachim Fenkes <fenkes@de.ibm.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Joachim Fenkes 17 年之前
父节点
当前提交
088af1543c
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 4 2
      drivers/infiniband/hw/ehca/ehca_reqs.c

+ 4 - 2
drivers/infiniband/hw/ehca/ehca_reqs.c

@@ -421,8 +421,10 @@ int ehca_post_send(struct ib_qp *qp,
 	int ret = 0;
 	unsigned long flags;
 
-	if (unlikely(my_qp->state != IB_QPS_RTS)) {
-		ehca_err(qp->device, "QP not in RTS state  qpn=%x", qp->qp_num);
+	/* Reject WR if QP is in RESET, INIT or RTR state */
+	if (unlikely(my_qp->state < IB_QPS_RTS)) {
+		ehca_err(qp->device, "Invalid QP state  qp_state=%d qpn=%x",
+			 my_qp->state, qp->qp_num);
 		return -EINVAL;
 	}