[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250423124600.5038-2-jgh@exim.org>
Date: Wed, 23 Apr 2025 13:46:00 +0100
From: Jeremy Harris <jgh@...m.org>
To: netdev@...r.kernel.org
Cc: stephen@...workplumber.org,
Jeremy Harris <jgh@...m.org>
Subject: [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
Signed-off-by: Jeremy Harris <jgh@...m.org>
---
include/uapi/linux/tcp.h | 1 +
misc/ss.c | 4 ++++
2 files changed, 5 insertions(+)
diff --git a/include/uapi/linux/tcp.h b/include/uapi/linux/tcp.h
index cc5253a5..85b51e4c 100644
--- a/include/uapi/linux/tcp.h
+++ b/include/uapi/linux/tcp.h
@@ -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
diff --git a/misc/ss.c b/misc/ss.c
index 6d597650..0df88045 100644
--- a/misc/ss.c
+++ b/misc/ss.c
@@ -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])
--
2.49.0
Powered by blists - more mailing lists