diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2019-02-11 11:25:41 -0500 |
---|---|---|
committer | Anna Schumaker <Anna.Schumaker@Netapp.com> | 2019-02-14 11:58:44 -0500 |
commit | 2c94b8eca1a26cd46010d6e73a23da5f2e93a19d (patch) | |
tree | cd90799dc57ddabf330e8540ff939743292162c7 | |
parent | 35e77d21baa04b554bf3dc9a08dfa7e569286e51 (diff) |
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>
-rw-r--r-- | net/sunrpc/clnt.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index 99bfeb17367c..241e8423fd0c 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c | |||
@@ -1690,7 +1690,7 @@ call_refreshresult(struct rpc_task *task) | |||
1690 | static void | 1690 | static void |
1691 | call_allocate(struct rpc_task *task) | 1691 | call_allocate(struct rpc_task *task) |
1692 | { | 1692 | { |
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; |
1694 | struct rpc_rqst *req = task->tk_rqstp; | 1694 | struct rpc_rqst *req = task->tk_rqstp; |
1695 | struct rpc_xprt *xprt = req->rq_xprt; | 1695 | struct rpc_xprt *xprt = req->rq_xprt; |
1696 | const struct rpc_procinfo *proc = task->tk_msg.rpc_proc; | 1696 | const struct rpc_procinfo *proc = task->tk_msg.rpc_proc; |
@@ -1715,9 +1715,10 @@ call_allocate(struct rpc_task *task) | |||
1715 | * and reply headers, and convert both values | 1715 | * and reply headers, and convert both values |
1716 | * to byte sizes. | 1716 | * to byte sizes. |
1717 | */ | 1717 | */ |
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; | ||
1719 | req->rq_callsize <<= 2; | 1720 | 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; |
1721 | req->rq_rcvsize <<= 2; | 1722 | req->rq_rcvsize <<= 2; |
1722 | 1723 | ||
1723 | status = xprt->ops->buf_alloc(task); | 1724 | status = xprt->ops->buf_alloc(task); |