• John Heffner's avatar
    [TCP]: receive buffer growth limiting with mixed MTU · 326f36e9
    John Heffner authored
    This is a patch for discussion addressing some receive buffer growing issues.
    This is partially related to the thread "Possible BUG in IPv4 TCP window
    handling..." last week.
    
    Specifically it addresses the problem of an interaction between rcvbuf
    moderation (receiver autotuning) and rcv_ssthresh.  The problem occurs when
    sending small packets to a receiver with a larger MTU.  (A very common case I
    have is a host with a 1500 byte MTU sending to a host with a 9k MTU.)  In
    such a case, the rcv_ssthresh code is targeting a window size corresponding
    to filling up the current rcvbuf, not taking into account that the new rcvbuf
    moderation may increase the rcvbuf size.
    
    One hunk makes rcv_ssthresh use tcp_rmem[2] as the size target rather than
    rcvbuf.  The other changes the behavior when it overflows its memory bounds
    with in-order data so that it tries to grow rcvbuf (the same as with
    out-of-order data).
    
    These changes should help my problem of mixed MTUs, and should also help the
    case from last week's thread I think.  (In both cases though you still need
    tcp_rmem[2] to be set much larger than the TCP window.)  One question is if
    this is too aggressive at trying to increase rcvbuf if it's under memory
    stress.
    
    Orignally-from: John Heffner <jheffner@psc.edu>
    Signed-off-by: default avatarStephen Hemminger <shemminger@osdl.org>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    326f36e9
tcp_input.c 124 KB