tcp: fix reordering SNMP under-counting
authorYuchung Cheng <ycheng@google.com>
Tue, 4 Apr 2017 21:15:40 +0000 (14:15 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 6 Apr 2017 01:41:27 +0000 (18:41 -0700)
commit2d2517ee314ef1de0517f74d06c2825fbf597ba3
tree50f26c23c14c62b33bd884da0a6715f310b3c90c
parentecde8f36f8a05a023b9d026e9094571aab421d36
tcp: fix reordering SNMP under-counting

Currently the reordering SNMP counters only increase if a connection
sees a higher degree then it has previously seen. It ignores if the
reordering degree is not greater than the default system threshold.
This significantly under-counts the number of reordering events
and falsely convey that reordering is rare on the network.

This patch properly and faithfully records the number of reordering
events detected by the TCP stack, just like the comment says "this
exciting event is worth to be remembered". Note that even so TCP
still under-estimate the actual reordering events because TCP
requires TS options or certain packet sequences to detect reordering
(i.e. ACKing never-retransmitted sequence in recovery or disordered
 state).

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