Skip to content

Commit

Permalink
tcp: add pacing_rate information into tcp_info
Browse files Browse the repository at this point in the history
Add two new fields to struct tcp_info, to report sk_pacing_rate
and sk_max_pacing_rate to monitoring applications, as ss from iproute2.

User exported fields are 64bit, even if kernel is currently using 32bit
fields.

lpaa5:~# ss -i
..
	 skmem:(r0,rb357120,t0,tb2097152,f1584,w1980880,o0,bl0) ts sack cubic
wscale:6,6 rto:400 rtt:0.875/0.75 mss:1448 cwnd:1 ssthresh:12 send
13.2Mbps pacing_rate 3336.2Mbps unacked:15 retrans:1/5448 lost:15
rcv_space:29200

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Feb 14, 2014
1 parent 1c213bd commit 977cb0e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions include/uapi/linux/tcp.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,9 @@ struct tcp_info {
__u32 tcpi_rcv_space;

__u32 tcpi_total_retrans;

__u64 tcpi_pacing_rate;
__u64 tcpi_max_pacing_rate;
};

/* for TCP_MD5SIG socket option */
Expand Down
5 changes: 5 additions & 0 deletions net/ipv4/tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2794,6 +2794,11 @@ void tcp_get_info(const struct sock *sk, struct tcp_info *info)
info->tcpi_rcv_space = tp->rcvq_space.space;

info->tcpi_total_retrans = tp->total_retrans;

info->tcpi_pacing_rate = sk->sk_pacing_rate != ~0U ?
sk->sk_pacing_rate : ~0ULL;
info->tcpi_max_pacing_rate = sk->sk_max_pacing_rate != ~0U ?
sk->sk_max_pacing_rate : ~0ULL;
}
EXPORT_SYMBOL_GPL(tcp_get_info);

Expand Down

0 comments on commit 977cb0e

Please sign in to comment.