• Eric Dumazet's avatar
    tcp_cubic: fix spurious Hystart ACK train detections for not-cwnd-limited flows · 4e1fddc9
    Eric Dumazet authored
    While testing BIG TCP patch series, I was expecting that TCP_RR workloads
    with 80KB requests/answers would send one 80KB TSO packet,
    then being received as a single GRO packet.
    
    It turns out this was not happening, and the root cause was that
    cubic Hystart ACK train was triggering after a few (2 or 3) rounds of RPC.
    
    Hystart was wrongly setting CWND/SSTHRESH to 30, while my RPC
    needed a budget of ~20 segments.
    
    Ideally these TCP_RR flows should not exit slow start.
    
    Cubic Hystart should reset itself at each round, instead of assuming
    every TCP flow is a bulk one.
    
    Note that even after this patch, Hystart can still trigger, depending
    on scheduling artifacts, but at a higher CWND/SSTHRESH threshold,
    keeping optimal TSO packet sizes.
    
    Tested:
    
    ip link set dev eth0 gro_ipv6_max_size 131072 gso_ipv6_max_size 131072
    nstat -n; netperf -H ... -t TCP_RR  -l 5  -- -r 80000,80000 -K cubic; nstat|egrep "Ip6InReceives|Hystart|Ip6OutRequests"
    
    Before:
    
       8605
    Ip6InReceives                   87541              0.0
    Ip6OutRequests                  129496             0.0
    TcpExtTCPHystartTrainDetect     1                  0.0
    TcpExtTCPHystartTrainCwnd       30                 0.0
    
    After:
    
      8760
    Ip6InReceives                   88514              0.0
    Ip6OutRequests                  87975              0.0
    
    Fixes: ae27e98a ("[TCP] CUBIC v2.3")
    Co-developed-by: default avatarNeal Cardwell <ncardwell@google.com>
    Signed-off-by: default avatarNeal Cardwell <ncardwell@google.com>
    Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
    Cc: Stephen Hemminger <stephen@networkplumber.org>
    Cc: Yuchung Cheng <ycheng@google.com>
    Cc: Soheil Hassas Yeganeh <soheil@google.com>
    Link: https://lore.kernel.org/r/20211123202535.1843771-1-eric.dumazet@gmail.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
    4e1fddc9
tcp_cubic.c 16 KB