diff options
Diffstat (limited to 'drivers/infiniband/hw/ipath/ipath_qp.c')
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_qp.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_qp.c b/drivers/infiniband/hw/ipath/ipath_qp.c index 80dc623cee40..087ed3166479 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 { |
@@ -414,7 +415,7 @@ int ipath_error_qp(struct ipath_qp *qp, enum ib_wc_status err) | |||
414 | wc.wr_id = qp->r_wr_id; | 415 | wc.wr_id = qp->r_wr_id; |
415 | wc.opcode = IB_WC_RECV; | 416 | wc.opcode = IB_WC_RECV; |
416 | wc.status = err; | 417 | wc.status = err; |
417 | ipath_cq_enter(to_icq(qp->ibqp.send_cq), &wc, 1); | 418 | ipath_cq_enter(to_icq(qp->ibqp.recv_cq), &wc, 1); |
418 | } | 419 | } |
419 | wc.status = IB_WC_WR_FLUSH_ERR; | 420 | wc.status = IB_WC_WR_FLUSH_ERR; |
420 | 421 | ||
@@ -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: |
@@ -647,7 +648,7 @@ int ipath_query_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, | |||
647 | attr->port_num = 1; | 648 | attr->port_num = 1; |
648 | attr->timeout = qp->timeout; | 649 | attr->timeout = qp->timeout; |
649 | attr->retry_cnt = qp->s_retry_cnt; | 650 | attr->retry_cnt = qp->s_retry_cnt; |
650 | attr->rnr_retry = qp->s_rnr_retry; | 651 | attr->rnr_retry = qp->s_rnr_retry_cnt; |
651 | attr->alt_port_num = 0; | 652 | attr->alt_port_num = 0; |
652 | attr->alt_timeout = 0; | 653 | attr->alt_timeout = 0; |
653 | 654 | ||
@@ -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: |