aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorNeal Cardwell <ncardwell@google.com>2013-09-16 21:44:20 -0400
committerDavid S. Miller <davem@davemloft.net>2013-09-17 19:08:08 -0400
commit269aa759b474570fa642452742741525cfc226a9 (patch)
tree00089098af219e1257caaf5c06835d3dbd6d043d /net
parent4bdf25976333ba435f7879b4487fe8aca799ac41 (diff)
tcp: fix RTO calculated from cached RTT
Commit 1b7fdd2ab5852 ("tcp: do not use cached RTT for RTT estimation") did not correctly account for the fact that crtt is the RTT shifted left 3 bits. Fix the calculation to consistently reflect this fact. Signed-off-by: Neal Cardwell <ncardwell@google.com> Cc: Eric Dumazet <edumazet@google.com> Cc: Yuchung Cheng <ycheng@google.com> Acked-by: Eric Dumazet <edumazet@google.com> Acked-By: Yuchung Cheng <ycheng@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/ipv4/tcp_metrics.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/ipv4/tcp_metrics.c b/net/ipv4/tcp_metrics.c
index 4a22f3e715df..52f3c6b971d2 100644
--- a/net/ipv4/tcp_metrics.c
+++ b/net/ipv4/tcp_metrics.c
@@ -502,7 +502,9 @@ reset:
502 * ACKs, wait for troubles. 502 * ACKs, wait for troubles.
503 */ 503 */
504 if (crtt > tp->srtt) { 504 if (crtt > tp->srtt) {
505 inet_csk(sk)->icsk_rto = crtt + max(crtt >> 2, tcp_rto_min(sk)); 505 /* Set RTO like tcp_rtt_estimator(), but from cached RTT. */
506 crtt >>= 3;
507 inet_csk(sk)->icsk_rto = crtt + max(2 * crtt, tcp_rto_min(sk));
506 } else if (tp->srtt == 0) { 508 } else if (tp->srtt == 0) {
507 /* RFC6298: 5.7 We've failed to get a valid RTT sample from 509 /* RFC6298: 5.7 We've failed to get a valid RTT sample from
508 * 3WHS. This is most likely due to retransmission, 510 * 3WHS. This is most likely due to retransmission,