Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 88550
b: refs/heads/master
c: 0df6703
h: refs/heads/master
v: v3
  • Loading branch information
Dotan Barak authored and Roland Dreier committed Apr 17, 2008
1 parent 762ea49 commit 2281b74
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 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: 5121df3ae45731ce98374a1b0b4d48f072643f42
refs/heads/master: 0df67030958bad07c3f82f392e3ffb785c56e48d
17 changes: 12 additions & 5 deletions trunk/drivers/infiniband/hw/mlx4/qp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1785,20 +1785,25 @@ int mlx4_ib_query_qp(struct ib_qp *ibqp, struct ib_qp_attr *qp_attr, int qp_attr
struct mlx4_ib_qp *qp = to_mqp(ibqp);
struct mlx4_qp_context context;
int mlx4_state;
int err;
int err = 0;

mutex_lock(&qp->mutex);

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

err = mlx4_qp_query(dev->dev, &qp->mqp, &context);
if (err)
return -EINVAL;
if (err) {
err = -EINVAL;
goto out;
}

mlx4_state = be32_to_cpu(context.flags) >> 28;

qp_attr->qp_state = to_ib_qp_state(mlx4_state);
qp->state = to_ib_qp_state(mlx4_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 @@ -1857,6 +1862,8 @@ int mlx4_ib_query_qp(struct ib_qp *ibqp, struct ib_qp_attr *qp_attr, int qp_attr

qp_init_attr->cap = qp_attr->cap;

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

0 comments on commit 2281b74

Please sign in to comment.