summaryrefslogtreecommitdiff
path: root/sys/netinet/tcp_subr.c
diff options
context:
space:
mode:
authorYASUOKA Masahiko <yasuoka@cvs.openbsd.org>2022-11-07 11:22:56 +0000
committerYASUOKA Masahiko <yasuoka@cvs.openbsd.org>2022-11-07 11:22:56 +0000
commit9ce5dce7bb13c9a20d8bb1c16549b96dab30af6e (patch)
treeaa51e6ca9231c856209ccae8838119cb73b133bc /sys/netinet/tcp_subr.c
parent9241d98c94747d370684e06f4f822e56ce910c94 (diff)
Modify TCP receive buffer size auto scaling to use the smoothed RTT
(SRTT) instead of the timestamp option. Since the timestamp option is disabled on some OSs (eg. Windows) or dropped by some firewalls/routers, in such a case the window size had been fixed at 16KB, this limits throughput at very low on high latency networks. Also replace "tcp_now" from 2HZ tick counter to binuptime in milliseconds to calculate the SRTT better. tested by krw matthieu jmatthew dlg djm stu stsp ok claudio
Diffstat (limited to 'sys/netinet/tcp_subr.c')
-rw-r--r--sys/netinet/tcp_subr.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c
index 3a0d0cd7ab3..b08f55f00e2 100644
--- a/sys/netinet/tcp_subr.c
+++ b/sys/netinet/tcp_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcp_subr.c,v 1.189 2022/10/03 16:43:52 bluhm Exp $ */
+/* $OpenBSD: tcp_subr.c,v 1.190 2022/11/07 11:22:55 yasuoka Exp $ */
/* $NetBSD: tcp_subr.c,v 1.22 1996/02/13 23:44:00 christos Exp $ */
/*
@@ -109,7 +109,7 @@ struct mutex tcp_timer_mtx = MUTEX_INITIALIZER(IPL_SOFTNET);
/* patchable/settable parameters for tcp */
int tcp_mssdflt = TCP_MSS;
-int tcp_rttdflt = TCPTV_SRTTDFLT / PR_SLOWHZ;
+int tcp_rttdflt = TCPTV_SRTTDFLT;
/* values controllable via sysctl */
int tcp_do_rfc1323 = 1;
@@ -136,7 +136,6 @@ struct cpumem *tcpcounters; /* tcp statistics */
u_char tcp_secret[16]; /* [I] */
SHA2_CTX tcp_secret_ctx; /* [I] */
tcp_seq tcp_iss; /* [T] updated by timer and connection */
-uint32_t tcp_now; /* [T] incremented by slow timer */
/*
* Tcp initialization
@@ -145,7 +144,6 @@ void
tcp_init(void)
{
tcp_iss = 1; /* wrong */
- tcp_now = 1;
pool_init(&tcpcb_pool, sizeof(struct tcpcb), 0, IPL_SOFTNET, 0,
"tcpcb", NULL);
pool_init(&tcpqe_pool, sizeof(struct tcpqent), 0, IPL_SOFTNET, 0,
@@ -445,7 +443,7 @@ tcp_newtcpcb(struct inpcb *inp, int wait)
* reasonable initial retransmit time.
*/
tp->t_srtt = TCPTV_SRTTBASE;
- tp->t_rttvar = tcp_rttdflt * PR_SLOWHZ <<
+ tp->t_rttvar = tcp_rttdflt <<
(TCP_RTTVAR_SHIFT + TCP_RTT_BASE_SHIFT - 1);
tp->t_rttmin = TCPTV_MIN;
TCPT_RANGESET(tp->t_rxtcur, TCP_REXMTVAL(tp),