Skip to content
  • Eric Dumazet's avatar
    tcp: sndbuf autotuning improvements · 6ae70532
    Eric Dumazet authored
    
    
    tcp_fixup_sndbuf() is underestimating initial send buffer requirements.
    
    It was not noticed because big GSO packets were escaping the limitation,
    but with smaller TSO packets (or TSO/GSO/SG off), application hits
    sk_sndbuf before having a chance to fill enough packets in socket write
    queue.
    
    - initial cwnd can be bigger than 10 for specific routes
    
    - SKB_TRUESIZE() is a bit under real needs in some cases,
      because of power-of-two rounding in kmalloc()
    
    - Fast Recovery (RFC 5681 3.2) : Cubic needs 70% factor
    
    - Extra cushion (application might react slowly to POLLOUT)
    
    tcp_v4_conn_req_fastopen() needs to call tcp_init_metrics() before
    calling tcp_init_buffer_space()
    
    Then we realize tcp_new_space() should call tcp_fixup_sndbuf()
    instead of duplicating this stuff.
    
    Rename tcp_fixup_sndbuf() to tcp_sndbuf_expand() to be more
    descriptive.
    
    Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
    Signed-off-by: default avatarNeal Cardwell <ncardwell@google.com>
    Signed-off-by: default avatarYuchung Cheng <ycheng@google.com>
    Acked-by: default avatarMaciej Żenczykowski <maze@google.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    6ae70532