diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2018-03-05 15:12:57 -0500 |
---|---|---|
committer | Anna Schumaker <Anna.Schumaker@Netapp.com> | 2018-04-10 16:06:22 -0400 |
commit | ecd465ee88bb6648c06c82b1abae6ec28cf5fccb (patch) | |
tree | 11fb1c45bb22edd5b772f804d4a3d940da3659bc /net | |
parent | 2dd4a012d9e73c423a8c48d7e0f2e427caecce3d (diff) | |
download | linux-rpi3-ecd465ee88bb6648c06c82b1abae6ec28cf5fccb.tar.gz linux-rpi3-ecd465ee88bb6648c06c82b1abae6ec28cf5fccb.tar.bz2 linux-rpi3-ecd465ee88bb6648c06c82b1abae6ec28cf5fccb.zip |
SUNRPC: Move xprt_update_rtt callsite
Since commit 33849792cbcd ("xprtrdma: Detect unreachable NFS/RDMA
servers more reliably"), the xprtrdma transport now has a ->timer
callout. But xprtrdma does not need to compute RTT data, only UDP
needs that. Move the xprt_update_rtt call into the UDP transport
implementation.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/sunrpc/xprt.c | 11 | ||||
-rw-r--r-- | net/sunrpc/xprtsock.c | 1 |
2 files changed, 9 insertions, 3 deletions
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c index 8f0ad4f268da..13fbb4849188 100644 --- a/net/sunrpc/xprt.c +++ b/net/sunrpc/xprt.c @@ -889,7 +889,13 @@ __must_hold(&req->rq_xprt->recv_lock) } } -static void xprt_update_rtt(struct rpc_task *task) +/** + * xprt_update_rtt - Update RPC RTT statistics + * @task: RPC request that recently completed + * + * Caller holds xprt->recv_lock. + */ +void xprt_update_rtt(struct rpc_task *task) { struct rpc_rqst *req = task->tk_rqstp; struct rpc_rtt *rtt = task->tk_client->cl_rtt; @@ -902,6 +908,7 @@ static void xprt_update_rtt(struct rpc_task *task) rpc_set_timeo(rtt, timer, req->rq_ntrans - 1); } } +EXPORT_SYMBOL_GPL(xprt_update_rtt); /** * xprt_complete_rqst - called when reply processing is complete @@ -921,8 +928,6 @@ void xprt_complete_rqst(struct rpc_task *task, int copied) xprt->stat.recvs++; req->rq_rtt = ktime_sub(ktime_get(), req->rq_xtime); - if (xprt->ops->timer != NULL) - xprt_update_rtt(task); list_del_init(&req->rq_list); req->rq_private_buf.len = copied; diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c index a6b8c1f8f92a..61df77f41304 100644 --- a/net/sunrpc/xprtsock.c +++ b/net/sunrpc/xprtsock.c @@ -1060,6 +1060,7 @@ static void xs_udp_data_read_skb(struct rpc_xprt *xprt, if (!rovr) goto out_unlock; xprt_pin_rqst(rovr); + xprt_update_rtt(rovr->rq_task); spin_unlock(&xprt->recv_lock); task = rovr->rq_task; |