diff options
| -rw-r--r-- | drivers/infiniband/hw/mthca/mthca_qp.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/drivers/infiniband/hw/mthca/mthca_qp.c b/drivers/infiniband/hw/mthca/mthca_qp.c index a09873d2ef5e..1bc2678c2fae 100644 --- a/drivers/infiniband/hw/mthca/mthca_qp.c +++ b/drivers/infiniband/hw/mthca/mthca_qp.c | |||
| @@ -777,21 +777,20 @@ int mthca_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, int attr_mask) | |||
| 777 | 777 | ||
| 778 | err = mthca_MODIFY_QP(dev, cur_state, new_state, qp->qpn, 0, | 778 | err = mthca_MODIFY_QP(dev, cur_state, new_state, qp->qpn, 0, |
| 779 | mailbox, sqd_event, &status); | 779 | mailbox, sqd_event, &status); |
| 780 | if (err) | ||
| 781 | goto out; | ||
| 780 | if (status) { | 782 | if (status) { |
| 781 | mthca_warn(dev, "modify QP %d->%d returned status %02x.\n", | 783 | mthca_warn(dev, "modify QP %d->%d returned status %02x.\n", |
| 782 | cur_state, new_state, status); | 784 | cur_state, new_state, status); |
| 783 | err = -EINVAL; | 785 | err = -EINVAL; |
| 786 | goto out; | ||
| 784 | } | 787 | } |
| 785 | 788 | ||
| 786 | if (!err) { | 789 | qp->state = new_state; |
| 787 | qp->state = new_state; | 790 | if (attr_mask & IB_QP_ACCESS_FLAGS) |
| 788 | if (attr_mask & IB_QP_ACCESS_FLAGS) | 791 | qp->atomic_rd_en = attr->qp_access_flags; |
| 789 | qp->atomic_rd_en = attr->qp_access_flags; | 792 | if (attr_mask & IB_QP_MAX_DEST_RD_ATOMIC) |
| 790 | if (attr_mask & IB_QP_MAX_DEST_RD_ATOMIC) | 793 | qp->resp_depth = attr->max_dest_rd_atomic; |
| 791 | qp->resp_depth = attr->max_dest_rd_atomic; | ||
| 792 | } | ||
| 793 | |||
| 794 | mthca_free_mailbox(dev, mailbox); | ||
| 795 | 794 | ||
| 796 | if (is_sqp(dev, qp)) | 795 | if (is_sqp(dev, qp)) |
| 797 | store_attrs(to_msqp(qp), attr, attr_mask); | 796 | store_attrs(to_msqp(qp), attr, attr_mask); |
| @@ -816,7 +815,7 @@ int mthca_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, int attr_mask) | |||
| 816 | * If we moved a kernel QP to RESET, clean up all old CQ | 815 | * If we moved a kernel QP to RESET, clean up all old CQ |
| 817 | * entries and reinitialize the QP. | 816 | * entries and reinitialize the QP. |
| 818 | */ | 817 | */ |
| 819 | if (!err && new_state == IB_QPS_RESET && !qp->ibqp.uobject) { | 818 | if (new_state == IB_QPS_RESET && !qp->ibqp.uobject) { |
| 820 | mthca_cq_clean(dev, to_mcq(qp->ibqp.send_cq)->cqn, qp->qpn, | 819 | mthca_cq_clean(dev, to_mcq(qp->ibqp.send_cq)->cqn, qp->qpn, |
| 821 | qp->ibqp.srq ? to_msrq(qp->ibqp.srq) : NULL); | 820 | qp->ibqp.srq ? to_msrq(qp->ibqp.srq) : NULL); |
| 822 | if (qp->ibqp.send_cq != qp->ibqp.recv_cq) | 821 | if (qp->ibqp.send_cq != qp->ibqp.recv_cq) |
| @@ -835,6 +834,8 @@ int mthca_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, int attr_mask) | |||
| 835 | } | 834 | } |
| 836 | } | 835 | } |
| 837 | 836 | ||
| 837 | out: | ||
| 838 | mthca_free_mailbox(dev, mailbox); | ||
| 838 | return err; | 839 | return err; |
| 839 | } | 840 | } |
| 840 | 841 | ||
