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.