Skip to content

Commit

Permalink
tcp: convert cached rtt from usec to jiffies when feeding initial rto
Browse files Browse the repository at this point in the history
Currently it's converted into msecs, thus HZ=1000 intact.

Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Fixes: 740b0f1 ("tcp: switch rtt estimations to usec resolution")
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Konstantin Khlebnikov authored and David S. Miller committed Feb 23, 2016
1 parent fb5eb24 commit 9bdfb3b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/ipv4/tcp_metrics.c
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ void tcp_init_metrics(struct sock *sk)
*/
if (crtt > tp->srtt_us) {
/* Set RTO like tcp_rtt_estimator(), but from cached RTT. */
crtt /= 8 * USEC_PER_MSEC;
crtt /= 8 * USEC_PER_SEC / HZ;
inet_csk(sk)->icsk_rto = crtt + max(2 * crtt, tcp_rto_min(sk));
} else if (tp->srtt_us == 0) {
/* RFC6298: 5.7 We've failed to get a valid RTT sample from
Expand Down

0 comments on commit 9bdfb3b

Please sign in to comment.