diff options
author | andre <andre@FreeBSD.org> | 2006-02-16 19:38:07 +0000 |
---|---|---|
committer | andre <andre@FreeBSD.org> | 2006-02-16 19:38:07 +0000 |
commit | e83c574f873ca62a647c1d708a65c507c50a3b52 (patch) | |
tree | 50085f7cd5f6a0c2d314a7e5e7a2100f076b6b44 /sys/netinet/tcp_timewait.c | |
parent | ae2214aeaef3707cbd8f1f7a2791b518a8ccef30 (diff) | |
download | FreeBSD-src-e83c574f873ca62a647c1d708a65c507c50a3b52.zip FreeBSD-src-e83c574f873ca62a647c1d708a65c507c50a3b52.tar.gz |
Have TCP Inflight disable itself if the RTT is below a certain
threshold. Inflight doesn't make sense on a LAN as it has
trouble figuring out the maximal bandwidth because of the coarse
tick granularity.
The sysctl net.inet.tcp.inflight.rttthresh specifies the threshold
in milliseconds below which inflight will disengage. It defaults
to 10ms.
Tested by: Joao Barros <joao.barros-at-gmail.com>,
Rich Murphey <rich-at-whiteoaklabs.com>
Sponsored by: TCP/IP Optimization Fundraise 2005
Diffstat (limited to 'sys/netinet/tcp_timewait.c')
-rw-r--r-- | sys/netinet/tcp_timewait.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/netinet/tcp_timewait.c b/sys/netinet/tcp_timewait.c index 9267ea2..e61d541 100644 --- a/sys/netinet/tcp_timewait.c +++ b/sys/netinet/tcp_timewait.c @@ -193,6 +193,11 @@ static int tcp_inflight_debug = 0; SYSCTL_INT(_net_inet_tcp_inflight, OID_AUTO, debug, CTLFLAG_RW, &tcp_inflight_debug, 0, "Debug TCP inflight calculations"); +static int tcp_inflight_rttthresh; +SYSCTL_PROC(_net_inet_tcp_inflight, OID_AUTO, rttthresh, CTLTYPE_INT|CTLFLAG_RW, + &tcp_inflight_rttthresh, 0, sysctl_msec_to_ticks, "I", + "RTT threshold below which inflight will deactivate itself"); + static int tcp_inflight_min = 6144; SYSCTL_INT(_net_inet_tcp_inflight, OID_AUTO, min, CTLFLAG_RW, &tcp_inflight_min, 0, "Lower-bound for TCP inflight window"); @@ -253,6 +258,7 @@ tcp_init() tcp_msl = TCPTV_MSL; tcp_rexmit_min = TCPTV_MIN; tcp_rexmit_slop = TCPTV_CPU_VAR; + tcp_inflight_rttthresh = TCPTV_INFLIGHT_RTTTHRESH; INP_INFO_LOCK_INIT(&tcbinfo, "tcp"); LIST_INIT(&tcb); @@ -1937,7 +1943,7 @@ tcp_xmit_bandwidth_limit(struct tcpcb *tp, tcp_seq ack_seq) * If inflight_enable is disabled in the middle of a tcp connection, * make sure snd_bwnd is effectively disabled. */ - if (tcp_inflight_enable == 0) { + if (tcp_inflight_enable == 0 || tp->t_rttlow < tcp_inflight_rttthresh) { tp->snd_bwnd = TCP_MAXWIN << TCP_MAX_WINSHIFT; tp->snd_bandwidth = 0; return; |