netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] tcp: ecn: dont delay ACKS after CE
@ 2012-08-06 21:04 Eric Dumazet
  2012-08-06 21:07 ` Neal Cardwell
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Dumazet @ 2012-08-06 21:04 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Neal Cardwell

From: Eric Dumazet <edumazet@google.com>

While playing with CoDel and ECN marking, I discovered a
non optimal behavior of receiver of CE (Congestion Encountered)
segments.

In pathological cases, sender has reduced its cwnd to low values,
and receiver delays its ACK (by 40 ms).

While RFC 3168 6.1.3 (The TCP Receiver) doesn't explicitly recommend
to send immediate ACKS, we believe its better to not delay ACKS, because
a CE segment should give same signal than a dropped segment, and its
quite important to reduce RTT to give ECE/CWR signals as fast as
possible.

Note we already call tcp_enter_quickack_mode() from TCP_ECN_check_ce()
if we receive a retransmit, for the same reason.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Neal Cardwell <ncardwell@google.com>
---
 net/ipv4/tcp_input.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 2fd2bc9..fa2c2c2 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -237,7 +237,11 @@ static inline void TCP_ECN_check_ce(struct tcp_sock *tp, const struct sk_buff *s
 			tcp_enter_quickack_mode((struct sock *)tp);
 		break;
 	case INET_ECN_CE:
-		tp->ecn_flags |= TCP_ECN_DEMAND_CWR;
+		if (!(tp->ecn_flags & TCP_ECN_DEMAND_CWR)) {
+			/* Better not delay acks, sender can have a very low cwnd */
+			tcp_enter_quickack_mode((struct sock *)tp);
+			tp->ecn_flags |= TCP_ECN_DEMAND_CWR;
+		}
 		/* fallinto */
 	default:
 		tp->ecn_flags |= TCP_ECN_SEEN;

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

* Re: [PATCH net-next] tcp: ecn: dont delay ACKS after CE
  2012-08-06 21:04 [PATCH net-next] tcp: ecn: dont delay ACKS after CE Eric Dumazet
@ 2012-08-06 21:07 ` Neal Cardwell
  2012-08-06 21:14   ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Neal Cardwell @ 2012-08-06 21:07 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: David Miller, netdev

On Mon, Aug 6, 2012 at 5:04 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> From: Eric Dumazet <edumazet@google.com>
>
> While playing with CoDel and ECN marking, I discovered a
> non optimal behavior of receiver of CE (Congestion Encountered)
> segments.
>
> In pathological cases, sender has reduced its cwnd to low values,
> and receiver delays its ACK (by 40 ms).
>
> While RFC 3168 6.1.3 (The TCP Receiver) doesn't explicitly recommend
> to send immediate ACKS, we believe its better to not delay ACKS, because
> a CE segment should give same signal than a dropped segment, and its
> quite important to reduce RTT to give ECE/CWR signals as fast as
> possible.
>
> Note we already call tcp_enter_quickack_mode() from TCP_ECN_check_ce()
> if we receive a retransmit, for the same reason.
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Cc: Neal Cardwell <ncardwell@google.com>

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

neal

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

* Re: [PATCH net-next] tcp: ecn: dont delay ACKS after CE
  2012-08-06 21:07 ` Neal Cardwell
@ 2012-08-06 21:14   ` David Miller
  0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2012-08-06 21:14 UTC (permalink / raw)
  To: ncardwell; +Cc: eric.dumazet, netdev

From: Neal Cardwell <ncardwell@google.com>
Date: Mon, 6 Aug 2012 17:07:08 -0400

> On Mon, Aug 6, 2012 at 5:04 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
>> From: Eric Dumazet <edumazet@google.com>
>>
>> While playing with CoDel and ECN marking, I discovered a
>> non optimal behavior of receiver of CE (Congestion Encountered)
>> segments.
>>
>> In pathological cases, sender has reduced its cwnd to low values,
>> and receiver delays its ACK (by 40 ms).
>>
>> While RFC 3168 6.1.3 (The TCP Receiver) doesn't explicitly recommend
>> to send immediate ACKS, we believe its better to not delay ACKS, because
>> a CE segment should give same signal than a dropped segment, and its
>> quite important to reduce RTT to give ECE/CWR signals as fast as
>> possible.
>>
>> Note we already call tcp_enter_quickack_mode() from TCP_ECN_check_ce()
>> if we receive a retransmit, for the same reason.
>>
>> Signed-off-by: Eric Dumazet <edumazet@google.com>
>> Cc: Neal Cardwell <ncardwell@google.com>
> 
> Acked-by: Neal Cardwell <ncardwell@google.com>

Applied, thanks.

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

end of thread, other threads:[~2012-08-06 21:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-06 21:04 [PATCH net-next] tcp: ecn: dont delay ACKS after CE Eric Dumazet
2012-08-06 21:07 ` Neal Cardwell
2012-08-06 21:14   ` 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).