Skip to content

Commit

Permalink
IB/ipath: Fix RDMA write with immediate copy of last packet
Browse files Browse the repository at this point in the history
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: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
  • Loading branch information
Ralph Campbell authored and Roland Dreier committed Oct 27, 2008
1 parent 332edc2 commit a8b56f2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions drivers/infiniband/hw/ipath/ipath_ruc.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ int ipath_init_sge(struct ipath_qp *qp, struct ipath_rwqe *wqe,
/**
* ipath_get_rwqe - copy the next RWQE into the QP's RWQE
* @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.
*
Expand All @@ -173,8 +173,6 @@ int ipath_get_rwqe(struct ipath_qp *qp, int wr_id_only)
u32 tail;
int ret;

qp->r_sge.sg_list = qp->r_sg_list;

if (qp->ibqp.srq) {
srq = to_isrq(qp->ibqp.srq);
handler = srq->ibsrq.event_handler;
Expand Down Expand Up @@ -206,8 +204,10 @@ int ipath_get_rwqe(struct ipath_qp *qp, int wr_id_only)
wqe = get_rwqe_ptr(rq, tail);
if (++tail >= rq->size)
tail = 0;
} while (!wr_id_only && !ipath_init_sge(qp, wqe, &qp->r_len,
&qp->r_sge));
if (wr_id_only)
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;
wq->tail = tail;

Expand Down

0 comments on commit a8b56f2

Please sign in to comment.