| @@ -15,26 +15,25 @@ · 14 unmodified lines |
| 15 | #undef SVCRDMA_BACKCHANNEL_DEBUG | 15 | #undef SVCRDMA_BACKCHANNEL_DEBUG |
| 16 | | 16 | |
| 17 | /** | 17 | /** |
| 18 | * svc_rdma_handle_bc_reply - Process incoming backchannel reply | 18 | * svc_rdma_handle_bc_reply - Process incoming backchannel Reply |
| 19 | * @xprt: controlling backchannel transport | 19 | * @rqstp: resources for handling the Reply |
| 20 | * @rdma_resp: pointer to incoming transport header | 20 | * @rctxt: Received message |
| 21 | * @rcvbuf: XDR buffer into which to decode the reply | | |
| 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, | 23 | void svc_rdma_handle_bc_reply(struct svc_rqst *rqstp, |
| 28 | struct xdr_buf *rcvbuf) | 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 | struct rpcrdma_xprt *r_xprt = rpcx_to_rdmax(xprt); | 28 | struct rpcrdma_xprt *r_xprt = rpcx_to_rdmax(xprt); |
| | 29 | struct xdr_buf *rcvbuf = &rqstp->rq_arg; |
| 31 | struct kvec *dst, *src = &rcvbuf->head[0]; | 30 | struct kvec *dst, *src = &rcvbuf->head[0]; |
| | 31 | __be32 *rdma_resp = rctxt->rc_recv_buf; |
| 32 | struct rpc_rqst *req; | 32 | struct rpc_rqst *req; |
| 33 | u32 credits; | 33 | u32 credits; |
| 34 | size_t len; | 34 | size_t len; |
| 35 | __be32 xid; | 35 | __be32 xid; |
| 36 | __be32 *p; | 36 | __be32 *p; |
| 37 | int ret; | | |
| 38 | | 37 | |
| 39 | p = (__be32 *)src->iov_base; | 38 | p = (__be32 *)src->iov_base; |
| 40 | len = src->iov_len; | 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 | __func__, (int)len, p); | 48 | __func__, (int)len, p); |
| 50 | #endif | 49 | #endif |
| 51 | | 50 | |
| 52 | ret = -EAGAIN; | | |
| 53 | if (src->iov_len < 24) | | |
| 54 | goto out_shortreply; | | |
| 55 | | | |
| 56 | spin_lock(&xprt->queue_lock); | 51 | spin_lock(&xprt->queue_lock); |
| 57 | req = xprt_lookup_rqst(xprt, xid); | 52 | req = xprt_lookup_rqst(xprt, xid); |
| 58 | if (!req) | 53 | if (!req) |
| 59 | goto out_notfound; | 54 | goto out_unlock; |
| 60 | | 55 | |
| 61 | dst = &req->rq_private_buf.head[0]; | 56 | dst = &req->rq_private_buf.head[0]; |
| 62 | memcpy(&req->rq_private_buf, &req->rq_rcv_buf, sizeof(struct xdr_buf)); | 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 | spin_unlock(&xprt->transport_lock); | 72 | spin_unlock(&xprt->transport_lock); |
| 78 | | 73 | |
| 79 | spin_lock(&xprt->queue_lock); | 74 | spin_lock(&xprt->queue_lock); |
| 80 | ret = 0; | | |
| 81 | xprt_complete_rqst(req->rq_task, rcvbuf->len); | 75 | xprt_complete_rqst(req->rq_task, rcvbuf->len); |
| 82 | xprt_unpin_rqst(req); | 76 | xprt_unpin_rqst(req); |
| 83 | rcvbuf->len = 0; | 77 | rcvbuf->len = 0; |
| 84 | | 78 | |
| 85 | out_unlock: | 79 | out_unlock: |
| 86 | spin_unlock(&xprt->queue_lock); | 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 | /* Send a backwards direction RPC call. | 83 | /* Send a backwards direction RPC call. |