IB/{rdmavt, qib, hfi1}: Convert to new completion API
Convert all completions to use the new completion routine that fixes a race between post send and completion where fields from a SWQE can be read after SWQE has been freed. This patch also addresses issues reported in https://marc.info/?l=linux-kernel&m=155656897409107&w=2. The reserved operation path has no need for any barrier. The barrier for the other path is addressed by the smp_load_acquire() barrier. Cc: Andrea Parri <andrea.parri@amarulasolutions.com> Reviewed-by: Michael J. Ruhl <michael.j.ruhl@intel.com> Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com> Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
Este commit está contenido en:

cometido por
Doug Ledford

padre
f56044d686
commit
4a9ceb7dba
@@ -921,20 +921,11 @@ void qib_rc_send_complete(struct rvt_qp *qp, struct ib_header *hdr)
|
||||
rvt_add_retry_timer(qp);
|
||||
|
||||
while (qp->s_last != qp->s_acked) {
|
||||
u32 s_last;
|
||||
|
||||
wqe = rvt_get_swqe_ptr(qp, qp->s_last);
|
||||
if (qib_cmp24(wqe->lpsn, qp->s_sending_psn) >= 0 &&
|
||||
qib_cmp24(qp->s_sending_psn, qp->s_sending_hpsn) <= 0)
|
||||
break;
|
||||
s_last = qp->s_last;
|
||||
if (++s_last >= qp->s_size)
|
||||
s_last = 0;
|
||||
qp->s_last = s_last;
|
||||
/* see post_send() */
|
||||
barrier();
|
||||
rvt_put_qp_swqe(qp, wqe);
|
||||
rvt_qp_swqe_complete(qp,
|
||||
rvt_qp_complete_swqe(qp,
|
||||
wqe,
|
||||
ib_qib_wc_opcode[wqe->wr.opcode],
|
||||
IB_WC_SUCCESS);
|
||||
@@ -972,21 +963,12 @@ static struct rvt_swqe *do_rc_completion(struct rvt_qp *qp,
|
||||
* is finished.
|
||||
*/
|
||||
if (qib_cmp24(wqe->lpsn, qp->s_sending_psn) < 0 ||
|
||||
qib_cmp24(qp->s_sending_psn, qp->s_sending_hpsn) > 0) {
|
||||
u32 s_last;
|
||||
|
||||
rvt_put_qp_swqe(qp, wqe);
|
||||
s_last = qp->s_last;
|
||||
if (++s_last >= qp->s_size)
|
||||
s_last = 0;
|
||||
qp->s_last = s_last;
|
||||
/* see post_send() */
|
||||
barrier();
|
||||
rvt_qp_swqe_complete(qp,
|
||||
qib_cmp24(qp->s_sending_psn, qp->s_sending_hpsn) > 0)
|
||||
rvt_qp_complete_swqe(qp,
|
||||
wqe,
|
||||
ib_qib_wc_opcode[wqe->wr.opcode],
|
||||
IB_WC_SUCCESS);
|
||||
} else
|
||||
else
|
||||
this_cpu_inc(*ibp->rvp.rc_delayed_comp);
|
||||
|
||||
qp->s_retry = qp->s_retry_cnt;
|
||||
|
Referencia en una nueva incidencia
Block a user