tcp: add tcpi_bytes_acked to tcp_info
authorEric Dumazet <edumazet@google.com>
Tue, 28 Apr 2015 22:28:17 +0000 (15:28 -0700)
committerDanny Wood <danwood76@gmail.com>
Thu, 15 Jul 2021 09:45:35 +0000 (10:45 +0100)
commit12ead65060709ac8fc8ce57924596684ebee9ff1
tree1de8ccbecc0206eb92a7d514fa6925f82f29a268
parent3103487194fdff94a3598615b3fd4fd315dd6ea4
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>
Change-Id: I4c65cc5034eb486ebd6c36783b35cab3d311be34
include/linux/tcp.h
include/net/tcp.h
include/uapi/linux/tcp.h
net/ipv4/tcp.c
net/ipv4/tcp_input.c