Commit 2c94b8ec authored by Chuck Lever's avatar Chuck Lever Committed by Anna Schumaker

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: default avatarChuck Lever <chuck.lever@oracle.com>
Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
parent 35e77d21
...@@ -1690,7 +1690,7 @@ call_refreshresult(struct rpc_task *task) ...@@ -1690,7 +1690,7 @@ call_refreshresult(struct rpc_task *task)
static void static void
call_allocate(struct rpc_task *task) call_allocate(struct rpc_task *task)
{ {
unsigned int slack = task->tk_rqstp->rq_cred->cr_auth->au_cslack; const struct rpc_auth *auth = task->tk_rqstp->rq_cred->cr_auth;
struct rpc_rqst *req = task->tk_rqstp; struct rpc_rqst *req = task->tk_rqstp;
struct rpc_xprt *xprt = req->rq_xprt; struct rpc_xprt *xprt = req->rq_xprt;
const struct rpc_procinfo *proc = task->tk_msg.rpc_proc; const struct rpc_procinfo *proc = task->tk_msg.rpc_proc;
...@@ -1715,9 +1715,10 @@ call_allocate(struct rpc_task *task) ...@@ -1715,9 +1715,10 @@ call_allocate(struct rpc_task *task)
* and reply headers, and convert both values * and reply headers, and convert both values
* to byte sizes. * to byte sizes.
*/ */
req->rq_callsize = RPC_CALLHDRSIZE + (slack << 1) + proc->p_arglen; req->rq_callsize = RPC_CALLHDRSIZE + (auth->au_cslack << 1) +
proc->p_arglen;
req->rq_callsize <<= 2; req->rq_callsize <<= 2;
req->rq_rcvsize = RPC_REPHDRSIZE + slack + proc->p_replen; req->rq_rcvsize = RPC_REPHDRSIZE + auth->au_rslack + proc->p_replen;
req->rq_rcvsize <<= 2; req->rq_rcvsize <<= 2;
status = xprt->ops->buf_alloc(task); status = xprt->ops->buf_alloc(task);
......
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