Commit a8b56f29 authored by Ralph Campbell's avatar Ralph Campbell Committed by Roland Dreier

IB/ipath: Fix RDMA write with immediate copy of last packet

When the last packet of a RDMA write with immediate is received, the
next receive work queue entry ID should be used to generate a completion
entry. The code was incorrectly resetting part of the state used to copy
the last packet.
Signed-off-by: default avatarRalph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
parent 332edc2f
...@@ -156,7 +156,7 @@ bail: ...@@ -156,7 +156,7 @@ bail:
/** /**
* ipath_get_rwqe - copy the next RWQE into the QP's RWQE * ipath_get_rwqe - copy the next RWQE into the QP's RWQE
* @qp: the QP * @qp: the QP
* @wr_id_only: update wr_id only, not SGEs * @wr_id_only: update qp->r_wr_id only, not qp->r_sge
* *
* Return 0 if no RWQE is available, otherwise return 1. * Return 0 if no RWQE is available, otherwise return 1.
* *
...@@ -173,8 +173,6 @@ int ipath_get_rwqe(struct ipath_qp *qp, int wr_id_only) ...@@ -173,8 +173,6 @@ int ipath_get_rwqe(struct ipath_qp *qp, int wr_id_only)
u32 tail; u32 tail;
int ret; int ret;
qp->r_sge.sg_list = qp->r_sg_list;
if (qp->ibqp.srq) { if (qp->ibqp.srq) {
srq = to_isrq(qp->ibqp.srq); srq = to_isrq(qp->ibqp.srq);
handler = srq->ibsrq.event_handler; handler = srq->ibsrq.event_handler;
...@@ -206,8 +204,10 @@ int ipath_get_rwqe(struct ipath_qp *qp, int wr_id_only) ...@@ -206,8 +204,10 @@ int ipath_get_rwqe(struct ipath_qp *qp, int wr_id_only)
wqe = get_rwqe_ptr(rq, tail); wqe = get_rwqe_ptr(rq, tail);
if (++tail >= rq->size) if (++tail >= rq->size)
tail = 0; tail = 0;
} while (!wr_id_only && !ipath_init_sge(qp, wqe, &qp->r_len, if (wr_id_only)
&qp->r_sge)); break;
qp->r_sge.sg_list = qp->r_sg_list;
} while (!ipath_init_sge(qp, wqe, &qp->r_len, &qp->r_sge));
qp->r_wr_id = wqe->wr_id; qp->r_wr_id = wqe->wr_id;
wq->tail = tail; wq->tail = tail;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment