netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] tcp: only take RTT from timestamps if new data is acked
@ 2013-10-24 15:55 Yuchung Cheng
  2013-10-24 17:02 ` Neal Cardwell
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Yuchung Cheng @ 2013-10-24 15:55 UTC (permalink / raw)
  To: davem, ncardwell, edumazet; +Cc: netdev, Yuchung Cheng

Patch ed08495c3 "tcp: use RTT from SACK for RTO" has a bug that
it does not check if the ACK acknowledge new data before taking
the RTT sample from TCP timestamps. This patch adds the check
back as required by the RFC.

Signed-off-by: Yuchung Cheng <ycheng@google.com>
---
 net/ipv4/tcp_input.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 305cd05..6ffe41a 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -2856,7 +2856,8 @@ static inline bool tcp_ack_update_rtt(struct sock *sk, const int flag,
 	 * left edge of the send window.
 	 * See draft-ietf-tcplw-high-performance-00, section 3.3.
 	 */
-	if (seq_rtt < 0 && tp->rx_opt.saw_tstamp && tp->rx_opt.rcv_tsecr)
+	if (seq_rtt < 0 && tp->rx_opt.saw_tstamp && tp->rx_opt.rcv_tsecr &&
+	    flag & FLAG_ACKED)
 		seq_rtt = tcp_time_stamp - tp->rx_opt.rcv_tsecr;
 
 	if (seq_rtt < 0)
-- 
1.8.4.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net] tcp: only take RTT from timestamps if new data is acked
  2013-10-24 15:55 [PATCH net] tcp: only take RTT from timestamps if new data is acked Yuchung Cheng
@ 2013-10-24 17:02 ` Neal Cardwell
  2013-10-24 19:55 ` Eric Dumazet
  2013-10-27 20:51 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Neal Cardwell @ 2013-10-24 17:02 UTC (permalink / raw)
  To: Yuchung Cheng; +Cc: David Miller, Eric Dumazet, Netdev

On Thu, Oct 24, 2013 at 11:55 AM, Yuchung Cheng <ycheng@google.com> wrote:
> Patch ed08495c3 "tcp: use RTT from SACK for RTO" has a bug that
> it does not check if the ACK acknowledge new data before taking
> the RTT sample from TCP timestamps. This patch adds the check
> back as required by the RFC.
>
> Signed-off-by: Yuchung Cheng <ycheng@google.com>
> ---
>  net/ipv4/tcp_input.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Acked-by: Neal Cardwell <ncardwell@google.com>

neal

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net] tcp: only take RTT from timestamps if new data is acked
  2013-10-24 15:55 [PATCH net] tcp: only take RTT from timestamps if new data is acked Yuchung Cheng
  2013-10-24 17:02 ` Neal Cardwell
@ 2013-10-24 19:55 ` Eric Dumazet
  2013-10-27 20:51 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Eric Dumazet @ 2013-10-24 19:55 UTC (permalink / raw)
  To: Yuchung Cheng; +Cc: davem, ncardwell, edumazet, netdev

On Thu, 2013-10-24 at 08:55 -0700, Yuchung Cheng wrote:
> Patch ed08495c3 "tcp: use RTT from SACK for RTO" has a bug that
> it does not check if the ACK acknowledge new data before taking
> the RTT sample from TCP timestamps. This patch adds the check
> back as required by the RFC.
> 
> Signed-off-by: Yuchung Cheng <ycheng@google.com>
> ---
>  net/ipv4/tcp_input.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
> index 305cd05..6ffe41a 100644
> --- a/net/ipv4/tcp_input.c
> +++ b/net/ipv4/tcp_input.c
> @@ -2856,7 +2856,8 @@ static inline bool tcp_ack_update_rtt(struct sock *sk, const int flag,
>  	 * left edge of the send window.
>  	 * See draft-ietf-tcplw-high-performance-00, section 3.3.
>  	 */
> -	if (seq_rtt < 0 && tp->rx_opt.saw_tstamp && tp->rx_opt.rcv_tsecr)
> +	if (seq_rtt < 0 && tp->rx_opt.saw_tstamp && tp->rx_opt.rcv_tsecr &&
> +	    flag & FLAG_ACKED)
>  		seq_rtt = tcp_time_stamp - tp->rx_opt.rcv_tsecr;
>  
>  	if (seq_rtt < 0)

Acked-by: Eric Dumazet <edumazet@google.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net] tcp: only take RTT from timestamps if new data is acked
  2013-10-24 15:55 [PATCH net] tcp: only take RTT from timestamps if new data is acked Yuchung Cheng
  2013-10-24 17:02 ` Neal Cardwell
  2013-10-24 19:55 ` Eric Dumazet
@ 2013-10-27 20:51 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2013-10-27 20:51 UTC (permalink / raw)
  To: ycheng; +Cc: ncardwell, edumazet, netdev

From: Yuchung Cheng <ycheng@google.com>
Date: Thu, 24 Oct 2013 08:55:25 -0700

> Patch ed08495c3 "tcp: use RTT from SACK for RTO" has a bug that
> it does not check if the ACK acknowledge new data before taking
> the RTT sample from TCP timestamps. This patch adds the check
> back as required by the RFC.
> 
> Signed-off-by: Yuchung Cheng <ycheng@google.com>

Applied and queued up for -stable.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-10-27 20:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-24 15:55 [PATCH net] tcp: only take RTT from timestamps if new data is acked Yuchung Cheng
2013-10-24 17:02 ` Neal Cardwell
2013-10-24 19:55 ` Eric Dumazet
2013-10-27 20:51 ` David Miller

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).