RDMA/cxgb3: Move QP to error on destroy if the state is IDLE
authorSteve Wise <swise@opengridcomputing.com>
Tue, 6 Mar 2007 20:43:58 +0000 (14:43 -0600)
committerRoland Dreier <rolandd@cisco.com>
Tue, 6 Mar 2007 20:50:45 +0000 (12:50 -0800)
Change iwch_destroy_qp() to always move the QP to ERROR and let
iwch_modify_qp() decide what to do.

Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
drivers/infiniband/hw/cxgb3/iwch_provider.c

index b357c11d148f6f830e3676ffaa672a8ec404ba86..9fe7dfeb7c80edc36483186e6c93e7dfab24eede 100644 (file)
@@ -738,10 +738,8 @@ static int iwch_destroy_qp(struct ib_qp *ib_qp)
        qhp = to_iwch_qp(ib_qp);
        rhp = qhp->rhp;
 
-       if (qhp->attr.state == IWCH_QP_STATE_RTS) {
-               attrs.next_state = IWCH_QP_STATE_ERROR;
-               iwch_modify_qp(rhp, qhp, IWCH_QP_ATTR_NEXT_STATE, &attrs, 0);
-       }
+       attrs.next_state = IWCH_QP_STATE_ERROR;
+       iwch_modify_qp(rhp, qhp, IWCH_QP_ATTR_NEXT_STATE, &attrs, 0);
        wait_event(qhp->wait, !qhp->ep);
 
        remove_handle(rhp, &rhp->qpidr, qhp->wq.qpid);