Patchwork [1/6] tcp: fix RTT for quick packets in congestion control

mail settings
Submitter stephen hemminger
Date March 10, 2011, 4:51 p.m.
Message ID <>
Download mbox | patch
Permalink /patch/86312/
State Superseded
Delegated to: David Miller
Headers show


stephen hemminger - March 10, 2011, 4:51 p.m.
In the congestion control interface, the callback for each ACK
includes an estimated round trip time in microseconds.
Some algorithms need high resolution (Vegas style) but most only
need jiffie resolution.  If RTT is not accurate (like a retransmission)
-1 is used as a flag value.

When doing coarse resolution if RTT is less than a a jiffie
then 0 should be returned rather than no estimate. Otherwise algorithms
that expect good ack's to trigger slow start (like CUBIC Hystart)
will be confused.

Signed-off-by: Stephen Hemminger <>

To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to
More majordomo info at


--- a/net/ipv4/tcp_input.c	2011-03-08 11:11:26.093183654 -0800
+++ b/net/ipv4/tcp_input.c	2011-03-08 11:11:46.641404939 -0800
@@ -3350,7 +3350,7 @@  static int tcp_clean_rtx_queue(struct so
 					rtt_us = ktime_us_delta(ktime_get_real(),
-				else if (ca_seq_rtt > 0)
+				else if (ca_seq_rtt >= 0)
 					rtt_us = jiffies_to_usecs(ca_seq_rtt);