All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] tcp: use SACK RTTs for CC
@ 2015-01-29 19:08 Kenneth Klette Jonassen
  2015-01-30 17:21 ` Yuchung Cheng
  2015-02-01  1:26 ` David Miller
  0 siblings, 2 replies; 4+ messages in thread
From: Kenneth Klette Jonassen @ 2015-01-29 19:08 UTC (permalink / raw)
  To: netdev; +Cc: Kenneth Klette Jonassen

Current behavior only passes RTTs from sequentially acked data to CC.

If sender gets a combined ACK for segment 1 and SACK for segment 3, then the
computed RTT for CC is the time between sending segment 1 and receiving SACK
for segment 3.

Pass the minimum computed RTT from any acked data to CC, i.e. time between
sending segment 3 and receiving SACK for segment 3.

Signed-off-by: Kenneth Klette Jonassen <kennetkl@ifi.uio.no>
---
 net/ipv4/tcp_input.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 71fb37c..ed11931 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -3183,8 +3183,10 @@ static int tcp_clean_rtx_queue(struct sock *sk, int prior_fackets,
 
 		tp->fackets_out -= min(pkts_acked, tp->fackets_out);
 
-		if (ca_ops->pkts_acked)
-			ca_ops->pkts_acked(sk, pkts_acked, ca_seq_rtt_us);
+		if (ca_ops->pkts_acked) {
+			long rtt_us = min_t(ulong, ca_seq_rtt_us, sack_rtt_us);
+			ca_ops->pkts_acked(sk, pkts_acked, rtt_us);
+		}
 
 	} else if (skb && rtt_update && sack_rtt_us >= 0 &&
 		   sack_rtt_us > skb_mstamp_us_delta(&now, &skb->skb_mstamp)) {
-- 
1.9.1

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

* Re: [PATCH net-next] tcp: use SACK RTTs for CC
  2015-01-29 19:08 [PATCH net-next] tcp: use SACK RTTs for CC Kenneth Klette Jonassen
@ 2015-01-30 17:21 ` Yuchung Cheng
  2015-01-30 17:47   ` Yuchung Cheng
  2015-02-01  1:26 ` David Miller
  1 sibling, 1 reply; 4+ messages in thread
From: Yuchung Cheng @ 2015-01-30 17:21 UTC (permalink / raw)
  To: Kenneth Klette Jonassen; +Cc: netdev, Neal Cardwell

On Thu, Jan 29, 2015 at 11:08 AM, Kenneth Klette Jonassen
<kennetkl@ifi.uio.no> wrote:
> Current behavior only passes RTTs from sequentially acked data to CC.
>
> If sender gets a combined ACK for segment 1 and SACK for segment 3, then the
> computed RTT for CC is the time between sending segment 1 and receiving SACK
> for segment 3.
since segment 3 is sent after segment 1, sack_rtt_us <= ca_seq_rtt so
taking a min is not necessary?

>
> Pass the minimum computed RTT from any acked data to CC, i.e. time between
> sending segment 3 and receiving SACK for segment 3.
>
> Signed-off-by: Kenneth Klette Jonassen <kennetkl@ifi.uio.no>
> ---
>  net/ipv4/tcp_input.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
> index 71fb37c..ed11931 100644
> --- a/net/ipv4/tcp_input.c
> +++ b/net/ipv4/tcp_input.c
> @@ -3183,8 +3183,10 @@ static int tcp_clean_rtx_queue(struct sock *sk, int prior_fackets,
>
>                 tp->fackets_out -= min(pkts_acked, tp->fackets_out);
>
> -               if (ca_ops->pkts_acked)
> -                       ca_ops->pkts_acked(sk, pkts_acked, ca_seq_rtt_us);
> +               if (ca_ops->pkts_acked) {
> +                       long rtt_us = min_t(ulong, ca_seq_rtt_us, sack_rtt_us);
> +                       ca_ops->pkts_acked(sk, pkts_acked, rtt_us);
> +               }
>
>         } else if (skb && rtt_update && sack_rtt_us >= 0 &&
>                    sack_rtt_us > skb_mstamp_us_delta(&now, &skb->skb_mstamp)) {
> --
> 1.9.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH net-next] tcp: use SACK RTTs for CC
  2015-01-30 17:21 ` Yuchung Cheng
@ 2015-01-30 17:47   ` Yuchung Cheng
  0 siblings, 0 replies; 4+ messages in thread
From: Yuchung Cheng @ 2015-01-30 17:47 UTC (permalink / raw)
  To: Kenneth Klette Jonassen; +Cc: netdev, Neal Cardwell

On Fri, Jan 30, 2015 at 9:21 AM, Yuchung Cheng <ycheng@google.com> wrote:
> On Thu, Jan 29, 2015 at 11:08 AM, Kenneth Klette Jonassen
> <kennetkl@ifi.uio.no> wrote:
>> Current behavior only passes RTTs from sequentially acked data to CC.
>>
>> If sender gets a combined ACK for segment 1 and SACK for segment 3, then the
>> computed RTT for CC is the time between sending segment 1 and receiving SACK
>> for segment 3.
> since segment 3 is sent after segment 1, sack_rtt_us <= ca_seq_rtt so
> taking a min is not necessary?
ah i didn't notice you are taking a min_t of ulong for invalid
sack_rtt_us now i get it.


>
>>
>> Pass the minimum computed RTT from any acked data to CC, i.e. time between
>> sending segment 3 and receiving SACK for segment 3.
>>
>> Signed-off-by: Kenneth Klette Jonassen <kennetkl@ifi.uio.no>
>> ---
>>  net/ipv4/tcp_input.c | 6 ++++--
>>  1 file changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
>> index 71fb37c..ed11931 100644
>> --- a/net/ipv4/tcp_input.c
>> +++ b/net/ipv4/tcp_input.c
>> @@ -3183,8 +3183,10 @@ static int tcp_clean_rtx_queue(struct sock *sk, int prior_fackets,
>>
>>                 tp->fackets_out -= min(pkts_acked, tp->fackets_out);
>>
>> -               if (ca_ops->pkts_acked)
>> -                       ca_ops->pkts_acked(sk, pkts_acked, ca_seq_rtt_us);
>> +               if (ca_ops->pkts_acked) {
>> +                       long rtt_us = min_t(ulong, ca_seq_rtt_us, sack_rtt_us);
>> +                       ca_ops->pkts_acked(sk, pkts_acked, rtt_us);
>> +               }
>>
>>         } else if (skb && rtt_update && sack_rtt_us >= 0 &&
>>                    sack_rtt_us > skb_mstamp_us_delta(&now, &skb->skb_mstamp)) {
>> --
>> 1.9.1
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe netdev" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH net-next] tcp: use SACK RTTs for CC
  2015-01-29 19:08 [PATCH net-next] tcp: use SACK RTTs for CC Kenneth Klette Jonassen
  2015-01-30 17:21 ` Yuchung Cheng
@ 2015-02-01  1:26 ` David Miller
  1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2015-02-01  1:26 UTC (permalink / raw)
  To: kennetkl; +Cc: netdev

From: Kenneth Klette Jonassen <kennetkl@ifi.uio.no>
Date: Thu, 29 Jan 2015 20:08:03 +0100

> Current behavior only passes RTTs from sequentially acked data to CC.
> 
> If sender gets a combined ACK for segment 1 and SACK for segment 3, then the
> computed RTT for CC is the time between sending segment 1 and receiving SACK
> for segment 3.
> 
> Pass the minimum computed RTT from any acked data to CC, i.e. time between
> sending segment 3 and receiving SACK for segment 3.
> 
> Signed-off-by: Kenneth Klette Jonassen <kennetkl@ifi.uio.no>

Applied, thanks.

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

end of thread, other threads:[~2015-02-01  1:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-29 19:08 [PATCH net-next] tcp: use SACK RTTs for CC Kenneth Klette Jonassen
2015-01-30 17:21 ` Yuchung Cheng
2015-01-30 17:47   ` Yuchung Cheng
2015-02-01  1:26 ` David Miller

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.