Date: Mon, 3 Jul 2017 19:39:59 +0000 (UTC) From: Sean Bruno <sbruno@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320614 - head/sys/netinet Message-ID: <201707031939.v63JdxuU068787@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: sbruno Date: Mon Jul 3 19:39:58 2017 New Revision: 320614 URL: https://svnweb.freebsd.org/changeset/base/320614 Log: Add a sysctl to toggle the use of the sockets LOWAT when calculating auto window growth Submitted by: j@nitrology.com (Jason Wolfe) Reviewed by: gnn hiren Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D11016 Modified: head/sys/netinet/tcp_output.c Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Mon Jul 3 19:33:50 2017 (r320613) +++ head/sys/netinet/tcp_output.c Mon Jul 3 19:39:58 2017 (r320614) @@ -130,6 +130,12 @@ SYSCTL_INT(_net_inet_tcp, OID_AUTO, sendbuf_max, CTLFL &VNET_NAME(tcp_autosndbuf_max), 0, "Max size of automatic send buffer"); +VNET_DEFINE(int, tcp_sendbuf_auto_lowat) = 0; +#define V_tcp_sendbuf_auto_lowat VNET(tcp_sendbuf_auto_lowat) +SYSCTL_INT(_net_inet_tcp, OID_AUTO, sendbuf_auto_lowat, CTLFLAG_VNET | CTLFLAG_RW, + &VNET_NAME(tcp_sendbuf_auto_lowat), 0, + "Modify threshold for auto send buffer growth to account for SO_SNDLOWAT"); + /* * Make sure that either retransmit or persist timer is set for SYN, FIN and * non-ACK. @@ -521,8 +527,12 @@ after_sack_rexmit: * XXXGL: should there be used sbused() or sbavail()? */ if (V_tcp_do_autosndbuf && so->so_snd.sb_flags & SB_AUTOSIZE) { - if ((tp->snd_wnd / 4 * 5) >= so->so_snd.sb_hiwat && - sbused(&so->so_snd) >= (so->so_snd.sb_hiwat / 8 * 7) && + int autosndbuf_mod = 0; + if (V_tcp_sendbuf_auto_lowat) + autosndbuf_mod = so->so_snd.sb_lowat; + + if ((tp->snd_wnd / 4 * 5) >= so->so_snd.sb_hiwat - autosndbuf_mod && + sbused(&so->so_snd) >= (so->so_snd.sb_hiwat / 8 * 7) - autosndbuf_mod && sbused(&so->so_snd) < V_tcp_autosndbuf_max && sendwin >= (sbused(&so->so_snd) - (tp->snd_nxt - tp->snd_una))) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201707031939.v63JdxuU068787>