mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-12 00:38:55 +00:00
svcrdma: Clean up process_context()
Be sure the completed ctxt is put in every path. The xprt enqueue can take a while, so put the completed ctxt back in circulation _before_ enqueuing the xprt. Remove/disable debugging. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Acked-by: Bruce Fields <bfields@fieldses.org> Signed-off-by: Doug Ledford <dledford@redhat.com>
This commit is contained in:
parent
3d61677c4d
commit
ced4ac0c4f
@ -386,46 +386,44 @@ static void rq_cq_reap(struct svcxprt_rdma *xprt)
|
|||||||
static void process_context(struct svcxprt_rdma *xprt,
|
static void process_context(struct svcxprt_rdma *xprt,
|
||||||
struct svc_rdma_op_ctxt *ctxt)
|
struct svc_rdma_op_ctxt *ctxt)
|
||||||
{
|
{
|
||||||
|
struct svc_rdma_op_ctxt *read_hdr;
|
||||||
|
int free_pages = 0;
|
||||||
|
|
||||||
svc_rdma_unmap_dma(ctxt);
|
svc_rdma_unmap_dma(ctxt);
|
||||||
|
|
||||||
switch (ctxt->wr_op) {
|
switch (ctxt->wr_op) {
|
||||||
case IB_WR_SEND:
|
case IB_WR_SEND:
|
||||||
if (ctxt->frmr)
|
free_pages = 1;
|
||||||
pr_err("svcrdma: SEND: ctxt->frmr != NULL\n");
|
|
||||||
svc_rdma_put_context(ctxt, 1);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case IB_WR_RDMA_WRITE:
|
case IB_WR_RDMA_WRITE:
|
||||||
if (ctxt->frmr)
|
|
||||||
pr_err("svcrdma: WRITE: ctxt->frmr != NULL\n");
|
|
||||||
svc_rdma_put_context(ctxt, 0);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case IB_WR_RDMA_READ:
|
case IB_WR_RDMA_READ:
|
||||||
case IB_WR_RDMA_READ_WITH_INV:
|
case IB_WR_RDMA_READ_WITH_INV:
|
||||||
svc_rdma_put_frmr(xprt, ctxt->frmr);
|
svc_rdma_put_frmr(xprt, ctxt->frmr);
|
||||||
if (test_bit(RDMACTXT_F_LAST_CTXT, &ctxt->flags)) {
|
|
||||||
struct svc_rdma_op_ctxt *read_hdr = ctxt->read_hdr;
|
if (!test_bit(RDMACTXT_F_LAST_CTXT, &ctxt->flags))
|
||||||
if (read_hdr) {
|
break;
|
||||||
spin_lock_bh(&xprt->sc_rq_dto_lock);
|
|
||||||
set_bit(XPT_DATA, &xprt->sc_xprt.xpt_flags);
|
read_hdr = ctxt->read_hdr;
|
||||||
list_add_tail(&read_hdr->dto_q,
|
|
||||||
&xprt->sc_read_complete_q);
|
|
||||||
spin_unlock_bh(&xprt->sc_rq_dto_lock);
|
|
||||||
} else {
|
|
||||||
pr_err("svcrdma: ctxt->read_hdr == NULL\n");
|
|
||||||
}
|
|
||||||
svc_xprt_enqueue(&xprt->sc_xprt);
|
|
||||||
}
|
|
||||||
svc_rdma_put_context(ctxt, 0);
|
svc_rdma_put_context(ctxt, 0);
|
||||||
break;
|
|
||||||
|
spin_lock_bh(&xprt->sc_rq_dto_lock);
|
||||||
|
set_bit(XPT_DATA, &xprt->sc_xprt.xpt_flags);
|
||||||
|
list_add_tail(&read_hdr->dto_q,
|
||||||
|
&xprt->sc_read_complete_q);
|
||||||
|
spin_unlock_bh(&xprt->sc_rq_dto_lock);
|
||||||
|
svc_xprt_enqueue(&xprt->sc_xprt);
|
||||||
|
return;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
printk(KERN_ERR "svcrdma: unexpected completion type, "
|
dprintk("svcrdma: unexpected completion opcode=%d\n",
|
||||||
"opcode=%d\n",
|
ctxt->wr_op);
|
||||||
ctxt->wr_op);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
svc_rdma_put_context(ctxt, free_pages);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user