ss: add support for delivered and delivered_ce fields

Kernel support was added in linux-4.18 in commit feb5f2ec6464
("tcp: export packets delivery info")

Tested:

ss -ti
...
ESTAB   0 2270520      [2607:f8b0:8099:e16::]:47646   [2607:f8b0:8099:e18::]:38953
	 ts sack cubic wscale:8,8 rto:7 rtt:2.824/0.278 mss:1428
     pmtu:1500 rcvmss:536 advmss:1428 cwnd:89 ssthresh:62 bytes_acked:2097871945
    segs_out:1469144 segs_in:65221 data_segs_out:1469142 send 360.0Mbps lastsnd:2
    lastrcv:99231 lastack:2 pacing_rate 431.9Mbps delivery_rate 246.4Mbps
(*) delivered:1469099 delivered_ce:424799
    busy:99231ms unacked:44 rcv_space:14280 rcv_ssthresh:65535
    notsent:2207688 minrtt:0.228

Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Yuchung Cheng <ycheng@google.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
This commit is contained in:
Eric Dumazet 2018-11-26 14:29:53 -08:00 committed by Stephen Hemminger
parent b2ec8f4314
commit 2f4d834b99
1 changed files with 8 additions and 0 deletions

View File

@ -817,6 +817,8 @@ struct tcpstat {
unsigned int fackets;
unsigned int reordering;
unsigned int not_sent;
unsigned int delivered;
unsigned int delivered_ce;
double rcv_rtt;
double min_rtt;
int rcv_space;
@ -2483,6 +2485,10 @@ static void tcp_stats_print(struct tcpstat *s)
if (s->delivery_rate)
out(" delivery_rate %sbps", sprint_bw(b1, s->delivery_rate));
if (s->delivered)
out(" delivered:%u", s->delivered);
if (s->delivered_ce)
out(" delivered_ce:%u", s->delivered_ce);
if (s->app_limited)
out(" app_limited");
@ -2829,6 +2835,8 @@ static void tcp_show_info(const struct nlmsghdr *nlh, struct inet_diag_msg *r,
s.busy_time = info->tcpi_busy_time;
s.rwnd_limited = info->tcpi_rwnd_limited;
s.sndbuf_limited = info->tcpi_sndbuf_limited;
s.delivered = info->tcpi_delivered;
s.delivered_ce = info->tcpi_delivered_ce;
tcp_stats_print(&s);
free(s.dctcp);
free(s.bbr_info);