diff mbox series

[iproute2,2/5] ss: add report of TCPI_OPT_USEC_TS

Message ID 20231204091911.1326130-3-edumazet@google.com (mailing list archive)
State Accepted
Commit 467879b418ff73d7afc60fab85c8cc766aca7553
Delegated to: David Ahern
Headers show
Series TCP usec and FQ fastpath | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch

Commit Message

Eric Dumazet Dec. 4, 2023, 9:19 a.m. UTC
linux-6.7 supports usec resolution in TCP TS values.
ss -ie can show if a flow is using this new resolution.

$ ss -tie
 ...
State Recv-Q Send-Q           Local Address:Port           Peer Address:Port Process
ESTAB 0      12869632 [2002:a05:6608:295::]:37054 [2002:a05:6608:297::]:35721
	 ts usec_ts sack bbr2s wscale:12,12 ...

Signed-off-by: Eric Dumazet <edumazet@google.com>
---
 misc/ss.c | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/misc/ss.c b/misc/ss.c
index 9438382b8e667529dc2cf4b020d8696a4175e992..3dacee48db0f805b3a7a3bd213771b86eceea1ab 100644
--- a/misc/ss.c
+++ b/misc/ss.c
@@ -875,6 +875,7 @@  struct tcpstat {
 	unsigned long long  bytes_sent;
 	unsigned long long  bytes_retrans;
 	bool		    has_ts_opt;
+	bool		    has_usec_ts_opt;
 	bool		    has_sack_opt;
 	bool		    has_ecn_opt;
 	bool		    has_ecnseen_opt;
@@ -2562,6 +2563,8 @@  static void tcp_stats_print(struct tcpstat *s)
 
 	if (s->has_ts_opt)
 		out(" ts");
+	if (s->has_usec_ts_opt)
+		out(" usec_ts");
 	if (s->has_sack_opt)
 		out(" sack");
 	if (s->has_ecn_opt)
@@ -3037,6 +3040,7 @@  static void tcp_show_info(const struct nlmsghdr *nlh, struct inet_diag_msg *r,
 
 		if (show_options) {
 			s.has_ts_opt	   = TCPI_HAS_OPT(info, TCPI_OPT_TIMESTAMPS);
+			s.has_usec_ts_opt  = TCPI_HAS_OPT(info, TCPI_OPT_USEC_TS);
 			s.has_sack_opt	   = TCPI_HAS_OPT(info, TCPI_OPT_SACK);
 			s.has_ecn_opt	   = TCPI_HAS_OPT(info, TCPI_OPT_ECN);
 			s.has_ecnseen_opt  = TCPI_HAS_OPT(info, TCPI_OPT_ECN_SEEN);