Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider. Critical: 0 · High: 0 · Medium: 1 · Low: 0 If you believe none of the issues are legitimate, please reply to each issue of Medium severity or higher and explain why the AI is wrong. If any of them are legitimate and you plan to respin, please let patchwork know by including "pw-bot: cr" as a separate line at the end of your reply (one such reply per series is enough). - [Medium] The patch only partly achieves what its subject says, "Skip active TFO blackhole detection for passive sockets". -- tcp: Skip active TFO blackhole detection for passive sockets. This patch removes the tp->syn_data_acked term from the check in tcp_fastopen_active_detect_blackhole(). tcp_fastopen_add_skb() sets that bit on passive TFO children, so consecutive RTOs on a passive socket could pause active TFO for the whole netns.
> diff --git a/net/ipv4/tcp_fastopen.c b/net/ipv4/tcp_fastopen.c > index 7f7eb3cc1c04c..61e57f21e4e41 100644 > --- a/net/ipv4/tcp_fastopen.c > +++ b/net/ipv4/tcp_fastopen.c > @@ -685,7 +685,7 @@ void tcp_fastopen_active_detect_blackhole(struct sock *sk, bool expired) > * Fast Open globally after hitting the third consecutive timeout or > * exceeding the configured timeout limit. > */ > - if ((tp->syn_fastopen || tp->syn_data || tp->syn_data_acked) && > + if ((tp->syn_fastopen || tp->syn_data) && > (timeouts == 2 || (timeouts < 2 && expired))) { > tcp_fastopen_active_disable(sk); > NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPFASTOPENACTIVEFAIL);
[Severity: Medium] Can tp->syn_fastopen or tp->syn_data still be set on a passive socket here? The active side sets these bits in tcp_syn_options() and tcp_send_syn_data(). The only place either one gets cleared is the transmit error path in tcp_send_syn_data(): net/ipv4/tcp_output.c:tcp_send_syn_data() { ... if (!err) { tp->syn_data = (fo->copied > 0); ... if (err) tp->syn_fastopen = 0; ... } tcp_disconnect() only resets the other two bits: net/ipv4/tcp.c:tcp_disconnect() { ... tp->syn_data_acked = 0; tp->syn_fastopen_child = 0; ... } Consider a socket that does an active TFO connect (MSG_FASTOPEN or TCP_FASTOPEN_CONNECT), then connect(AF_UNSPEC), then listen(). __inet_stream_connect() calls tcp_disconnect() and moves the socket back to SS_UNCONNECTED / TCP_CLOSE, so listen() is allowed. The new listener still has syn_fastopen and syn_data set. Every child of that listener gets a copy of those bits, because the whole tcp_sock is copied: tcp_create_openreq_child() inet_csk_clone_lock() sk_clone_lock() sock_copy() tcp_create_openreq_child() does not clear syn_fastopen or syn_data. Suppose one of these children, TFO or not, hits its third consecutive RTO: tcp_write_timeout() tcp_fastopen_active_detect_blackhole() tcp_fastopen_active_disable() In that case the check above still passes. Active TFO is then paused for the whole netns when tcp_fastopen_blackhole_timeout_sec is non-zero, and TCPFastOpenActiveFail is incremented either way. This is the symptom the commit message describes. A reused active socket that later reconnects without TFO keeps the same stale bits, so it would be treated as a TFO connection in the same way. The syn_fastopen_child early return mentioned in the commit message would only cover the TFO children of such a listener. Would it make sense to also clear syn_fastopen and syn_data in tcp_disconnect(), or on the child in tcp_create_openreq_child()?
-- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/2026…%40google.com