Skip to contentSkip to conversation

ss: add support for TCP delack timers

PATCH Applied Eric Dumazet 3 participants 3 messages Apr 3 – Apr 5

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

PATCH 1/1 ss: add support for TCP delack timers

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
        ...
---
 misc/ss.c | 26 ++++++++++++++------------
 1 file changed, 14 insertions(+), 12 deletions(-)
misc/ss.c +14 -12
index b3566f6b6b81427609829720496e80bea7cfeef7..1ea804ad549e23f767633e07efdd9adf1277af18 100644
@@ -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);
 	}
 }
 
Signature · 1 line
2.53.0.1213.gd9a14994de-goog
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · 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

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

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

---

Thanks, Eric!

neal

#2 lore raw
In reply to Eric Dumazet
This patch was applied to iproute2/iproute2-next.git (main) by David Ahern <[email protected]>:

Hello:

This patch was applied to iproute2/iproute2-next.git (main) by David Ahern <[email protected]>:

Quoted 11 lines · On Fri, 3 Apr 2026 10:23:09 +0000 you wrote:

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

[...]

Here is the summary with links:
- [iproute2-next] ss: add support for TCP delack timers

    https://git.kernel.org/pub/scm/network/iproute2/iproute2-next.git/commit/?id=37c010d59a44

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html