• Yuchung Cheng's avatar
    tcp: always timestamp on every skb transmission · 7f12422c
    Yuchung Cheng authored
    Previously TCP skbs are not always timestamped if the transmission
    failed due to memory or other local issues. This makes deciding
    when to abort a socket tricky and complicated because the first
    unacknowledged skb's timestamp may be 0 on TCP timeout.
    
    The straight-forward fix is to always timestamp skb on every
    transmission attempt. Also every skb retransmission needs to be
    flagged properly to avoid RTT under-estimation. This can happen
    upon receiving an ACK for the original packet and the a previous
    (spurious) retransmission has failed.
    
    It's worth noting that this reverts to the old time-stamping
    style before commit 8c72c65b ("tcp: update skb->skb_mstamp more
    carefully") which addresses a problem in computing the elapsed time
    of a stalled window-probing socket. The problem will be addressed
    differently in the next patches with a simpler approach.
    Signed-off-by: default avatarYuchung Cheng <ycheng@google.com>
    Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
    Reviewed-by: default avatarNeal Cardwell <ncardwell@google.com>
    Reviewed-by: default avatarSoheil Hassas Yeganeh <soheil@google.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    7f12422c
tcp_output.c 109 KB