Netdev List
 help / color / mirror / Atom feed
* [PATCH net-next] tcp: reset timer after any SYNACK retransmit
@ 2013-04-29 18:44 Yuchung Cheng
  2013-04-29 18:54 ` Eric Dumazet
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Yuchung Cheng @ 2013-04-29 18:44 UTC (permalink / raw)
  To: davem, ncardwell, edumazet; +Cc: hagen, netdev, Yuchung Cheng

Linux immediately returns SYNACK on (spurious) SYN retransmits, but
keeps the SYNACK timer running independently. Thus the timer may
fire right after the SYNACK retransmit and causes a SYN-SYNACK
cross-fire burst.

Adopt the fast retransmit/recovery idea in established state by
re-arming the SYNACK timer after the fast (SYNACK) retransmit. The
timer may fire late up to 500ms due to the current SYNACK timer wheel,
but it's OK to be conservative when network is congested. Eric's new
listener design should address this issue.

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

diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c
index 05eaf89..0f01788 100644
--- a/net/ipv4/tcp_minisocks.c
+++ b/net/ipv4/tcp_minisocks.c
@@ -551,8 +551,13 @@ struct sock *tcp_check_req(struct sock *sk, struct sk_buff *skb,
 		 *
 		 * Note that even if there is new data in the SYN packet
 		 * they will be thrown away too.
+		 *
+		 * Reset timer after retransmitting SYNACK, similar to
+		 * the idea of fast retransmit in recovery.
 		 */
-		inet_rtx_syn_ack(sk, req);
+		if (!inet_rtx_syn_ack(sk, req))
+			req->expires = min(TCP_TIMEOUT_INIT << req->num_timeout,
+					   TCP_RTO_MAX) + jiffies;
 		return NULL;
 	}
 
-- 
1.8.2.1

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

* Re: [PATCH net-next] tcp: reset timer after any SYNACK retransmit
  2013-04-29 18:44 [PATCH net-next] tcp: reset timer after any SYNACK retransmit Yuchung Cheng
@ 2013-04-29 18:54 ` Eric Dumazet
  2013-04-29 18:57 ` Neal Cardwell
  2013-04-29 19:17 ` David Miller
  2 siblings, 0 replies; 5+ messages in thread
From: Eric Dumazet @ 2013-04-29 18:54 UTC (permalink / raw)
  To: Yuchung Cheng; +Cc: davem, ncardwell, edumazet, hagen, netdev

On Mon, 2013-04-29 at 11:44 -0700, Yuchung Cheng wrote:
> Linux immediately returns SYNACK on (spurious) SYN retransmits, but
> keeps the SYNACK timer running independently. Thus the timer may
> fire right after the SYNACK retransmit and causes a SYN-SYNACK
> cross-fire burst.
> 
> Adopt the fast retransmit/recovery idea in established state by
> re-arming the SYNACK timer after the fast (SYNACK) retransmit. The
> timer may fire late up to 500ms due to the current SYNACK timer wheel,
> but it's OK to be conservative when network is congested. Eric's new
> listener design should address this issue.
> 
> Signed-off-by: Yuchung Cheng <ycheng@google.com>
> ---

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

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

