Skip to content

Commit

Permalink
Merge branch 'tcp-revert-a-F-RTO-extension-due-to-broken-middle-boxes'
Browse files Browse the repository at this point in the history
Yuchung Cheng says:

====================
tcp: revert a F-RTO extension due to broken middle-boxes

This patch series reverts a (non-standard) TCP F-RTO extension that aimed
to detect more spurious timeouts. Unfortunately it could result in poor
performance due to broken middle-boxes that modify TCP packets. E.g.
https://www.spinics.net/lists/netdev/msg484154.html
We believe the best and simplest solution is to just revert the change.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
davem330 committed Feb 28, 2018
2 parents c843162 + fc68e17 commit 55e84dd
Showing 1 changed file with 7 additions and 16 deletions.
23 changes: 7 additions & 16 deletions net/ipv4/tcp_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -1971,11 +1971,6 @@ void tcp_enter_loss(struct sock *sk)
/* F-RTO RFC5682 sec 3.1 step 1: retransmit SND.UNA if no previous
* loss recovery is underway except recurring timeout(s) on
* the same SND.UNA (sec 3.2). Disable F-RTO on path MTU probing
*
* In theory F-RTO can be used repeatedly during loss recovery.
* In practice this interacts badly with broken middle-boxes that
* falsely raise the receive window, which results in repeated
* timeouts and stop-and-go behavior.
*/
tp->frto = net->ipv4.sysctl_tcp_frto &&
(new_recovery || icsk->icsk_retransmits) &&
Expand Down Expand Up @@ -2631,18 +2626,14 @@ static void tcp_process_loss(struct sock *sk, int flag, bool is_dupack,
tcp_try_undo_loss(sk, false))
return;

/* The ACK (s)acks some never-retransmitted data meaning not all
* the data packets before the timeout were lost. Therefore we
* undo the congestion window and state. This is essentially
* the operation in F-RTO (RFC5682 section 3.1 step 3.b). Since
* a retransmitted skb is permantly marked, we can apply such an
* operation even if F-RTO was not used.
*/
if ((flag & FLAG_ORIG_SACK_ACKED) &&
tcp_try_undo_loss(sk, tp->undo_marker))
return;

if (tp->frto) { /* F-RTO RFC5682 sec 3.1 (sack enhanced version). */
/* Step 3.b. A timeout is spurious if not all data are
* lost, i.e., never-retransmitted data are (s)acked.
*/
if ((flag & FLAG_ORIG_SACK_ACKED) &&
tcp_try_undo_loss(sk, true))
return;

if (after(tp->snd_nxt, tp->high_seq)) {
if (flag & FLAG_DATA_SACKED || is_dupack)
tp->frto = 0; /* Step 3.a. loss was real */
Expand Down

0 comments on commit 55e84dd

Please sign in to comment.