Skip to contentSkip to conversation

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

PATCH In review Konstantin Khlebnikov 2 participants 2 messages Feb 21, 2016 – Feb 24, 2016

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

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

Currently it's converted into msecs, thus HZ=1000 intact.

Fixes 740b0f1841f6 ("tcp: switch rtt estimations to usec resolution")
---
 net/ipv4/tcp_metrics.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv4/tcp_metrics.c +1 -1
index c8cbc2b4b792..a726d7853ce5 100644
@@ -550,7 +550,7 @@ reset:
 	 */
 	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