]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
ss: add support for TCP delack timers
authorEric Dumazet <edumazet@google.com>
Fri, 3 Apr 2026 10:23:09 +0000 (10:23 +0000)
committerDavid Ahern <dsahern@kernel.org>
Sun, 5 Apr 2026 16:27:08 +0000 (10:27 -0600)
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>
Reviewed-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: David Ahern <dsahern@kernel.org>
misc/ss.c

index b3566f6b6b81427609829720496e80bea7cfeef7..1ea804ad549e23f767633e07efdd9adf1277af18 100644 (file)
--- 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);
        }
 }