| @@ -15,26 +15,25 @@ · 14 unmodified lines |
| 15 | 15 | #undef SVCRDMA_BACKCHANNEL_DEBUG |
| 16 | 16 | |
| 17 | 17 | /** |
| 18 | | − * svc_rdma_handle_bc_reply - Process incoming backchannel reply |
| 19 | | − * @xprt: controlling backchannel transport |
| 20 | | − * @rdma_resp: pointer to incoming transport header |
| 21 | | − * @rcvbuf: XDR buffer into which to decode the reply |
| 18 | + * svc_rdma_handle_bc_reply - Process incoming backchannel Reply |
| 19 | + * @rqstp: resources for handling the Reply |
| 20 | + * @rctxt: Received message |
| 22 | 21 | * |
| 23 | | − * Returns: |
| 24 | | − * %0 if @rcvbuf is filled in, xprt_complete_rqst called, |
| 25 | | − * %-EAGAIN if server should call ->recvfrom again. |
| 26 | 22 | */ |
| 27 | | −int svc_rdma_handle_bc_reply(struct rpc_xprt *xprt, __be32 *rdma_resp, |
| 28 | | − struct xdr_buf *rcvbuf) |
| 23 | +void svc_rdma_handle_bc_reply(struct svc_rqst *rqstp, |
| 24 | + struct svc_rdma_recv_ctxt *rctxt) |
| 29 | 25 | { |
| 26 | + struct svc_xprt *sxprt = rqstp->rq_xprt; |
| 27 | + struct rpc_xprt *xprt = sxprt->xpt_bc_xprt; |
| 30 | 28 | struct rpcrdma_xprt *r_xprt = rpcx_to_rdmax(xprt); |
| 29 | + struct xdr_buf *rcvbuf = &rqstp->rq_arg; |
| 31 | 30 | struct kvec *dst, *src = &rcvbuf->head[0]; |
| 31 | + __be32 *rdma_resp = rctxt->rc_recv_buf; |
| 32 | 32 | struct rpc_rqst *req; |
| 33 | 33 | u32 credits; |
| 34 | 34 | size_t len; |
| 35 | 35 | __be32 xid; |
| 36 | 36 | __be32 *p; |
| 37 | | − int ret; |
| 38 | 37 | |
| 39 | 38 | p = (__be32 *)src->iov_base; |
| 40 | 39 | len = src->iov_len; |
| @@ -49,14 +48,10 @@ int svc_rdma_handle_bc_reply(struct rpc_xprt *xprt, __be32 *rdma_resp, · 8 unmodified lines |
| 49 | 48 | __func__, (int)len, p); |
| 50 | 49 | #endif |
| 51 | 50 | |
| 52 | | − ret = -EAGAIN; |
| 53 | | − if (src->iov_len < 24) |
| 54 | | − goto out_shortreply; |
| 55 | | − |
| 56 | 51 | spin_lock(&xprt->queue_lock); |
| 57 | 52 | req = xprt_lookup_rqst(xprt, xid); |
| 58 | 53 | if (!req) |
| 59 | | − goto out_notfound; |
| 54 | + goto out_unlock; |
| 60 | 55 | |
| 61 | 56 | dst = &req->rq_private_buf.head[0]; |
| 62 | 57 | memcpy(&req->rq_private_buf, &req->rq_rcv_buf, sizeof(struct xdr_buf)); |
| @@ -77,25 +72,12 @@ int svc_rdma_handle_bc_reply(struct rpc_xprt *xprt, __be32 *rdma_resp, · 14 unmodified lines |
| 77 | 72 | spin_unlock(&xprt->transport_lock); |
| 78 | 73 | |
| 79 | 74 | spin_lock(&xprt->queue_lock); |
| 80 | | − ret = 0; |
| 81 | 75 | xprt_complete_rqst(req->rq_task, rcvbuf->len); |
| 82 | 76 | xprt_unpin_rqst(req); |
| 83 | 77 | rcvbuf->len = 0; |
| 84 | 78 | |
| 85 | 79 | out_unlock: |
| 86 | 80 | spin_unlock(&xprt->queue_lock); |
| 87 | | −out: |
| 88 | | − return ret; |
| 89 | | − |
| 90 | | −out_shortreply: |
| 91 | | − dprintk("svcrdma: short bc reply: xprt=%p, len=%zu\n", |
| 92 | | − xprt, src->iov_len); |
| 93 | | − goto out; |
| 94 | | − |
| 95 | | −out_notfound: |
| 96 | | − dprintk("svcrdma: unrecognized bc reply: xprt=%p, xid=%08x\n", |
| 97 | | − xprt, be32_to_cpu(xid)); |
| 98 | | − goto out_unlock; |
| 99 | 81 | } |
| 100 | 82 | |
| 101 | 83 | /* Send a backwards direction RPC call. |