]> git.baikalelectronics.ru Git - kernel.git/commit
tcp: include locally failed retries in retransmission stats
authorYuchung Cheng <ycheng@google.com>
Sat, 28 Jan 2017 00:24:39 +0000 (16:24 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 30 Jan 2017 00:17:23 +0000 (19:17 -0500)
commitc97c4dc0b456f4a299678f8349c046a9c808644a
treeed24210650990895c35fbae14f84237f8c0fccd2
parent167eddf7f45c1c77a7c5b122fdc9f09b953a4205
tcp: include locally failed retries in retransmission stats

Currently the retransmission stats are not incremented if the
retransmit fails locally. But we always increment the other packet
counters that track total packet/bytes sent.  Awkwardly while we
don't count these failed retransmits in RETRANSSEGS, we do count
them in FAILEDRETRANS.

If the qdisc is dropping many packets this could under-estimate
TCP retransmission rate substantially from both SNMP or per-socket
TCP_INFO stats. This patch changes this by always incrementing
retransmission stats on retransmission attempts and failures.

Another motivation is to properly track retransmists in
SCM_TIMESTAMPING_OPT_STATS. Since SCM_TSTAMP_SCHED collection is
triggered in tcp_transmit_skb(), If tp->total_retrans is incremented
after the function, we'll always mis-count by the amount of the
latest retransmission.

Signed-off-by: Yuchung Cheng <ycheng@google.com>
Signed-off-by: Soheil Hassas Yeganeh <soheil@google.com>
Acked-by: Neal Cardwell <ncardwell@google.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/tcp_output.c