Commit c2ccf64a authored by Chuck Lever's avatar Chuck Lever Committed by J. Bruce Fields

svcrdma: Clean up backchannel send header encoding

Replace C structure-based XDR decoding with pointer arithmetic.
Pointer arithmetic is considered more portable.
Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
parent 647e18e3
...@@ -200,19 +200,20 @@ rpcrdma_bc_send_request(struct svcxprt_rdma *rdma, struct rpc_rqst *rqst) ...@@ -200,19 +200,20 @@ rpcrdma_bc_send_request(struct svcxprt_rdma *rdma, struct rpc_rqst *rqst)
{ {
struct rpc_xprt *xprt = rqst->rq_xprt; struct rpc_xprt *xprt = rqst->rq_xprt;
struct rpcrdma_xprt *r_xprt = rpcx_to_rdmax(xprt); struct rpcrdma_xprt *r_xprt = rpcx_to_rdmax(xprt);
struct rpcrdma_msg *headerp = (struct rpcrdma_msg *)rqst->rq_buffer; __be32 *p;
int rc; int rc;
/* Space in the send buffer for an RPC/RDMA header is reserved /* Space in the send buffer for an RPC/RDMA header is reserved
* via xprt->tsh_size. * via xprt->tsh_size.
*/ */
headerp->rm_xid = rqst->rq_xid; p = rqst->rq_buffer;
headerp->rm_vers = rpcrdma_version; *p++ = rqst->rq_xid;
headerp->rm_credit = cpu_to_be32(r_xprt->rx_buf.rb_bc_max_requests); *p++ = rpcrdma_version;
headerp->rm_type = rdma_msg; *p++ = cpu_to_be32(r_xprt->rx_buf.rb_bc_max_requests);
headerp->rm_body.rm_chunks[0] = xdr_zero; *p++ = rdma_msg;
headerp->rm_body.rm_chunks[1] = xdr_zero; *p++ = xdr_zero;
headerp->rm_body.rm_chunks[2] = xdr_zero; *p++ = xdr_zero;
*p = xdr_zero;
#ifdef SVCRDMA_BACKCHANNEL_DEBUG #ifdef SVCRDMA_BACKCHANNEL_DEBUG
pr_info("%s: %*ph\n", __func__, 64, rqst->rq_buffer); pr_info("%s: %*ph\n", __func__, 64, rqst->rq_buffer);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment