Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 88549
b: refs/heads/master
c: 5121df3
h: refs/heads/master
i:
  88547: e8804af
v: v3
  • Loading branch information
Dotan Barak authored and Roland Dreier committed Apr 17, 2008
1 parent f5c4883 commit 762ea49
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9285faa1e7c8ffcc8901c40f6e1cc06d93e92431
refs/heads/master: 5121df3ae45731ce98374a1b0b4d48f072643f42
20 changes: 14 additions & 6 deletions trunk/drivers/infiniband/hw/mthca/mthca_qp.c
Original file line number Diff line number Diff line change
Expand Up @@ -437,29 +437,34 @@ int mthca_query_qp(struct ib_qp *ibqp, struct ib_qp_attr *qp_attr, int qp_attr_m
int mthca_state;
u8 status;

mutex_lock(&qp->mutex);

if (qp->state == IB_QPS_RESET) {
qp_attr->qp_state = IB_QPS_RESET;
goto done;
}

mailbox = mthca_alloc_mailbox(dev, GFP_KERNEL);
if (IS_ERR(mailbox))
return PTR_ERR(mailbox);
if (IS_ERR(mailbox)) {
err = PTR_ERR(mailbox);
goto out;
}

err = mthca_QUERY_QP(dev, qp->qpn, 0, mailbox, &status);
if (err)
goto out;
goto out_mailbox;
if (status) {
mthca_warn(dev, "QUERY_QP returned status %02x\n", status);
err = -EINVAL;
goto out;
goto out_mailbox;
}

qp_param = mailbox->buf;
context = &qp_param->context;
mthca_state = be32_to_cpu(context->flags) >> 28;

qp_attr->qp_state = to_ib_qp_state(mthca_state);
qp->state = to_ib_qp_state(mthca_state);
qp_attr->qp_state = qp->state;
qp_attr->path_mtu = context->mtu_msgmax >> 5;
qp_attr->path_mig_state =
to_ib_mig_state((be32_to_cpu(context->flags) >> 11) & 0x3);
Expand Down Expand Up @@ -506,8 +511,11 @@ int mthca_query_qp(struct ib_qp *ibqp, struct ib_qp_attr *qp_attr, int qp_attr_m

qp_init_attr->cap = qp_attr->cap;

out:
out_mailbox:
mthca_free_mailbox(dev, mailbox);

out:
mutex_unlock(&qp->mutex);
return err;
}

Expand Down

0 comments on commit 762ea49

Please sign in to comment.