* Re: [PATCH net-next] tcp: reset timer after any SYNACK retransmit
  2013-04-29 18:44 [PATCH net-next] tcp: reset timer after any SYNACK retransmit Yuchung Cheng
  2013-04-29 18:54 ` Eric Dumazet
@ 2013-04-29 18:57 ` Neal Cardwell
  2013-04-29 19:17 ` David Miller
  2 siblings, 0 replies; 5+ messages in thread
From: Neal Cardwell @ 2013-04-29 18:57 UTC (permalink / raw)
  To: Yuchung Cheng; +Cc: David Miller, Eric Dumazet, hagen, Netdev

On Mon, Apr 29, 2013 at 2:44 PM, Yuchung Cheng <ycheng@google.com> wrote:
> Linux immediately returns SYNACK on (spurious) SYN retransmits, but
> keeps the SYNACK timer running independently. Thus the timer may
> fire right after the SYNACK retransmit and causes a SYN-SYNACK
> cross-fire burst.
>
> Adopt the fast retransmit/recovery idea in established state by
> re-arming the SYNACK timer after the fast (SYNACK) retransmit. The
> timer may fire late up to 500ms due to the current SYNACK timer wheel,
> but it's OK to be conservative when network is congested. Eric's new
> listener design should address this issue.
>
> Signed-off-by: Yuchung Cheng <ycheng@google.com>

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

neal

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

* Re: [PATCH net-next] tcp: reset timer after any SYNACK retransmit
  2013-04-29 18:44 [PATCH net-next] tcp: reset timer after any SYNACK retransmit Yuchung Cheng
  2013-04-29 18:54 ` Eric Dumazet
  2013-04-29 18:57 ` Neal Cardwell
@ 2013-04-29 19:17 ` David Miller
  2013-04-29 22:13   ` Yuchung Cheng
  2 siblings, 1 reply; 5+ messages in thread
From: David Miller @ 2013-04-29 19:17 UTC (permalink / raw)
  To: ycheng; +Cc: ncardwell, edumazet, hagen, netdev

From: Yuchung Cheng <ycheng@google.com>
Date: Mon, 29 Apr 2013 11:44:51 -0700

> Linux immediately returns SYNACK on (spurious) SYN retransmits, but
> keeps the SYNACK timer running independently. Thus the timer may
> fire right after the SYNACK retransmit and causes a SYN-SYNACK
> cross-fire burst.
> 
> Adopt the fast retransmit/recovery idea in established state by
> re-arming the SYNACK timer after the fast (SYNACK) retransmit. The
> timer may fire late up to 500ms due to the current SYNACK timer wheel,
> but it's OK to be conservative when network is congested. Eric's new
> listener design should address this issue.
> 
> Signed-off-by: Yuchung Cheng <ycheng@google.com>

Applied.

Maybe -stable material?

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

* Re: [PATCH net-next] tcp: reset timer after any SYNACK retransmit
  2013-04-29 19:17 ` David Miller
@ 2013-04-29 22:13   ` Yuchung Cheng
  0 siblings, 0 replies; 5+ messages in thread
From: Yuchung Cheng @ 2013-04-29 22:13 UTC (permalink / raw)
  To: David Miller; +Cc: Neal Cardwell, Eric Dumazet, Hagen Paul Pfeifer, netdev

On Mon, Apr 29, 2013 at 12:17 PM, David Miller <davem@davemloft.net> wrote:
> From: Yuchung Cheng <ycheng@google.com>
> Date: Mon, 29 Apr 2013 11:44:51 -0700
>
>> Linux immediately returns SYNACK on (spurious) SYN retransmits, but
>> keeps the SYNACK timer running independently. Thus the timer may
>> fire right after the SYNACK retransmit and causes a SYN-SYNACK
>> cross-fire burst.
>>
>> Adopt the fast retransmit/recovery idea in established state by
>> re-arming the SYNACK timer after the fast (SYNACK) retransmit. The
>> timer may fire late up to 500ms due to the current SYNACK timer wheel,
>> but it's OK to be conservative when network is congested. Eric's new
>> listener design should address this issue.
>>
>> Signed-off-by: Yuchung Cheng <ycheng@google.com>
>
> Applied.
>
> Maybe -stable material?
Should be fine for -stable too. Thanks.

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

end of thread, other threads:[~2013-04-29 22:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-29 18:44 [PATCH net-next] tcp: reset timer after any SYNACK retransmit Yuchung Cheng
2013-04-29 18:54 ` Eric Dumazet
2013-04-29 18:57 ` Neal Cardwell
2013-04-29 19:17 ` David Miller
2013-04-29 22:13   ` Yuchung Cheng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox