netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gavin McCullagh <Gavin.McCullagh@nuim.ie>
To: netdev@vger.kernel.org
Subject: Re: [PATCH/RFC] [v2] TCP: use non-delayed ACK for congestion	control RTT
Date: Tue, 18 Dec 2007 20:40:22 +0000	[thread overview]
Message-ID: <20071218204022.GA8936@nuim.ie> (raw)
In-Reply-To: <20071217134425.GD7409@nuim.ie>


The last attempt didn't take account of the situation where a timestamp
wasn't available and tcp_clean_rtx_queue() has to feed both the RTO and the
congestion avoidance.  This updated patch stores both RTTs, making the
delayed one available for the RTO and the other (ca_seq_rtt) available for
congestion control.


Signed-off-by: Gavin McCullagh <gavin.mccullagh@nuim.ie> 


diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 889c893..6fb7989 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -2651,6 +2651,7 @@ static int tcp_clean_rtx_queue(struct sock *sk, s32 *seq_rtt_p,
 	u32 cnt = 0;
 	u32 reord = tp->packets_out;
 	s32 seq_rtt = -1;
+	s32 ca_seq_rtt = -1;
 	ktime_t last_ackt = net_invalid_timestamp();
 
 	while ((skb = tcp_write_queue_head(sk)) && skb != tcp_send_head(sk)) {
@@ -2686,13 +2687,15 @@ static int tcp_clean_rtx_queue(struct sock *sk, s32 *seq_rtt_p,
 				if (sacked & TCPCB_SACKED_RETRANS)
 					tp->retrans_out -= packets_acked;
 				flag |= FLAG_RETRANS_DATA_ACKED;
+				ca_seq_rtt = -1;
 				seq_rtt = -1;
 				if ((flag & FLAG_DATA_ACKED) ||
 				    (packets_acked > 1))
 					flag |= FLAG_NONHEAD_RETRANS_ACKED;
 			} else {
+				ca_seq_rtt = now - scb->when;
 				if (seq_rtt < 0) {
-					seq_rtt = now - scb->when;
+					seq_rtt = ca_seq_rtt;
 					if (fully_acked)
 						last_ackt = skb->tstamp;
 				}
@@ -2709,8 +2712,9 @@ static int tcp_clean_rtx_queue(struct sock *sk, s32 *seq_rtt_p,
 			    !before(end_seq, tp->snd_up))
 				tp->urg_mode = 0;
 		} else {
+			ca_seq_rtt = now - scb->when;
 			if (seq_rtt < 0) {
-				seq_rtt = now - scb->when;
+				seq_rtt = ca_seq_rtt;
 				if (fully_acked)
 					last_ackt = skb->tstamp;
 			}
@@ -2772,8 +2776,8 @@ static int tcp_clean_rtx_queue(struct sock *sk, s32 *seq_rtt_p,
 						 net_invalid_timestamp()))
 					rtt_us = ktime_us_delta(ktime_get_real(),
 								last_ackt);
-				else if (seq_rtt > 0)
-					rtt_us = jiffies_to_usecs(seq_rtt);
+				else if (ca_seq_rtt > 0)
+					rtt_us = jiffies_to_usecs(ca_seq_rtt);
 			}
 
 			ca_ops->pkts_acked(sk, pkts_acked, rtt_us);



  reply	other threads:[~2007-12-18 20:40 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-17 13:44 [PATCH/RFC] TCP: use non-delayed ACK for congestion control RTT Gavin McCullagh
2007-12-18 20:40 ` Gavin McCullagh [this message]
2007-12-19 10:28   ` [PATCH/RFC] [v2] " Gavin McCullagh
2007-12-19 11:08   ` Ilpo Järvinen
2007-12-19 11:31     ` Gavin McCullagh
2007-12-19 13:30       ` Ilpo Järvinen
2007-12-21 11:14         ` David Miller
2007-12-21 13:31           ` Gavin McCullagh
2007-12-21 14:05             ` David Miller
2007-12-21 14:07             ` Ilpo Järvinen
2007-12-21 14:10               ` Ilpo Järvinen
2007-12-30  1:15               ` [PATCH/RFC] [v3] " Gavin McCullagh
2007-12-30  1:25                 ` Gavin McCullagh
2007-12-30  3:09                   ` David Miller
2007-12-30 12:20                     ` Gavin McCullagh
2007-12-30  3:06                 ` David Miller
2007-12-30  9:43                 ` Ilpo Järvinen
2007-12-30 12:35                   ` Gavin McCullagh

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=20071218204022.GA8936@nuim.ie \
    --to=gavin.mccullagh@nuim.ie \
    --cc=netdev@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).