summaryrefslogtreecommitdiff
path: root/include/linux/sunrpc/timer.h
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@fys.uio.no>2003-10-07 07:30:00 -0400
committerTrond Myklebust <trond.myklebust@fys.uio.no>2003-10-07 07:30:00 -0400
commit5d371cbc375aca3d47b839de5b90db5a60dd2833 (patch)
tree6c9b8080fc65032edc3a855e46fdb3d70926a915 /include/linux/sunrpc/timer.h
parent9b80ac47e771874c3a87f5be2b044415cd14c4a4 (diff)
UDP round trip timer fix. Modify Karn's algorithm so that
we inherit timeouts from previous requests. This means that we lengthen the window of time during which we accept updates to the RTO estimate if we see an update. Scheme proposed by Brian Mancuso, but it is standard for TCP congestion control implementations.
Diffstat (limited to 'include/linux/sunrpc/timer.h')
-rw-r--r--include/linux/sunrpc/timer.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/linux/sunrpc/timer.h b/include/linux/sunrpc/timer.h
index f2f2ffc4f2cd..1d0d3a0d64ec 100644
--- a/include/linux/sunrpc/timer.h
+++ b/include/linux/sunrpc/timer.h
@@ -15,6 +15,7 @@ struct rpc_rtt {
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 */
};
@@ -22,4 +23,18 @@ extern void rpc_init_rtt(struct rpc_rtt *rt, unsigned long timeo);
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 */