netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: LovelyLich <lovelylich@gmail.com>, Yuchung Cheng <ycheng@google.com>
Cc: netdev@vger.kernel.org
Subject: Re: Why we discard all rtt samples when only some of the acked skbs have been retransmited in processing ack?
Date: Mon, 16 Sep 2013 22:11:22 -0700	[thread overview]
Message-ID: <1379394682.29845.2.camel@edumazet-glaptop> (raw)
In-Reply-To: <CAAA3+BpsxtyM2uAvX6B4ys73ZC6fX5K1ib3Acsk0fp5cQBNgWg@mail.gmail.com>

On Tue, 2013-09-17 at 12:01 +0800, LovelyLich wrote:
> Hi Eric,
> 
> In tcp_clean_rtx_queue(), we set the flag FLAG_RETRANS_DATA_ACKED when we
> 
> encounter one ever retransmited skb A. But if there is one( or more) skb B
> 
> after this retransmited skb, and we calculate the rtt for skb B. The question
> 
> is because we have set the flag FLAG_RETRANS_DATA_ACKED, and we will just
> 
> return in tcp_ack_no_tstamp() !
> 
> Two questions:
> 
> 1. if we will just ignore all packets in this ack, we do not need to calculate
> 
> skb B's rtt sample.
> 
> 2. what I want to know, even if A's rtt sample is not reliable, but B's rtt
> 
> sample can be trusted. Why we discard it ?
> 
> 
> 
> Thanks in advanced.
> 

Good point !

Yuchung, what do you think of following patch ?

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 25a89ea..7f12b96 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -2971,7 +2971,7 @@ static int tcp_clean_rtx_queue(struct sock *sk, int prior_fackets,
 	struct sk_buff *skb;
 	u32 now = tcp_time_stamp;
 	int fully_acked = true;
-	int flag = 0;
+	int flag = FLAG_RETRANS_DATA_ACKED;
 	u32 pkts_acked = 0;
 	u32 reord = tp->packets_out;
 	u32 prior_sacked = tp->sacked_out;
@@ -3002,7 +3002,6 @@ static int tcp_clean_rtx_queue(struct sock *sk, int prior_fackets,
 		if (sacked & TCPCB_RETRANS) {
 			if (sacked & TCPCB_SACKED_RETRANS)
 				tp->retrans_out -= acked_pcount;
-			flag |= FLAG_RETRANS_DATA_ACKED;
 		} else {
 			ca_seq_rtt = now - scb->when;
 			last_ackt = skb->tstamp;
@@ -3013,6 +3012,7 @@ static int tcp_clean_rtx_queue(struct sock *sk, int prior_fackets,
 				reord = min(pkts_acked, reord);
 			if (!after(scb->end_seq, tp->high_seq))
 				flag |= FLAG_ORIG_SACK_ACKED;
+			flag &= ~FLAG_RETRANS_DATA_ACKED;
 		}
 
 		if (sacked & TCPCB_SACKED_ACKED)

  reply	other threads:[~2013-09-17  5:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-17  4:01 Why we discard all rtt samples when only some of the acked skbs have been retransmited in processing ack? LovelyLich
2013-09-17  5:11 ` Eric Dumazet [this message]
2013-09-17 13:31   ` Neal Cardwell
2013-09-17 14:53     ` Yuchung Cheng

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=1379394682.29845.2.camel@edumazet-glaptop \
    --to=eric.dumazet@gmail.com \
    --cc=lovelylich@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=ycheng@google.com \
    /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).