summaryrefslogtreecommitdiff
path: root/sys/netinet
diff options
context:
space:
mode:
authorDavid Greenman <dg@FreeBSD.org>1995-07-23 05:04:31 +0000
committerDavid Greenman <dg@FreeBSD.org>1995-07-23 05:04:31 +0000
commit57e3c392b5ebd2d62b49bc6554e7d6e3d9915807 (patch)
treeb4964b70beb69307a8e50f30ffba120a6be91add /sys/netinet
parentd690cfb3d8d7927993ba9b6a4e35c473cd622eb6 (diff)
Notes
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/tcp_subr.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c
index 381824de0eb5..09b148cc5b08 100644
--- a/sys/netinet/tcp_subr.c
+++ b/sys/netinet/tcp_subr.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)tcp_subr.c 8.1 (Berkeley) 6/10/93
- * $Id: tcp_subr.c,v 1.10 1995/04/09 01:29:26 davidg Exp $
+ * $Id: tcp_subr.c,v 1.11 1995/05/30 08:09:58 rgrimes Exp $
*/
#include <sys/param.h>
@@ -303,18 +303,17 @@ tcp_close(tp)
register struct rtentry *rt;
/*
- * If we sent enough data to get some meaningful characteristics,
- * save them in the routing entry. 'Enough' is arbitrarily
- * defined as the sendpipesize (default 4K) * 16. This would
- * give us 16 rtt samples assuming we only get one sample per
- * window (the usual case on a long haul net). 16 samples is
- * enough for the srtt filter to converge to within 5% of the correct
- * value; fewer samples and we could save a very bogus rtt.
+ * If we got enough samples through the srtt filter,
+ * save the rtt and rttvar in the routing entry.
+ * 'Enough' is arbitrarily defined as the 16 samples.
+ * 16 samples is enough for the srtt filter to converge
+ * to within 5% of the correct value; fewer samples and
+ * we could save a very bogus rtt.
*
* Don't update the default route's characteristics and don't
* update anything that the user "locked".
*/
- if (SEQ_LT(tp->iss + so->so_snd.sb_hiwat * 16, tp->snd_max) &&
+ if (tp->t_rttupdated >= 16 &&
(rt = inp->inp_route.ro_rt) &&
((struct sockaddr_in *)rt_key(rt))->sin_addr.s_addr != INADDR_ANY) {
register u_long i = 0;
@@ -333,6 +332,7 @@ tcp_close(tp)
(rt->rt_rmx.rmx_rtt + i) / 2;
else
rt->rt_rmx.rmx_rtt = i;
+ tcpstat.tcps_cachedrtt++;
}
if ((rt->rt_rmx.rmx_locks & RTV_RTTVAR) == 0) {
i = tp->t_rttvar *
@@ -342,6 +342,7 @@ tcp_close(tp)
(rt->rt_rmx.rmx_rttvar + i) / 2;
else
rt->rt_rmx.rmx_rttvar = i;
+ tcpstat.tcps_cachedrttvar++;
}
/*
* update the pipelimit (ssthresh) if it has been updated
@@ -366,6 +367,7 @@ tcp_close(tp)
(rt->rt_rmx.rmx_ssthresh + i) / 2;
else
rt->rt_rmx.rmx_ssthresh = i;
+ tcpstat.tcps_cachedssthresh++;
}
}
#endif /* RTV_RTT */