TCP - Fix problems with dynamic receiver and sender buffer scaling
authorMatthew Dillon <dillon@apollo.backplane.com>
Sat, 22 Aug 2009 20:53:19 +0000 (13:53 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Sat, 22 Aug 2009 20:53:19 +0000 (13:53 -0700)
commit46e92930ee015ab6fadc97ee92142fe18d98da9e
tree5c7c226d03a32f1954c2e32d483133aff7ea78da
parent5c96dfbf5b7acb00a38546b55857fc3234949e8b
TCP - Fix problems with dynamic receiver and sender buffer scaling

* The receive buffer dynamic scaling ran afoul of our
  avoid_pure_win_update feature.  Correct the calculation so this
  feature properly works when the maximum receive window is smaller
  the maximum sockbuf size.

* Both the send and receive buffer dynamic scaling were limited
  to a maximum TCP window based on the initial window scaling negotiation,
  which in turn is based on the initial size of the receive or send
  sockbuf.

  Negotiate a minimum window scaling of 6 (x64).  This currently limits
  automatic sockbuf expansion to 4MB.  Further refinement is possible
  as long as (1 << scaling) does not exceed 1/4 of the initial sockbuf
  size.

* Reduce the maximum size of sockbuf can be dynamically scaled to from
  16MB to 2MB.  If someone wants more they can sysctl it up higher.

* Disable further scaling once the sockbuf size has exceeded the
  originally negotiated window scale parameters.  There's no gain in
  doing it past that.
sys/netinet/tcp.h
sys/netinet/tcp_input.c
sys/netinet/tcp_output.c
sys/netinet/tcp_subr.c
sys/netinet/tcp_syncache.c
sys/netinet/tcp_usrreq.c
sys/netinet/tcp_var.h