aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_output.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2018-08-01 12:56:11 -0400
committerDavid S. Miller <davem@davemloft.net>2018-08-01 12:56:11 -0400
commitfab9593df10691b02da99b5ce9ed6930c020eedc (patch)
tree5debcce08aca141b24d1a5c9875d73cae07f3394 /net/ipv4/tcp_output.c
parent53dd9652b5f530da2739298025c8324b6a4d0f21 (diff)
parent7ec65372ca534217b53fd208500cf7aac223a383 (diff)
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.c2
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,
1136 if (skb->len != tcp_header_size) { 1136 if (skb->len != tcp_header_size) {
1137 tcp_event_data_sent(tp, sk); 1137 tcp_event_data_sent(tp, sk);
1138 tp->data_segs_out += tcp_skb_pcount(skb); 1138 tp->data_segs_out += tcp_skb_pcount(skb);
1139 tp->bytes_sent += skb->len - tcp_header_size;
1139 tcp_internal_pacing(sk, skb); 1140 tcp_internal_pacing(sk, skb);
1140 } 1141 }
1141 1142
@@ -2870,6 +2871,7 @@ int __tcp_retransmit_skb(struct sock *sk, struct sk_buff *skb, int segs)
2870 if (TCP_SKB_CB(skb)->tcp_flags & TCPHDR_SYN) 2871 if (TCP_SKB_CB(skb)->tcp_flags & TCPHDR_SYN)
2871 __NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPSYNRETRANS); 2872 __NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPSYNRETRANS);
2872 tp->total_retrans += segs; 2873 tp->total_retrans += segs;
2874 tp->bytes_retrans += skb->len;
2873 2875
2874 /* make sure skb->data is aligned on arches that require it 2876 /* make sure skb->data is aligned on arches that require it
2875 * and check if ack-trimming & collapsing extended the headroom 2877 * and check if ack-trimming & collapsing extended the headroom