On Fri, Oct 06, 2017 at 08:28:51AM -0400, Bernard Metzler wrote: > Signed-off-by: Bernard Metzler <bmt@xxxxxxxxxxxxxx> > --- > drivers/infiniband/sw/siw/siw_cq.c | 164 +++++++++++++++++++++++++++++++++++++ > 1 file changed, 164 insertions(+) > create mode 100644 drivers/infiniband/sw/siw/siw_cq.c > > diff --git a/drivers/infiniband/sw/siw/siw_cq.c b/drivers/infiniband/sw/siw/siw_cq.c > new file mode 100644 > index 000000000000..0cd6e010e7a7 > --- /dev/null > +++ b/drivers/infiniband/sw/siw/siw_cq.c > +/* > + * Reap one CQE from the CQ. > + * > + * Caller must hold qp read lock Why is this a mandate? > + * TODO: Provide routine which can read more than one CQE > + */ > +int siw_reap_cqe(struct siw_cq *cq, struct ib_wc *ofa_wc) > +{ > + struct siw_cqe *cqe; > + unsigned long flags; > + > + spin_lock_irqsave(&cq->lock, flags); > + > + cqe = &cq->queue[cq->cq_get % cq->num_cqe]; > + if (cqe->flags & SIW_WQE_VALID) { > + siw_wc_siw2ofa(cqe, ofa_wc); > + > + if (cq->kernel_verbs) { > + dprint(DBG_WR, > + " QP%d, CQ%d: Reap WQE type: %d at idx %d\n", > + QP_ID((struct siw_qp *)cqe->qp), OBJ_ID(cq), > + cqe->opcode, cq->cq_get % cq->num_cqe); > + siw_qp_put(cqe->qp); Where do we do the siw_qp_get()? -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html