unsigned long timeo; /* default timeout value */
unsigned long srtt[5]; /* smoothed round trip time << 3 */
unsigned long sdrtt[5]; /* smoothed medium deviation of RTT */
+ int ntimeouts[5]; /* Number of timeouts for the last request */
};
extern void rpc_update_rtt(struct rpc_rtt *rt, unsigned timer, long m);
extern unsigned long rpc_calc_rto(struct rpc_rtt *rt, unsigned timer);
+static inline void rpc_set_timeo(struct rpc_rtt *rt, int timer, int ntimeo)
+{
+ if (!timer)
+ return;
+ rt->ntimeouts[timer-1] = ntimeo;
+}
+
+static inline int rpc_ntimeo(struct rpc_rtt *rt, int timer)
+{
+ if (!timer)
+ return 0;
+ return rt->ntimeouts[timer-1];
+}
+
#endif /* _LINUX_SUNRPC_TIMER_H */
/* Adjust congestion window */
if (!xprt->nocong) {
+ unsigned timer = task->tk_msg.rpc_proc->p_timer;
xprt_adjust_cwnd(xprt, copied);
__xprt_put_cong(xprt, req);
- if (req->rq_ntrans == 1) {
- unsigned timer =
- task->tk_msg.rpc_proc->p_timer;
- if (timer)
+ if (timer) {
+ if (req->rq_ntrans == 1)
rpc_update_rtt(&clnt->cl_rtt, timer,
(long)jiffies - req->rq_xtime);
+ rpc_set_timeo(&clnt->cl_rtt, timer, req->rq_ntrans - 1);
}
}
/* Set the task's receive timeout value */
spin_lock_bh(&xprt->sock_lock);
if (!xprt->nocong) {
- task->tk_timeout = rpc_calc_rto(&clnt->cl_rtt,
- task->tk_msg.rpc_proc->p_timer);
+ int timer = task->tk_msg.rpc_proc->p_timer;
+ task->tk_timeout = rpc_calc_rto(&clnt->cl_rtt, timer);
+ task->tk_timeout <<= rpc_ntimeo(&clnt->cl_rtt, timer);
task->tk_timeout <<= clnt->cl_timeout.to_retries
- req->rq_timeout.to_retries;
if (task->tk_timeout > req->rq_timeout.to_maxval)