Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'tcp-fastopen-observability'

Jeremy Harris says:

====================
tcp: fastopen: observability

Whether TCP Fast Open was used for a connection is not reliably
observable by an accepting application when the SYN passed no data.

Fix this by noting during SYN receive processing that an acceptable Fast
Open option was used, and provide this to userland via getsockopt TCP_INFO.
====================

Link: https://patch.msgid.link/20250423124334.4916-1-jgh@exim.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

+7 -1
+2 -1
include/linux/tcp.h
··· 385 385 syn_fastopen:1, /* SYN includes Fast Open option */ 386 386 syn_fastopen_exp:1,/* SYN includes Fast Open exp. option */ 387 387 syn_fastopen_ch:1, /* Active TFO re-enabling probe */ 388 - syn_data_acked:1;/* data in SYN is acked by SYN-ACK */ 388 + syn_data_acked:1,/* data in SYN is acked by SYN-ACK */ 389 + syn_fastopen_child:1; /* created TFO passive child socket */ 389 390 390 391 u8 keepalive_probes; /* num of allowed keep alive probes */ 391 392 u32 tcp_tx_delay; /* delay (in usec) added to TX packets */
+1
include/uapi/linux/tcp.h
··· 184 184 #define TCPI_OPT_ECN_SEEN 16 /* we received at least one packet with ECT */ 185 185 #define TCPI_OPT_SYN_DATA 32 /* SYN-ACK acked data in SYN sent or rcvd */ 186 186 #define TCPI_OPT_USEC_TS 64 /* usec timestamps */ 187 + #define TCPI_OPT_TFO_CHILD 128 /* child from a Fast Open option on SYN */ 187 188 188 189 /* 189 190 * Sender's congestion state indicating normal or abnormal situations
+3
net/ipv4/tcp.c
··· 3409 3409 tp->rack.reo_wnd_persist = 0; 3410 3410 tp->rack.dsack_seen = 0; 3411 3411 tp->syn_data_acked = 0; 3412 + tp->syn_fastopen_child = 0; 3412 3413 tp->rx_opt.saw_tstamp = 0; 3413 3414 tp->rx_opt.dsack = 0; 3414 3415 tp->rx_opt.num_sacks = 0; ··· 4165 4164 info->tcpi_options |= TCPI_OPT_SYN_DATA; 4166 4165 if (tp->tcp_usec_ts) 4167 4166 info->tcpi_options |= TCPI_OPT_USEC_TS; 4167 + if (tp->syn_fastopen_child) 4168 + info->tcpi_options |= TCPI_OPT_TFO_CHILD; 4168 4169 4169 4170 info->tcpi_rto = jiffies_to_usecs(icsk->icsk_rto); 4170 4171 info->tcpi_ato = jiffies_to_usecs(min_t(u32, icsk->icsk_ack.ato,
+1
net/ipv4/tcp_fastopen.c
··· 401 401 } 402 402 NET_INC_STATS(sock_net(sk), 403 403 LINUX_MIB_TCPFASTOPENPASSIVE); 404 + tcp_sk(child)->syn_fastopen_child = 1; 404 405 return child; 405 406 } 406 407 NET_INC_STATS(sock_net(sk),