Skip to content
Snippets Groups Projects
  • Yuchung Cheng's avatar
    794200d6
    tcp: undo cwnd on Fast Open spurious SYNACK retransmit · 794200d6
    Yuchung Cheng authored
    
    This patch makes passive Fast Open reverts the cwnd to default
    initial cwnd (10 packets) if the SYNACK timeout is spurious.
    
    Passive Fast Open uses a full socket during handshake so it can
    use the existing undo logic to detect spurious retransmission
    by recording the first SYNACK timeout in key state variable
    retrans_stamp. Upon receiving the ACK of the SYNACK, if the socket
    has sent some data before the timeout, the spurious timeout
    is detected by tcp_try_undo_recovery() in tcp_process_loss()
    in tcp_ack().
    
    But if the socket has not send any data yet, tcp_ack() does not
    execute the undo code since no data is acknowledged. The fix is to
    check such case explicitly after tcp_ack() during the ACK processing
    in SYN_RECV state. In addition this is checked in FIN_WAIT_1 state
    in case the server closes the socket before handshake completes.
    
    Signed-off-by: default avatarYuchung Cheng <ycheng@google.com>
    Signed-off-by: default avatarNeal Cardwell <ncardwell@google.com>
    Signed-off-by: default avatarSoheil Hassas Yeganeh <soheil@google.com>
    Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    794200d6
    History
    tcp: undo cwnd on Fast Open spurious SYNACK retransmit
    Yuchung Cheng authored
    
    This patch makes passive Fast Open reverts the cwnd to default
    initial cwnd (10 packets) if the SYNACK timeout is spurious.
    
    Passive Fast Open uses a full socket during handshake so it can
    use the existing undo logic to detect spurious retransmission
    by recording the first SYNACK timeout in key state variable
    retrans_stamp. Upon receiving the ACK of the SYNACK, if the socket
    has sent some data before the timeout, the spurious timeout
    is detected by tcp_try_undo_recovery() in tcp_process_loss()
    in tcp_ack().
    
    But if the socket has not send any data yet, tcp_ack() does not
    execute the undo code since no data is acknowledged. The fix is to
    check such case explicitly after tcp_ack() during the ACK processing
    in SYN_RECV state. In addition this is checked in FIN_WAIT_1 state
    in case the server closes the socket before handshake completes.
    
    Signed-off-by: default avatarYuchung Cheng <ycheng@google.com>
    Signed-off-by: default avatarNeal Cardwell <ncardwell@google.com>
    Signed-off-by: default avatarSoheil Hassas Yeganeh <soheil@google.com>
    Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>