diff options
author | David S. Miller <davem@davemloft.net> | 2018-08-01 09:56:11 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-08-01 09:56:11 -0700 |
commit | fab9593df10691b02da99b5ce9ed6930c020eedc (patch) | |
tree | 5debcce08aca141b24d1a5c9875d73cae07f3394 /net/ipv4/tcp_output.c | |
parent | 53dd9652b5f530da2739298025c8324b6a4d0f21 (diff) | |
parent | 7ec65372ca534217b53fd208500cf7aac223a383 (diff) | |
download | linux-fab9593df10691b02da99b5ce9ed6930c020eedc.tar.bz2 |
Merge branch 'tcp-add-4-new-stats'
Wei Wang says:
====================
tcp: add 4 new stats
This patch series adds 3 RFC4898 stats:
1. tcpEStatsPerfHCDataOctetsOut
2. tcpEStatsPerfOctetsRetrans
3. tcpEStatsStackDSACKDups
and an addtional stat to record the number of data packet reordering
events seen:
4. tcp_reord_seen
Together with the existing stats, application can use them to measure
the retransmission rate in bytes, exclude spurious retransmissions
reflected by DSACK, and keep track of the reordering events on live
connections.
In particular the networks with different MTUs make bytes-based loss stats
more useful. Google servers have been using these stats for many years to
instrument transport and network performance.
Note: The first patch is a refactor to add a helper to calculate
opt_stats size in order to make later changes cleaner.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_output.c')
-rw-r--r-- | net/ipv4/tcp_output.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 490df62f26d4..50cabf7656f3 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c @@ -1136,6 +1136,7 @@ static int __tcp_transmit_skb(struct sock *sk, struct sk_buff *skb, if (skb->len != tcp_header_size) { tcp_event_data_sent(tp, sk); tp->data_segs_out += tcp_skb_pcount(skb); + tp->bytes_sent += skb->len - tcp_header_size; tcp_internal_pacing(sk, skb); } @@ -2870,6 +2871,7 @@ int __tcp_retransmit_skb(struct sock *sk, struct sk_buff *skb, int segs) if (TCP_SKB_CB(skb)->tcp_flags & TCPHDR_SYN) __NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPSYNRETRANS); tp->total_retrans += segs; + tp->bytes_retrans += skb->len; /* make sure skb->data is aligned on arches that require it * and check if ack-trimming & collapsing extended the headroom |