diff options
author | Patrick Marchand Latifi <patrick.latifi@qlogic.com> | 2008-01-18 23:10:48 -0500 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2008-03-11 17:02:32 -0400 |
commit | 4cd5060cf7c2207c31e2e368f8a6343355362e51 (patch) | |
tree | aa1a5eb987aa39b06c3f582cb0206ba3f4ee5626 | |
parent | 87d5aed85b2d79e4075ad2ca1449e9b98f657a09 (diff) |
IB/ipath: Fix RC QP initialization
This patch fixes the initialization of RC QPs, since we would rely on
the queue pair type (ibqp->qp_type) being set, but this field is only
initialized when we return from ipath_create_qp (it is initialized by
the user-level verbs library).
The fix is to not depend on this field to initialize the send and
the receive state of the RC QP.
Signed-off-by: Patrick Marchand Latifi <patrick.latifi@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_qp.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_qp.c b/drivers/infiniband/hw/ipath/ipath_qp.c index 8214c0905c7..553d9007cf0 100644 --- a/drivers/infiniband/hw/ipath/ipath_qp.c +++ b/drivers/infiniband/hw/ipath/ipath_qp.c | |||
@@ -329,8 +329,9 @@ struct ipath_qp *ipath_lookup_qpn(struct ipath_qp_table *qpt, u32 qpn) | |||
329 | /** | 329 | /** |
330 | * ipath_reset_qp - initialize the QP state to the reset state | 330 | * ipath_reset_qp - initialize the QP state to the reset state |
331 | * @qp: the QP to reset | 331 | * @qp: the QP to reset |
332 | * @type: the QP type | ||
332 | */ | 333 | */ |
333 | static void ipath_reset_qp(struct ipath_qp *qp) | 334 | static void ipath_reset_qp(struct ipath_qp *qp, enum ib_qp_type type) |
334 | { | 335 | { |
335 | qp->remote_qpn = 0; | 336 | qp->remote_qpn = 0; |
336 | qp->qkey = 0; | 337 | qp->qkey = 0; |
@@ -342,7 +343,7 @@ static void ipath_reset_qp(struct ipath_qp *qp) | |||
342 | qp->s_psn = 0; | 343 | qp->s_psn = 0; |
343 | qp->r_psn = 0; | 344 | qp->r_psn = 0; |
344 | qp->r_msn = 0; | 345 | qp->r_msn = 0; |
345 | if (qp->ibqp.qp_type == IB_QPT_RC) { | 346 | if (type == IB_QPT_RC) { |
346 | qp->s_state = IB_OPCODE_RC_SEND_LAST; | 347 | qp->s_state = IB_OPCODE_RC_SEND_LAST; |
347 | qp->r_state = IB_OPCODE_RC_SEND_LAST; | 348 | qp->r_state = IB_OPCODE_RC_SEND_LAST; |
348 | } else { | 349 | } else { |
@@ -534,7 +535,7 @@ int ipath_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, | |||
534 | 535 | ||
535 | switch (new_state) { | 536 | switch (new_state) { |
536 | case IB_QPS_RESET: | 537 | case IB_QPS_RESET: |
537 | ipath_reset_qp(qp); | 538 | ipath_reset_qp(qp, ibqp->qp_type); |
538 | break; | 539 | break; |
539 | 540 | ||
540 | case IB_QPS_ERR: | 541 | case IB_QPS_ERR: |
@@ -839,7 +840,7 @@ struct ib_qp *ipath_create_qp(struct ib_pd *ibpd, | |||
839 | goto bail_qp; | 840 | goto bail_qp; |
840 | } | 841 | } |
841 | qp->ip = NULL; | 842 | qp->ip = NULL; |
842 | ipath_reset_qp(qp); | 843 | ipath_reset_qp(qp, init_attr->qp_type); |
843 | break; | 844 | break; |
844 | 845 | ||
845 | default: | 846 | default: |