Commit ecd465ee authored by Chuck Lever's avatar Chuck Lever Committed by Anna Schumaker

SUNRPC: Move xprt_update_rtt callsite

Since commit 33849792 ("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: default avatarChuck Lever <chuck.lever@oracle.com>
Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
parent 2dd4a012
...@@ -373,6 +373,7 @@ void xprt_wait_for_buffer_space(struct rpc_task *task, rpc_action action); ...@@ -373,6 +373,7 @@ void xprt_wait_for_buffer_space(struct rpc_task *task, rpc_action action);
void xprt_write_space(struct rpc_xprt *xprt); void xprt_write_space(struct rpc_xprt *xprt);
void xprt_adjust_cwnd(struct rpc_xprt *xprt, struct rpc_task *task, int result); void xprt_adjust_cwnd(struct rpc_xprt *xprt, struct rpc_task *task, int result);
struct rpc_rqst * xprt_lookup_rqst(struct rpc_xprt *xprt, __be32 xid); struct rpc_rqst * xprt_lookup_rqst(struct rpc_xprt *xprt, __be32 xid);
void xprt_update_rtt(struct rpc_task *task);
void xprt_complete_rqst(struct rpc_task *task, int copied); void xprt_complete_rqst(struct rpc_task *task, int copied);
void xprt_pin_rqst(struct rpc_rqst *req); void xprt_pin_rqst(struct rpc_rqst *req);
void xprt_unpin_rqst(struct rpc_rqst *req); void xprt_unpin_rqst(struct rpc_rqst *req);
......
...@@ -889,7 +889,13 @@ __must_hold(&req->rq_xprt->recv_lock) ...@@ -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_rqst *req = task->tk_rqstp;
struct rpc_rtt *rtt = task->tk_client->cl_rtt; struct rpc_rtt *rtt = task->tk_client->cl_rtt;
...@@ -902,6 +908,7 @@ static void xprt_update_rtt(struct rpc_task *task) ...@@ -902,6 +908,7 @@ static void xprt_update_rtt(struct rpc_task *task)
rpc_set_timeo(rtt, timer, req->rq_ntrans - 1); rpc_set_timeo(rtt, timer, req->rq_ntrans - 1);
} }
} }
EXPORT_SYMBOL_GPL(xprt_update_rtt);
/** /**
* xprt_complete_rqst - called when reply processing is complete * xprt_complete_rqst - called when reply processing is complete
...@@ -921,8 +928,6 @@ void xprt_complete_rqst(struct rpc_task *task, int copied) ...@@ -921,8 +928,6 @@ void xprt_complete_rqst(struct rpc_task *task, int copied)
xprt->stat.recvs++; xprt->stat.recvs++;
req->rq_rtt = ktime_sub(ktime_get(), req->rq_xtime); 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); list_del_init(&req->rq_list);
req->rq_private_buf.len = copied; req->rq_private_buf.len = copied;
......
...@@ -1060,6 +1060,7 @@ static void xs_udp_data_read_skb(struct rpc_xprt *xprt, ...@@ -1060,6 +1060,7 @@ static void xs_udp_data_read_skb(struct rpc_xprt *xprt,
if (!rovr) if (!rovr)
goto out_unlock; goto out_unlock;
xprt_pin_rqst(rovr); xprt_pin_rqst(rovr);
xprt_update_rtt(rovr->rq_task);
spin_unlock(&xprt->recv_lock); spin_unlock(&xprt->recv_lock);
task = rovr->rq_task; task = rovr->rq_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