• Eric Dumazet's avatar
    tcp: grow window for OOO packets only for SACK flows · f76b26eb
    Eric Dumazet authored
    BugLink: https://bugs.launchpad.net/bugs/1885932
    
    [ Upstream commit 66205121 ]
    
    Back in 2013, we made a change that broke fast retransmit
    for non SACK flows.
    
    Indeed, for these flows, a sender needs to receive three duplicate
    ACK before starting fast retransmit. Sending ACK with different
    receive window do not count.
    
    Even if enabling SACK is strongly recommended these days,
    there still are some cases where it has to be disabled.
    
    Not increasing the window seems better than having to
    rely on RTO.
    
    After the fix, following packetdrill test gives :
    
    // Initialize connection
        0 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3
       +0 setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
       +0 bind(3, ..., ...) = 0
       +0 listen(3, 1) = 0
    
       +0 < S 0:0(0) win 32792 <mss 1000,nop,wscale 7>
       +0 > S. 0:0(0) ack 1 <mss 1460,nop,wscale 8>
       +0 < . 1:1(0) ack 1 win 514
    
       +0 accept(3, ..., ...) = 4
    
       +0 < . 1:1001(1000) ack 1 win 514
    // Quick ack
       +0 > . 1:1(0) ack 1001 win 264
    
       +0 < . 2001:3001(1000) ack 1 win 514
    // DUPACK : Normally we should not change the window
       +0 > . 1:1(0) ack 1001 win 264
    
       +0 < . 3001:4001(1000) ack 1 win 514
    // DUPACK : Normally we should not change the window
       +0 > . 1:1(0) ack 1001 win 264
    
       +0 < . 4001:5001(1000) ack 1 win 514
    // DUPACK : Normally we should not change the window
        +0 > . 1:1(0) ack 1001 win 264
    
       +0 < . 1001:2001(1000) ack 1 win 514
    // Hole is repaired.
       +0 > . 1:1(0) ack 5001 win 272
    
    Fixes: 4e4f1fc2 ("tcp: properly increase rcv_ssthresh for ofo packets")
    Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
    Reported-by: default avatarVenkat Venkatsubra <venkat.x.venkatsubra@oracle.com>
    Acked-by: default avatarNeal Cardwell <ncardwell@google.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
    Signed-off-by: default avatarKelsey Skunberg <kelsey.skunberg@canonical.com>
    f76b26eb
tcp_input.c 184 KB