Skip to content

Commit 2c94b8e

Browse files
chuckleveramschuma-ntap
authored andcommitted
SUNRPC: Use au_rslack when computing reply buffer size
au_rslack is significantly smaller than (au_cslack << 2). Using that value results in smaller receive buffers. In some cases this eliminates an extra segment in Reply chunks (RPC/RDMA). Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
1 parent 35e77d2 commit 2c94b8e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

net/sunrpc/clnt.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1690,7 +1690,7 @@ call_refreshresult(struct rpc_task *task)
16901690
static void
16911691
call_allocate(struct rpc_task *task)
16921692
{
1693-
unsigned int slack = task->tk_rqstp->rq_cred->cr_auth->au_cslack;
1693+
const struct rpc_auth *auth = task->tk_rqstp->rq_cred->cr_auth;
16941694
struct rpc_rqst *req = task->tk_rqstp;
16951695
struct rpc_xprt *xprt = req->rq_xprt;
16961696
const struct rpc_procinfo *proc = task->tk_msg.rpc_proc;
@@ -1715,9 +1715,10 @@ call_allocate(struct rpc_task *task)
17151715
* and reply headers, and convert both values
17161716
* to byte sizes.
17171717
*/
1718-
req->rq_callsize = RPC_CALLHDRSIZE + (slack << 1) + proc->p_arglen;
1718+
req->rq_callsize = RPC_CALLHDRSIZE + (auth->au_cslack << 1) +
1719+
proc->p_arglen;
17191720
req->rq_callsize <<= 2;
1720-
req->rq_rcvsize = RPC_REPHDRSIZE + slack + proc->p_replen;
1721+
req->rq_rcvsize = RPC_REPHDRSIZE + auth->au_rslack + proc->p_replen;
17211722
req->rq_rcvsize <<= 2;
17221723

17231724
status = xprt->ops->buf_alloc(task);

0 commit comments

Comments
 (0)