summaryrefslogtreecommitdiffstats
path: root/sys/netinet/tcp_subr.c
diff options
context:
space:
mode:
authordillon <dillon@FreeBSD.org>2002-12-14 21:00:17 +0000
committerdillon <dillon@FreeBSD.org>2002-12-14 21:00:17 +0000
commit524e713804055d6dc9b8da193b80f7a4cbe30ef4 (patch)
treecd69d74098ad61f3d4b5808149f7614b3804366c /sys/netinet/tcp_subr.c
parentbb0e8ad59aab5cf40ac2ec9d26d8d6ae7daf76ac (diff)
downloadFreeBSD-src-524e713804055d6dc9b8da193b80f7a4cbe30ef4.zip
FreeBSD-src-524e713804055d6dc9b8da193b80f7a4cbe30ef4.tar.gz
Change tcp.inflight_min from 1024 to a production default of 6144. Create
a sysctl for the stabilization value for the bandwidth delay product (inflight) algorithm and document it. MFC after: 3 days
Diffstat (limited to 'sys/netinet/tcp_subr.c')
-rw-r--r--sys/netinet/tcp_subr.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c
index c83d952..845df42 100644
--- a/sys/netinet/tcp_subr.c
+++ b/sys/netinet/tcp_subr.c
@@ -166,13 +166,16 @@ static int tcp_inflight_debug = 0;
SYSCTL_INT(_net_inet_tcp, OID_AUTO, inflight_debug, CTLFLAG_RW,
&tcp_inflight_debug, 0, "Debug TCP inflight calculations");
-static int tcp_inflight_min = 1024;
+static int tcp_inflight_min = 6144;
SYSCTL_INT(_net_inet_tcp, OID_AUTO, inflight_min, CTLFLAG_RW,
&tcp_inflight_min, 0, "Lower-bound for TCP inflight window");
static int tcp_inflight_max = TCP_MAXWIN << TCP_MAX_WINSHIFT;
SYSCTL_INT(_net_inet_tcp, OID_AUTO, inflight_max, CTLFLAG_RW,
&tcp_inflight_max, 0, "Upper-bound for TCP inflight window");
+static int tcp_inflight_stab = 20;
+SYSCTL_INT(_net_inet_tcp, OID_AUTO, inflight_stab, CTLFLAG_RW,
+ &tcp_inflight_stab, 0, "Inflight Algorithm Stabilization 20 = 2 packets");
static void tcp_cleartaocache(void);
static struct inpcb *tcp_notify(struct inpcb *, int);
@@ -1652,8 +1655,9 @@ tcp_xmit_bandwidth_limit(struct tcpcb *tp, tcp_seq ack_seq)
/*
* Calculate the semi-static bandwidth delay product, plus two maximal
* segments. The additional slop puts us squarely in the sweet
- * spot and also handles the bandwidth run-up case. Without the
- * slop we could be locking ourselves into a lower bandwidth.
+ * spot and also handles the bandwidth run-up case and stabilization.
+ * Without the slop we could be locking ourselves into a lower
+ * bandwidth.
*
* Situations Handled:
* (1) Prevents over-queueing of packets on LANs, especially on
@@ -1669,9 +1673,15 @@ tcp_xmit_bandwidth_limit(struct tcpcb *tp, tcp_seq ack_seq)
* (3) Theoretically should stabilize in the face of multiple
* connections implementing the same algorithm (this may need
* a little work).
+ *
+ * (4) Stability value (defaults to 20 = 2 maximal packets) can
+ * be adjusted with a sysctl but typically only needs to be
+ * on very slow connections. A value no smaller then 5
+ * should be used, but only reduce this default if you have
+ * no other choice.
*/
#define USERTT ((tp->t_srtt + tp->t_rttbest) / 2)
- bwnd = (int64_t)bw * USERTT / (hz << TCP_RTT_SHIFT) + 2 * tp->t_maxseg;
+ bwnd = (int64_t)bw * USERTT / (hz << TCP_RTT_SHIFT) + tcp_inflight_stab * tp->t_maxseg / 10;
#undef USERTT
if (tcp_inflight_debug > 0) {
OpenPOWER on IntegriCloud