* [PATCH net] tcp: initialize passive-side sk_pacing_rate after 3WHS
@ 2013-10-21 19:40 Neal Cardwell
2013-10-21 20:36 ` Eric Dumazet
0 siblings, 1 reply; 3+ messages in thread
From: Neal Cardwell @ 2013-10-21 19:40 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Neal Cardwell, Eric Dumazet, Yuchung Cheng
For passive TCP connections, upon receiving the ACK that completes the
3WHS, make sure we set our pacing rate after we get our first RTT
sample.
On passive TCP connections, when we receive the ACK completing the
3WHS we do not take an RTT sample in tcp_ack(), but rather in
tcp_synack_rtt_meas(). So upon receiving the ACK that completes the
3WHS, tcp_ack() leaves sk_pacing_rate at its initial value.
Originally the initial sk_pacing_rate value was 0, so passive-side
connections defaulted to sysctl_tcp_min_tso_segs (2 segs) in skbuffs
made in the first RTT. With a default initial cwnd of 10 packets, this
happened to be correct for RTTs 5ms or bigger, so it was hard to
see problems in WAN or emulated WAN testing.
Since 7eec4174ff ("pkt_sched: fq: fix non TCP flows pacing"), the
initial sk_pacing_rate is 0xffffffff. So after that change, passive
TCP connections were keeping this value (and using large numbers of
segments per skbuff) until receiving an ACK for data.
Signed-off-by: Neal Cardwell <ncardwell@google.com>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Yuchung Cheng <ycheng@google.com>
---
net/ipv4/tcp_input.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 53974c7..a16b01b 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -5712,6 +5712,8 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb,
} else
tcp_init_metrics(sk);
+ tcp_update_pacing_rate(sk);
+
/* Prevent spurious tcp_cwnd_restart() on first data packet */
tp->lsndtime = tcp_time_stamp;
--
1.8.4
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH net] tcp: initialize passive-side sk_pacing_rate after 3WHS
2013-10-21 19:40 [PATCH net] tcp: initialize passive-side sk_pacing_rate after 3WHS Neal Cardwell
@ 2013-10-21 20:36 ` Eric Dumazet
2013-10-21 22:58 ` David Miller
0 siblings, 1 reply; 3+ messages in thread
From: Eric Dumazet @ 2013-10-21 20:36 UTC (permalink / raw)
To: Neal Cardwell; +Cc: David Miller, netdev, Eric Dumazet, Yuchung Cheng
On Mon, 2013-10-21 at 15:40 -0400, Neal Cardwell wrote:
> For passive TCP connections, upon receiving the ACK that completes the
> 3WHS, make sure we set our pacing rate after we get our first RTT
> sample.
> Signed-off-by: Neal Cardwell <ncardwell@google.com>
> Cc: Eric Dumazet <edumazet@google.com>
> Cc: Yuchung Cheng <ycheng@google.com>
> ---
> net/ipv4/tcp_input.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
> index 53974c7..a16b01b 100644
> --- a/net/ipv4/tcp_input.c
> +++ b/net/ipv4/tcp_input.c
> @@ -5712,6 +5712,8 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb,
> } else
> tcp_init_metrics(sk);
>
> + tcp_update_pacing_rate(sk);
> +
> /* Prevent spurious tcp_cwnd_restart() on first data packet */
> tp->lsndtime = tcp_time_stamp;
>
Seems good to me, thanks !
Acked-by: Eric Dumazet <edumazet@google.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net] tcp: initialize passive-side sk_pacing_rate after 3WHS
2013-10-21 20:36 ` Eric Dumazet
@ 2013-10-21 22:58 ` David Miller
0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2013-10-21 22:58 UTC (permalink / raw)
To: eric.dumazet; +Cc: ncardwell, netdev, edumazet, ycheng
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Mon, 21 Oct 2013 13:36:34 -0700
> On Mon, 2013-10-21 at 15:40 -0400, Neal Cardwell wrote:
>> For passive TCP connections, upon receiving the ACK that completes the
>> 3WHS, make sure we set our pacing rate after we get our first RTT
>> sample.
>
>> Signed-off-by: Neal Cardwell <ncardwell@google.com>
>> Cc: Eric Dumazet <edumazet@google.com>
>> Cc: Yuchung Cheng <ycheng@google.com>
>> ---
>> net/ipv4/tcp_input.c | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>> diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
>> index 53974c7..a16b01b 100644
>> --- a/net/ipv4/tcp_input.c
>> +++ b/net/ipv4/tcp_input.c
>> @@ -5712,6 +5712,8 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb,
>> } else
>> tcp_init_metrics(sk);
>>
>> + tcp_update_pacing_rate(sk);
>> +
>> /* Prevent spurious tcp_cwnd_restart() on first data packet */
>> tp->lsndtime = tcp_time_stamp;
>>
>
> Seems good to me, thanks !
>
> Acked-by: Eric Dumazet <edumazet@google.com>
Applied, thanks everyone.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-10-21 22:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-21 19:40 [PATCH net] tcp: initialize passive-side sk_pacing_rate after 3WHS Neal Cardwell
2013-10-21 20:36 ` Eric Dumazet
2013-10-21 22:58 ` 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).