All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Heffner <jheffner@psc.edu>
To: Stephen Hemminger <shemminger@osdl.org>
Cc: David Miller <davem@davemloft.net>, netdev <netdev@vger.kernel.org>
Subject: Re: simplify microsecond rtt sampling
Date: Wed, 27 Sep 2006 12:21:45 +0100	[thread overview]
Message-ID: <451A5EC9.6090001@psc.edu> (raw)

[-- Attachment #1: Type: text/plain, Size: 488 bytes --]

About commit 2d2abbab63f6726a147ae61ada39bf2c9ee0db9a:

It looks like this patch bypassed the enforcement of Karn's algorithm in 
tcp_ack_no_tstamp() for the purposes of usec RTT sampling used by 
congestion control modules.  This will give them bad RTT data when there 
are retransmits.  I haven't actually observed this, but it seems like it 
would be the case. ;)  Please correct me if I'm wrong.

Here's a patch that should be a fix.



Signed-off-by: John Heffner <jheffner@psc.edu>

[-- Attachment #2: rtt_sample_fix.patch --]
[-- Type: text/plain, Size: 1061 bytes --]

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 159fa3f..725c868 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -2306,8 +2306,6 @@ static int tcp_clean_rtx_queue(struct so
 				seq_rtt = -1;
 			} else if (seq_rtt < 0) {
 				seq_rtt = now - scb->when;
-				if (rtt_sample)
-					(*rtt_sample)(sk, tcp_usrtt(skb));
 			}
 			if (sacked & TCPCB_SACKED_ACKED)
 				tp->sacked_out -= tcp_skb_pcount(skb);
@@ -2320,8 +2318,6 @@ static int tcp_clean_rtx_queue(struct so
 			}
 		} else if (seq_rtt < 0) {
 			seq_rtt = now - scb->when;
-			if (rtt_sample)
-				(*rtt_sample)(sk, tcp_usrtt(skb));
 		}
 		tcp_dec_pcount_approx(&tp->fackets_out, skb);
 		tcp_packets_out_dec(tp, skb);
@@ -2333,6 +2329,8 @@ static int tcp_clean_rtx_queue(struct so
 	if (acked&FLAG_ACKED) {
 		tcp_ack_update_rtt(sk, acked, seq_rtt);
 		tcp_ack_packets_out(sk, tp);
+		if (rtt_sample && !(acked & FLAG_RETRANS_DATA_ACKED))
+			(*rtt_sample)(sk, tcp_usrtt(skb));
 
 		if (icsk->icsk_ca_ops->pkts_acked)
 			icsk->icsk_ca_ops->pkts_acked(sk, pkts_acked);

             reply	other threads:[~2006-09-27 11:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-27 11:21 John Heffner [this message]
2006-09-27 15:13 ` simplify microsecond rtt sampling John Heffner
2006-09-28 12:35   ` John Heffner
2006-09-28 12:47     ` John Heffner
2006-09-28 16:36       ` Stephen Hemminger
2006-09-28 21:49         ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=451A5EC9.6090001@psc.edu \
    --to=jheffner@psc.edu \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=shemminger@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.