Re: Spurious TCP retransmissions on ack vs kfree_skb reordering
From: Eric Dumazet <edumazet@google.com>
Date: 2021-02-26 16:36:35
On Fri, Feb 26, 2021 at 5:09 PM Jakub Kicinski [off-list ref] wrote:
On Fri, 26 Feb 2021 11:41:22 +0100 Eric Dumazet wrote:quoted
quoted
quoted
Seems like I'm pretty lost here and the tcp:tcp_retransmit_skb events are less spurious than I thought. Looking at some tcpdump traces we see: 0.045277 IP6 A > B: Flags [SEW], seq 2248382925:2248383296, win 61920, options [mss 1440,sackOK,TS val 658870494 ecr 0,nop,wscale 11], length 371 0.045348 IP6 B > A: Flags [S.E], seq 961169456, ack 2248382926, win 65535, options [mss 1440,sackOK,TS val 883864022 ecr 658870494,nop,wscale 9], length 0The SYNACK does not include the prior payload.quoted
0.045369 IP6 A > B: Flags [P.], seq 1:372, ack 1, win 31, options [nop,nop,TS val 658870494 ecr 883864022], length 371So this rtx is not spurious. However in your prior email you wrote : bytes_in: 0 bytes_out: 742 bytes_acked: 742 Are you sure that at the time of the retransmit, bytes_acked was 742 ? I do not see how this could happen.Yes, this packetdrill test confirms TCP INFO stuff seems correct .Looks like it's TcpExtTCPSpuriousRtxHostQueues - the TFO fails as it might, but at the time the syn is still not kfree_skb()d because of the IRQ coalescing settings, so __tcp_retransmit_skb() returns -EBUSY and we have to wait for a timeout. Credit to Neil Spring @FB for figuring it out.
Yes, this makes sense. Presumably tcp_send_syn_data() could allocate a regular (non fclone) skb, to avoid this. But if skb_still_in_host_queue() returns true, __tcp_retransmit_skb() should return -EBUSY and your tracepoint should not be called ? In anycase, the bytes_acked should not be 742 as mentioned in your email, if only the SYN was acked ?