]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
ss: add report of TCPI_OPT_USEC_TS
authorEric Dumazet <edumazet@google.com>
Mon, 4 Dec 2023 09:19:08 +0000 (09:19 +0000)
committerDavid Ahern <dsahern@kernel.org>
Wed, 6 Dec 2023 16:51:35 +0000 (16:51 +0000)
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>
Signed-off-by: David Ahern <dsahern@kernel.org>
misc/ss.c

index 9438382b8e667529dc2cf4b020d8696a4175e992..3dacee48db0f805b3a7a3bd213771b86eceea1ab 100644 (file)
--- 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);