* [PATCH net-next] tcp: reset reordering est. selectively on timeout
@ 2013-08-12 23:41 Yuchung Cheng
2013-08-13 4:16 ` Neal Cardwell
0 siblings, 1 reply; 3+ messages in thread
From: Yuchung Cheng @ 2013-08-12 23:41 UTC (permalink / raw)
To: davem, ncardwell, edumazet, mattmathis; +Cc: netdev, Yuchung Cheng
On timeout the TCP sender unconditionally reset the estimated
degree of network reordering (tp->reordering). This idea behind
is that the estimate is too large to trigger fast recovery
(e.g., due to a IP path change).
But for example if the sender only had 2 packets outstanding,
then a timeout doesn't tell much about reordering. A sender that
learns about reordering on big writes and lose packets on small
writes will end up falsely retransmit again and again, especially
when reordering is more likely on big writes.
Therefore the sender should only suspects tp->reordering is too
high if it could have gone into fast recovery with the (lower)
default estimate.
Signed-off-by: Yuchung Cheng <ycheng@google.com>
---
net/ipv4/tcp_input.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index b61274b..e965cc7 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -1877,8 +1877,13 @@ void tcp_enter_loss(struct sock *sk, int how)
}
tcp_verify_left_out(tp);
- tp->reordering = min_t(unsigned int, tp->reordering,
- sysctl_tcp_reordering);
+ /* Timeout in disordered state after receiving substantial DUPACKs
+ * suggests that the degree of reordering is over-estimated.
+ */
+ if (icsk->icsk_ca_state <= TCP_CA_Disorder &&
+ tp->sacked_out >= sysctl_tcp_reordering)
+ tp->reordering = min_t(unsigned int, tp->reordering,
+ sysctl_tcp_reordering);
tcp_set_ca_state(sk, TCP_CA_Loss);
tp->high_seq = tp->snd_nxt;
TCP_ECN_queue_cwr(tp);
--
1.8.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] tcp: reset reordering est. selectively on timeout
2013-08-12 23:41 [PATCH net-next] tcp: reset reordering est. selectively on timeout Yuchung Cheng
@ 2013-08-13 4:16 ` Neal Cardwell
2013-08-13 23:08 ` David Miller
0 siblings, 1 reply; 3+ messages in thread
From: Neal Cardwell @ 2013-08-13 4:16 UTC (permalink / raw)
To: Yuchung Cheng; +Cc: David Miller, Eric Dumazet, Matt Mathis, Netdev
On Mon, Aug 12, 2013 at 7:41 PM, Yuchung Cheng <ycheng@google.com> wrote:
> On timeout the TCP sender unconditionally reset the estimated
> degree of network reordering (tp->reordering). This idea behind
> is that the estimate is too large to trigger fast recovery
> (e.g., due to a IP path change).
>
> But for example if the sender only had 2 packets outstanding,
> then a timeout doesn't tell much about reordering. A sender that
> learns about reordering on big writes and lose packets on small
> writes will end up falsely retransmit again and again, especially
> when reordering is more likely on big writes.
>
> Therefore the sender should only suspects tp->reordering is too
> high if it could have gone into fast recovery with the (lower)
> default estimate.
>
> Signed-off-by: Yuchung Cheng <ycheng@google.com>
> ---
> net/ipv4/tcp_input.c | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
Acked-by: Neal Cardwell <ncardwell@google.com>
neal
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] tcp: reset reordering est. selectively on timeout
2013-08-13 4:16 ` Neal Cardwell
@ 2013-08-13 23:08 ` David Miller
0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2013-08-13 23:08 UTC (permalink / raw)
To: ncardwell; +Cc: ycheng, edumazet, mattmathis, netdev
From: Neal Cardwell <ncardwell@google.com>
Date: Tue, 13 Aug 2013 00:16:57 -0400
> On Mon, Aug 12, 2013 at 7:41 PM, Yuchung Cheng <ycheng@google.com> wrote:
>> On timeout the TCP sender unconditionally reset the estimated
>> degree of network reordering (tp->reordering). This idea behind
>> is that the estimate is too large to trigger fast recovery
>> (e.g., due to a IP path change).
>>
>> But for example if the sender only had 2 packets outstanding,
>> then a timeout doesn't tell much about reordering. A sender that
>> learns about reordering on big writes and lose packets on small
>> writes will end up falsely retransmit again and again, especially
>> when reordering is more likely on big writes.
>>
>> Therefore the sender should only suspects tp->reordering is too
>> high if it could have gone into fast recovery with the (lower)
>> default estimate.
>>
>> Signed-off-by: Yuchung Cheng <ycheng@google.com>
>> ---
>> net/ipv4/tcp_input.c | 9 +++++++--
>> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> Acked-by: Neal Cardwell <ncardwell@google.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-08-13 23:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-12 23:41 [PATCH net-next] tcp: reset reordering est. selectively on timeout Yuchung Cheng
2013-08-13 4:16 ` Neal Cardwell
2013-08-13 23:08 ` 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).