Skip to content

Commit eb342e9

Browse files
chuckleveramschuma-ntap
authored andcommitted
xprtrdma: Eliminate INLINE_THRESHOLD macros
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>
1 parent 04fa2c6 commit eb342e9

File tree

4 files changed

+6
-15
lines changed

4 files changed

+6
-15
lines changed

net/sunrpc/xprtrdma/backchannel.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ static int rpcrdma_bc_setup_rqst(struct rpcrdma_xprt *r_xprt,
4646
return PTR_ERR(req);
4747
req->rl_backchannel = true;
4848

49-
size = RPCRDMA_INLINE_WRITE_THRESHOLD(rqst);
49+
size = r_xprt->rx_data.inline_wsize;
5050
rb = rpcrdma_alloc_regbuf(ia, size, GFP_KERNEL);
5151
if (IS_ERR(rb))
5252
goto out_fail;
5353
req->rl_rdmabuf = rb;
5454

55-
size += RPCRDMA_INLINE_READ_THRESHOLD(rqst);
55+
size += r_xprt->rx_data.inline_rsize;
5656
rb = rpcrdma_alloc_regbuf(ia, size, GFP_KERNEL);
5757
if (IS_ERR(rb))
5858
goto out_fail;

net/sunrpc/xprtrdma/rpc_rdma.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@ rpcrdma_marshal_req(struct rpc_rqst *rqst)
673673
goto out_unmap;
674674
hdrlen = (unsigned char *)iptr - (unsigned char *)headerp;
675675

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

679679
dprintk("RPC: %5u %s: %s/%s: hdrlen %zd rpclen %zd\n",

net/sunrpc/xprtrdma/transport.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ xprt_rdma_allocate(struct rpc_task *task, size_t size)
518518
return req->rl_sendbuf->rg_base;
519519

520520
out_rdmabuf:
521-
min_size = RPCRDMA_INLINE_WRITE_THRESHOLD(task->tk_rqstp);
521+
min_size = r_xprt->rx_data.inline_wsize;
522522
rb = rpcrdma_alloc_regbuf(&r_xprt->rx_ia, min_size, flags);
523523
if (IS_ERR(rb))
524524
goto out_fail;
@@ -541,8 +541,8 @@ xprt_rdma_allocate(struct rpc_task *task, size_t size)
541541
* reply will be large, but slush is provided here to allow
542542
* flexibility when marshaling.
543543
*/
544-
min_size = RPCRDMA_INLINE_READ_THRESHOLD(task->tk_rqstp);
545-
min_size += RPCRDMA_INLINE_WRITE_THRESHOLD(task->tk_rqstp);
544+
min_size = r_xprt->rx_data.inline_rsize;
545+
min_size += r_xprt->rx_data.inline_wsize;
546546
if (size < min_size)
547547
size = min_size;
548548

net/sunrpc/xprtrdma/xprt_rdma.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -356,15 +356,6 @@ struct rpcrdma_create_data_internal {
356356
unsigned int padding; /* non-rdma write header padding */
357357
};
358358

359-
#define RPCRDMA_INLINE_READ_THRESHOLD(rq) \
360-
(rpcx_to_rdmad(rq->rq_xprt).inline_rsize)
361-
362-
#define RPCRDMA_INLINE_WRITE_THRESHOLD(rq)\
363-
(rpcx_to_rdmad(rq->rq_xprt).inline_wsize)
364-
365-
#define RPCRDMA_INLINE_PAD_VALUE(rq)\
366-
rpcx_to_rdmad(rq->rq_xprt).padding
367-
368359
/*
369360
* Statistics for RPCRDMA
370361
*/

0 commit comments

Comments
 (0)