Commit 9daecfac authored by Konstantin Khlebnikov's avatar Konstantin Khlebnikov Committed by Kamal Mostafa

tcp: convert cached rtt from usec to jiffies when feeding initial rto

commit 9bdfb3b7 upstream.

Currently it's converted into msecs, thus HZ=1000 intact.
Signed-off-by: default avatarKonstantin Khlebnikov <khlebnikov@yandex-team.ru>
Fixes: 740b0f18 ("tcp: switch rtt estimations to usec resolution")
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
parent 3e8e505a
...@@ -550,7 +550,7 @@ void tcp_init_metrics(struct sock *sk) ...@@ -550,7 +550,7 @@ void tcp_init_metrics(struct sock *sk)
*/ */
if (crtt > tp->srtt_us) { if (crtt > tp->srtt_us) {
/* Set RTO like tcp_rtt_estimator(), but from cached RTT. */ /* 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)); inet_csk(sk)->icsk_rto = crtt + max(2 * crtt, tcp_rto_min(sk));
} else if (tp->srtt_us == 0) { } else if (tp->srtt_us == 0) {
/* RFC6298: 5.7 We've failed to get a valid RTT sample from /* RFC6298: 5.7 We've failed to get a valid RTT sample from
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment