Skip to content

Commit

Permalink
xprtrdma: Eliminate INLINE_THRESHOLD macros
Browse files Browse the repository at this point in the history
Clean up: r_xprt is already available everywhere these macros are
invoked, so just dereference that directly.

RPCRDMA_INLINE_PAD_VALUE is no longer used, so it can simply be
removed.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
  • Loading branch information
Chuck Lever authored and Anna Schumaker committed Sep 19, 2016
1 parent 04fa2c6 commit eb342e9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 15 deletions.
4 changes: 2 additions & 2 deletions net/sunrpc/xprtrdma/backchannel.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ static int rpcrdma_bc_setup_rqst(struct rpcrdma_xprt *r_xprt,
return PTR_ERR(req);
req->rl_backchannel = true;

size = RPCRDMA_INLINE_WRITE_THRESHOLD(rqst);
size = r_xprt->rx_data.inline_wsize;
rb = rpcrdma_alloc_regbuf(ia, size, GFP_KERNEL);
if (IS_ERR(rb))
goto out_fail;
req->rl_rdmabuf = rb;

size += RPCRDMA_INLINE_READ_THRESHOLD(rqst);
size += r_xprt->rx_data.inline_rsize;
rb = rpcrdma_alloc_regbuf(ia, size, GFP_KERNEL);
if (IS_ERR(rb))
goto out_fail;
Expand Down
2 changes: 1 addition & 1 deletion net/sunrpc/xprtrdma/rpc_rdma.c
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ rpcrdma_marshal_req(struct rpc_rqst *rqst)
goto out_unmap;
hdrlen = (unsigned char *)iptr - (unsigned char *)headerp;

if (hdrlen + rpclen > RPCRDMA_INLINE_WRITE_THRESHOLD(rqst))
if (hdrlen + rpclen > r_xprt->rx_data.inline_wsize)
goto out_overflow;

dprintk("RPC: %5u %s: %s/%s: hdrlen %zd rpclen %zd\n",
Expand Down
6 changes: 3 additions & 3 deletions net/sunrpc/xprtrdma/transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ xprt_rdma_allocate(struct rpc_task *task, size_t size)
return req->rl_sendbuf->rg_base;

out_rdmabuf:
min_size = RPCRDMA_INLINE_WRITE_THRESHOLD(task->tk_rqstp);
min_size = r_xprt->rx_data.inline_wsize;
rb = rpcrdma_alloc_regbuf(&r_xprt->rx_ia, min_size, flags);
if (IS_ERR(rb))
goto out_fail;
Expand All @@ -541,8 +541,8 @@ xprt_rdma_allocate(struct rpc_task *task, size_t size)
* reply will be large, but slush is provided here to allow
* flexibility when marshaling.
*/
min_size = RPCRDMA_INLINE_READ_THRESHOLD(task->tk_rqstp);
min_size += RPCRDMA_INLINE_WRITE_THRESHOLD(task->tk_rqstp);
min_size = r_xprt->rx_data.inline_rsize;
min_size += r_xprt->rx_data.inline_wsize;
if (size < min_size)
size = min_size;

Expand Down
9 changes: 0 additions & 9 deletions net/sunrpc/xprtrdma/xprt_rdma.h
Original file line number Diff line number Diff line change
Expand Up @@ -356,15 +356,6 @@ struct rpcrdma_create_data_internal {
unsigned int padding; /* non-rdma write header padding */
};

#define RPCRDMA_INLINE_READ_THRESHOLD(rq) \
(rpcx_to_rdmad(rq->rq_xprt).inline_rsize)

#define RPCRDMA_INLINE_WRITE_THRESHOLD(rq)\
(rpcx_to_rdmad(rq->rq_xprt).inline_wsize)

#define RPCRDMA_INLINE_PAD_VALUE(rq)\
rpcx_to_rdmad(rq->rq_xprt).padding

/*
* Statistics for RPCRDMA
*/
Expand Down

0 comments on commit eb342e9

Please sign in to comment.