diff options
author | Ralph Campbell <ralph.campbell@qlogic.com> | 2007-03-15 17:44:53 -0400 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2007-04-18 23:20:55 -0400 |
commit | 0434d271fddaabd65aaa4dbd0145112d6e8aa388 (patch) | |
tree | 67fd3d5057374e9f73f64439b983bb094f7097c8 /drivers/infiniband | |
parent | 39c0d0b919ae5080163bd2d41c0271cda250d382 (diff) |
IB/ipath: Fix QP error completion queue entries
When switching to the QP error state, the completion queue entries
(error or flush) were not being generated correctly.
Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_qp.c | 8 | ||||
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_rc.c | 2 |
2 files changed, 7 insertions, 3 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_qp.c b/drivers/infiniband/hw/ipath/ipath_qp.c index f119f001781f..64ea807703c9 100644 --- a/drivers/infiniband/hw/ipath/ipath_qp.c +++ b/drivers/infiniband/hw/ipath/ipath_qp.c | |||
@@ -361,7 +361,7 @@ static void ipath_reset_qp(struct ipath_qp *qp) | |||
361 | * @err: the receive completion error to signal if a RWQE is active | 361 | * @err: the receive completion error to signal if a RWQE is active |
362 | * | 362 | * |
363 | * Flushes both send and receive work queues. | 363 | * Flushes both send and receive work queues. |
364 | * QP s_lock should be held and interrupts disabled. | 364 | * The QP s_lock should be held and interrupts disabled. |
365 | */ | 365 | */ |
366 | 366 | ||
367 | void ipath_error_qp(struct ipath_qp *qp, enum ib_wc_status err) | 367 | void ipath_error_qp(struct ipath_qp *qp, enum ib_wc_status err) |
@@ -393,6 +393,8 @@ void ipath_error_qp(struct ipath_qp *qp, enum ib_wc_status err) | |||
393 | wc.port_num = 0; | 393 | wc.port_num = 0; |
394 | if (qp->r_wrid_valid) { | 394 | if (qp->r_wrid_valid) { |
395 | qp->r_wrid_valid = 0; | 395 | qp->r_wrid_valid = 0; |
396 | wc.wr_id = qp->r_wr_id; | ||
397 | wc.opcode = IB_WC_RECV; | ||
396 | wc.status = err; | 398 | wc.status = err; |
397 | ipath_cq_enter(to_icq(qp->ibqp.send_cq), &wc, 1); | 399 | ipath_cq_enter(to_icq(qp->ibqp.send_cq), &wc, 1); |
398 | } | 400 | } |
@@ -972,7 +974,7 @@ bail: | |||
972 | * @wc: the WC responsible for putting the QP in this state | 974 | * @wc: the WC responsible for putting the QP in this state |
973 | * | 975 | * |
974 | * Flushes the send work queue. | 976 | * Flushes the send work queue. |
975 | * The QP s_lock should be held. | 977 | * The QP s_lock should be held and interrupts disabled. |
976 | */ | 978 | */ |
977 | 979 | ||
978 | void ipath_sqerror_qp(struct ipath_qp *qp, struct ib_wc *wc) | 980 | void ipath_sqerror_qp(struct ipath_qp *qp, struct ib_wc *wc) |
@@ -998,12 +1000,12 @@ void ipath_sqerror_qp(struct ipath_qp *qp, struct ib_wc *wc) | |||
998 | wc->status = IB_WC_WR_FLUSH_ERR; | 1000 | wc->status = IB_WC_WR_FLUSH_ERR; |
999 | 1001 | ||
1000 | while (qp->s_last != qp->s_head) { | 1002 | while (qp->s_last != qp->s_head) { |
1003 | wqe = get_swqe_ptr(qp, qp->s_last); | ||
1001 | wc->wr_id = wqe->wr.wr_id; | 1004 | wc->wr_id = wqe->wr.wr_id; |
1002 | wc->opcode = ib_ipath_wc_opcode[wqe->wr.opcode]; | 1005 | wc->opcode = ib_ipath_wc_opcode[wqe->wr.opcode]; |
1003 | ipath_cq_enter(to_icq(qp->ibqp.send_cq), wc, 1); | 1006 | ipath_cq_enter(to_icq(qp->ibqp.send_cq), wc, 1); |
1004 | if (++qp->s_last >= qp->s_size) | 1007 | if (++qp->s_last >= qp->s_size) |
1005 | qp->s_last = 0; | 1008 | qp->s_last = 0; |
1006 | wqe = get_swqe_ptr(qp, qp->s_last); | ||
1007 | } | 1009 | } |
1008 | qp->s_cur = qp->s_tail = qp->s_head; | 1010 | qp->s_cur = qp->s_tail = qp->s_head; |
1009 | qp->state = IB_QPS_SQE; | 1011 | qp->state = IB_QPS_SQE; |
diff --git a/drivers/infiniband/hw/ipath/ipath_rc.c b/drivers/infiniband/hw/ipath/ipath_rc.c index c9c3d7cd2923..2e4d544957af 100644 --- a/drivers/infiniband/hw/ipath/ipath_rc.c +++ b/drivers/infiniband/hw/ipath/ipath_rc.c | |||
@@ -895,8 +895,10 @@ static int do_rc_ack(struct ipath_qp *qp, u32 aeth, u32 psn, int opcode) | |||
895 | wc.opcode = ib_ipath_wc_opcode[wqe->wr.opcode]; | 895 | wc.opcode = ib_ipath_wc_opcode[wqe->wr.opcode]; |
896 | wc.vendor_err = 0; | 896 | wc.vendor_err = 0; |
897 | wc.byte_len = wqe->length; | 897 | wc.byte_len = wqe->length; |
898 | wc.imm_data = 0; | ||
898 | wc.qp = &qp->ibqp; | 899 | wc.qp = &qp->ibqp; |
899 | wc.src_qp = qp->remote_qpn; | 900 | wc.src_qp = qp->remote_qpn; |
901 | wc.wc_flags = 0; | ||
900 | wc.pkey_index = 0; | 902 | wc.pkey_index = 0; |
901 | wc.slid = qp->remote_ah_attr.dlid; | 903 | wc.slid = qp->remote_ah_attr.dlid; |
902 | wc.sl = qp->remote_ah_attr.sl; | 904 | wc.sl = qp->remote_ah_attr.sl; |