public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH iproute2-next] ss: add support for TCP delack timers
@ 2026-04-03 10:23 Eric Dumazet
  2026-04-03 14:14 ` Neal Cardwell
  2026-04-05 16:30 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Eric Dumazet @ 2026-04-03 10:23 UTC (permalink / raw)
  To: David Ahern, Stephen Hemminger
  Cc: David S . Miller, Jakub Kicinski, Paolo Abeni, Neal Cardwell,
	Kuniyuki Iwashima, netdev, eric.dumazet, Eric Dumazet

Kernel commit c698f5cc940d ("inet_diag: report delayed ack timer information")
added a new enum for idiag_timer values and support for delayed ack timers.

Change tcp_timer_print() to use the new enum and display "delack"
instead of "unknown":

tt -to
...
   ESTAB 10     0   [2002:a05:6830:1f86::]:12875 [2002:a05:6830:1f85::]:50438

        timer:(delack,003ms,0) ino:152178 sk:3004 cgroup:unreachable:189 <->

        skmem:(r1344,rb12780520,t0,tb262144,f2752,w0,o250,bl0,d0) ts usec_ts
        ...

Signed-off-by: Eric Dumazet <edumazet@google.com>
---
 misc/ss.c | 26 ++++++++++++++------------
 1 file changed, 14 insertions(+), 12 deletions(-)

diff --git a/misc/ss.c b/misc/ss.c
index b3566f6b6b81427609829720496e80bea7cfeef7..1ea804ad549e23f767633e07efdd9adf1277af18 100644
--- a/misc/ss.c
+++ b/misc/ss.c
@@ -2765,21 +2765,23 @@ static void tcp_stats_print(struct tcpstat *s)
 static void tcp_timer_print(struct tcpstat *s)
 {
 	static const char * const tmr_name[] = {
-		"off",
-		"on",
-		"keepalive",
-		"timewait",
-		"persist",
-		"unknown"
+		[IDIAG_TIMER_OFF]	= "off",
+		[IDIAG_TIMER_ON]	= "on",
+		[IDIAG_TIMER_KEEPALIVE]	= "keepalive",
+		[IDIAG_TIMER_TIMEWAIT]	= "timewait",
+		[IDIAG_TIMER_PROBE0]	= "persist",
+		[IDIAG_TIMER_DELACK]	= "delack",
 	};
 
 	if (s->timer) {
-		if (s->timer > 4)
-			s->timer = 5;
-		out(" timer:(%s,%s,%d)",
-			     tmr_name[s->timer],
-			     print_ms_timer(s->timeout),
-			     s->retrans);
+		const char *name;
+
+		if (s->timer >= ARRAY_SIZE(tmr_name))
+			name = "unknown";
+		else
+			name = tmr_name[s->timer];
+		out(" timer:(%s,%s,%d)", name,
+		    print_ms_timer(s->timeout), s->retrans);
 	}
 }
 
-- 
2.53.0.1213.gd9a14994de-goog


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-04-05 16:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-03 10:23 [PATCH iproute2-next] ss: add support for TCP delack timers Eric Dumazet
2026-04-03 14:14 ` Neal Cardwell
2026-04-05 16:30 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox