aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2015-04-28 18:28:17 -0400
committerDavid S. Miller <davem@davemloft.net>2015-04-29 17:10:37 -0400
commit0df48c26d8418c5c9fba63fac15b660d70ca2f1c (patch)
tree3dbdd83937001fde41106b43cae4a3cd1a84bdd0 /include
parent2decb2682f80759f631c8332f9a2a34a02150a03 (diff)
tcp: add tcpi_bytes_acked to tcp_info
This patch tracks total number of bytes acked for a TCP socket. This is the sum of all changes done to tp->snd_una, and allows for precise tracking of delivered data. RFC4898 named this : tcpEStatsAppHCThruOctetsAcked 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_acked was placed near tp->snd_una for best data locality and minimal performance impact. Signed-off-by: Eric Dumazet <edumazet@google.com> Acked-by: Yuchung Cheng <ycheng@google.com> Cc: Matt Mathis <mattmathis@google.com> Cc: Eric Salo <salo@google.com> Cc: Martin Lau <kafai@fb.com> Cc: Chris Rapier <rapier@psc.edu> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/linux/tcp.h4
-rw-r--r--include/net/tcp.h2
-rw-r--r--include/uapi/linux/tcp.h1
3 files changed, 6 insertions, 1 deletions
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index 0caa3a2d4106..0f73b43171da 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -150,6 +150,10 @@ struct tcp_sock {
150 u32 rcv_wup; /* rcv_nxt on last window update sent */ 150 u32 rcv_wup; /* rcv_nxt on last window update sent */
151 u32 snd_nxt; /* Next sequence we send */ 151 u32 snd_nxt; /* Next sequence we send */
152 152
153 u64 bytes_acked; /* RFC4898 tcpEStatsAppHCThruOctetsAcked
154 * sum(delta(snd_una)), or how many bytes
155 * were acked.
156 */
153 u32 snd_una; /* First byte we want an ack for */ 157 u32 snd_una; /* First byte we want an ack for */
154 u32 snd_sml; /* Last byte of the most recently transmitted small packet */ 158 u32 snd_sml; /* Last byte of the most recently transmitted small packet */
155 u32 rcv_tstamp; /* timestamp of last received ACK (for keepalives) */ 159 u32 rcv_tstamp; /* timestamp of last received ACK (for keepalives) */
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 051dc5c2802d..dd7b4ea6a10c 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -576,7 +576,7 @@ static inline int tcp_bound_to_half_wnd(struct tcp_sock *tp, int pktsize)
576} 576}
577 577
578/* tcp.c */ 578/* tcp.c */
579void tcp_get_info(const struct sock *, struct tcp_info *); 579void tcp_get_info(struct sock *, struct tcp_info *);
580 580
581/* Read 'sendfile()'-style from a TCP socket */ 581/* Read 'sendfile()'-style from a TCP socket */
582typedef int (*sk_read_actor_t)(read_descriptor_t *, struct sk_buff *, 582typedef int (*sk_read_actor_t)(read_descriptor_t *, struct sk_buff *,
diff --git a/include/uapi/linux/tcp.h b/include/uapi/linux/tcp.h
index 3b9718328d8b..6666e98a0af9 100644
--- a/include/uapi/linux/tcp.h
+++ b/include/uapi/linux/tcp.h
@@ -189,6 +189,7 @@ struct tcp_info {
189 189
190 __u64 tcpi_pacing_rate; 190 __u64 tcpi_pacing_rate;
191 __u64 tcpi_max_pacing_rate; 191 __u64 tcpi_max_pacing_rate;
192 __u64 tcpi_bytes_acked; /* RFC4898 tcpEStatsAppHCThruOctetsAcked */
192}; 193};
193 194
194/* for TCP_MD5SIG socket option */ 195/* for TCP_MD5SIG socket option */