tcp: allow undo from reordered DSACKs
authorNeal Cardwell <ncardwell@google.com>
Wed, 16 Nov 2011 08:58:04 +0000 (08:58 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sun, 27 Nov 2011 23:54:09 +0000 (18:54 -0500)
commitf698204bd0bfdc645642e271da117b56b795aee0
treea08c3714c3f1e0e523db799d0455b9e9b17fa8ab
parente95ae2f2cf10f7bf27b492aa6188f3cd745de162
tcp: allow undo from reordered DSACKs

Previously, SACK-enabled connections hung around in TCP_CA_Disorder
state while snd_una==high_seq, just waiting to accumulate DSACKs and
hopefully undo a cwnd reduction. This could and did lead to the
following unfortunate scenario: if some incoming ACKs advance snd_una
beyond high_seq then we were setting undo_marker to 0 and moving to
TCP_CA_Open, so if (due to reordering in the ACK return path) we
shortly thereafter received a DSACK then we were no longer able to
undo the cwnd reduction.

The change: Simplify the congestion avoidance state machine by
removing the behavior where SACK-enabled connections hung around in
the TCP_CA_Disorder state just waiting for DSACKs. Instead, when
snd_una advances to high_seq or beyond we typically move to
TCP_CA_Open immediately and allow an undo in either TCP_CA_Open or
TCP_CA_Disorder if we later receive enough DSACKs.

Other patches in this series will provide other changes that are
necessary to fully fix this problem.

Signed-off-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/tcp_input.c