History

tcp: add tcpi_bytes_received to tcp_info

This patch tracks total number of payload bytes received on a TCP socket. This is the sum of all changes done to tp->rcv_nxt RFC4898 named this : tcpEStatsAppHCThruOctetsReceived This is a 64bit field, and can be fetched both from TCP_INFO getsockopt() if one has a handle on a TCP socket, or from inet_diag netlink facility (iproute2/ss patch will follow) Note that tp->bytes_received was placed near tp->rcv_nxt for best data locality and minimal performance impact.

Eric Dumazet committed 11 years ago

Commit bdd1f9e1 parent 0df48c25 files · +20 −4Browse files

Showing the changes to include/uapi/linux (1 of 5 files). Show all

Unified · Split

include/uapi/linux/tcp.h+1−0
@@ -190,6 +190,7 @@ struct tcp_info { · 189 unmodified lines
190190 __u64 tcpi_pacing_rate;
191191 __u64 tcpi_max_pacing_rate;
192192 __u64 tcpi_bytes_acked; /* RFC4898 tcpEStatsAppHCThruOctetsAcked */
193+ __u64 tcpi_bytes_received; /* RFC4898 tcpEStatsAppHCThruOctetsReceived */
193194 };
194195
195196 /* for TCP_MD5SIG socket option */