Skip to contentSkip to conversation

ss: tcp: Provide visibilty of Fast Open child creation

PATCH New Jeremy Harris 1 participant 2 messages Apr 23, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover ss: tcp: Provide visibilty of Fast Open child creation

ss -oi can output "fastopen_child" attribute if the passive-open
socket was created as a fastopen child

Note: this is dependent on the acceptance of a kernel patch, submitted as
"[PATCH v2 0/2] tcp: fastopen: observability"

Jeremy Harris (1):
ss: tcp: observability of fastopen child creation

 include/uapi/linux/tcp.h | 1 +
 misc/ss.c                | 4 ++++
 2 files changed, 5 insertions(+)

base-commit: 866e1d107b7de68ca1fcd1d4d5ffecf9d96bff30

Signature · 1 line
2.49.0
#1 lore raw

PATCH 1/1 ss: tcp: observability of fastopen child creation

ss -oi can output "fastopen_child" attribute if the passive-open socket was created as a fastopen child

---
 include/uapi/linux/tcp.h | 1 +
 misc/ss.c                | 4 ++++
 2 files changed, 5 insertions(+)
include/uapi/linux/tcp.h +1 -0
index cc5253a5..85b51e4c 100644
@@ -184,6 +184,7 @@ enum tcp_fastopen_client_fail {
 #define TCPI_OPT_ECN_SEEN	16 /* we received at least one packet with ECT */
 #define TCPI_OPT_SYN_DATA	32 /* SYN-ACK acked data in SYN sent or rcvd */
 #define TCPI_OPT_USEC_TS	64 /* usec timestamps */
+#define TCPI_OPT_TFO_CHILD	128 /* child from a Fast Open option on SYN */
 
 /*
  * Sender's congestion state indicating normal or abnormal situations
misc/ss.c +4 -0
index 6d597650..0df88045 100644
@@ -891,6 +891,7 @@ struct tcpstat {
 	bool		    has_ecn_opt;
 	bool		    has_ecnseen_opt;
 	bool		    has_fastopen_opt;
+	bool		    has_fastopen_child_opt;
 	bool		    has_wscale_opt;
 	bool		    app_limited;
 	struct dctcpstat    *dctcp;
@@ -2613,6 +2614,8 @@ static void tcp_stats_print(struct tcpstat *s)
 		out(" ecnseen");
 	if (s->has_fastopen_opt)
 		out(" fastopen");
+	if (s->has_fastopen_child_opt)
+		out(" fastopen_child");
 	if (s->cong_alg[0])
 		out(" %s", s->cong_alg);
 	if (s->has_wscale_opt)
@@ -3099,6 +3102,7 @@ static void tcp_show_info(const struct nlmsghdr *nlh, struct inet_diag_msg *r,
 			s.has_ecn_opt	   = TCPI_HAS_OPT(info, TCPI_OPT_ECN);
 			s.has_ecnseen_opt  = TCPI_HAS_OPT(info, TCPI_OPT_ECN_SEEN);
 			s.has_fastopen_opt = TCPI_HAS_OPT(info, TCPI_OPT_SYN_DATA);
+			s.has_fastopen_child_opt = TCPI_HAS_OPT(info, TCPI_OPT_TFO_CHILD);
 		}
 
 		if (tb[INET_DIAG_CONG])
Signature · 1 line
2.49.0