git: TCP - Fix problems with dynamic receiver and sender buffer scaling

Matthew Dillon dillon at crater.dragonflybsd.org
Sat Aug 22 14:01:15 PDT 2009


commit 46e92930ee015ab6fadc97ee92142fe18d98da9e
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date:   Sat Aug 22 13:53:19 2009 -0700

    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.

Summary of changes:
 sys/netinet/tcp.h          |    8 +++++++-
 sys/netinet/tcp_input.c    |   30 +++++++++++++++++++++---------
 sys/netinet/tcp_output.c   |   37 +++++++++++++++++++++++++++----------
 sys/netinet/tcp_subr.c     |    2 ++
 sys/netinet/tcp_syncache.c |    5 +++--
 sys/netinet/tcp_usrreq.c   |   17 ++++++++++++++---
 sys/netinet/tcp_var.h      |    1 +
 7 files changed, 75 insertions(+), 25 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/46e92930ee015ab6fadc97ee92142fe18d98da9e


-- 
DragonFly BSD source repository





More information about the Commits mailing list