Commit 4bdeac8f authored by Trond Myklebust's avatar Trond Myklebust

Increase the minimum RTO timer value to 1/10 second. This is more

in line with what is done for TCP.

Signedness corrections when updating RTT.

Be conservative when calculating RTO. Round up the residues.
parent df9e2288
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
#define RPC_RTO_MAX (60*HZ) #define RPC_RTO_MAX (60*HZ)
#define RPC_RTO_INIT (HZ/5) #define RPC_RTO_INIT (HZ/5)
#define RPC_RTO_MIN (2) #define RPC_RTO_MIN (HZ/10)
void void
rpc_init_rtt(struct rpc_rtt *rt, unsigned long timeo) rpc_init_rtt(struct rpc_rtt *rt, unsigned long timeo)
...@@ -50,7 +50,7 @@ rpc_init_rtt(struct rpc_rtt *rt, unsigned long timeo) ...@@ -50,7 +50,7 @@ rpc_init_rtt(struct rpc_rtt *rt, unsigned long timeo)
void void
rpc_update_rtt(struct rpc_rtt *rt, unsigned timer, long m) rpc_update_rtt(struct rpc_rtt *rt, unsigned timer, long m)
{ {
unsigned long *srtt, *sdrtt; long *srtt, *sdrtt;
if (timer-- == 0) if (timer-- == 0)
return; return;
...@@ -62,14 +62,14 @@ rpc_update_rtt(struct rpc_rtt *rt, unsigned timer, long m) ...@@ -62,14 +62,14 @@ rpc_update_rtt(struct rpc_rtt *rt, unsigned timer, long m)
if (m == 0) if (m == 0)
m = 1L; m = 1L;
srtt = &rt->srtt[timer]; srtt = (long *)&rt->srtt[timer];
m -= *srtt >> 3; m -= *srtt >> 3;
*srtt += m; *srtt += m;
if (m < 0) if (m < 0)
m = -m; m = -m;
sdrtt = &rt->sdrtt[timer]; sdrtt = (long *)&rt->sdrtt[timer];
m -= *sdrtt >> 2; m -= *sdrtt >> 2;
*sdrtt += m; *sdrtt += m;
...@@ -99,7 +99,7 @@ rpc_calc_rto(struct rpc_rtt *rt, unsigned timer) ...@@ -99,7 +99,7 @@ rpc_calc_rto(struct rpc_rtt *rt, unsigned timer)
if (timer-- == 0) if (timer-- == 0)
return rt->timeo; return rt->timeo;
res = (rt->srtt[timer] >> 3) + rt->sdrtt[timer]; res = ((rt->srtt[timer] + 7) >> 3) + rt->sdrtt[timer];
if (res > RPC_RTO_MAX) if (res > RPC_RTO_MAX)
res = RPC_RTO_MAX; res = RPC_RTO_MAX;
......
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