• Neal Cardwell's avatar
    tcp: TCP Fast Open Server - note timestamps and retransmits for SYNACK RTT · 07253988
    Neal Cardwell authored
    Previously, when using TCP Fast Open a server would return from
    tcp_check_req() before updating snt_synack based on TCP timestamp echo
    replies and whether or not we've retransmitted the SYNACK. The result
    was that (a) for TFO connections using timestamps we used an incorrect
    baseline SYNACK send time (tcp_time_stamp of SYNACK send instead of
    rcv_tsecr), and (b) for TFO connections that do not have TCP
    timestamps but retransmit the SYNACK we took a SYNACK RTT sample when
    we should not take a sample.
    
    This fix merely moves the snt_synack update logic a bit earlier in the
    function, so that connections using TCP Fast Open will properly do
    these updates when the ACK for the SYNACK arrives.
    
    Moving this snt_synack update logic means that with TCP_DEFER_ACCEPT
    enabled we do a few instructions of wasted work on each bare ACK, but
    that seems OK.
    Signed-off-by: default avatarNeal Cardwell <ncardwell@google.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    07253988
tcp_minisocks.c 24.8 KB