]> git.karo-electronics.de Git - karo-tx-linux.git/commit
tcp: fix tcp_rcv_rtt_update() use of an unscaled RTT sample
authorNeal Cardwell <ncardwell@google.com>
Tue, 10 Apr 2012 07:59:20 +0000 (07:59 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Apr 2012 17:17:04 +0000 (10:17 -0700)
commit8607ccff19e16b51feab33664425e5984f751074
treefee8a4f7f0a2bb5e90907a306fe876dde6f4bdfb
parentce30c9603e01ed68e7536a0936f30ec047acd57f
tcp: fix tcp_rcv_rtt_update() use of an unscaled RTT sample

[ Upstream commit 18a223e0b9ec8979320ba364b47c9772391d6d05 ]

Fix a code path in tcp_rcv_rtt_update() that was comparing scaled and
unscaled RTT samples.

The intent in the code was to only use the 'm' measurement if it was a
new minimum.  However, since 'm' had not yet been shifted left 3 bits
but 'new_sample' had, this comparison would nearly always succeed,
leading us to erroneously set our receive-side RTT estimate to the 'm'
sample when that sample could be nearly 8x too high to use.

The overall effect is to often cause the receive-side RTT estimate to
be significantly too large (up to 40% too large for brief periods in
my tests).

Signed-off-by: Neal Cardwell <ncardwell@google.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/ipv4/tcp_input.c