From: David Miller Subject: Re: [PATCH net] tcp: fix ssthresh and undo for consecutive short FRTO episodes Date: Thu, 14 Aug 2014 14:41:06 -0700 (PDT) Message-ID: <20140814.144106.1946147822858723625.davem@redhat.com> References: <1408047187-983-1-git-send-email-ncardwell@google.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, ycheng@google.com To: ncardwell@google.com Return-path: Received: from mx1.redhat.com ([209.132.183.28]:22458 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754251AbaHNVlJ (ORCPT ); Thu, 14 Aug 2014 17:41:09 -0400 In-Reply-To: <1408047187-983-1-git-send-email-ncardwell@google.com> Sender: netdev-owner@vger.kernel.org List-ID: From: Neal Cardwell Date: Thu, 14 Aug 2014 16:13:07 -0400 > Fix TCP FRTO logic so that it always notices when snd_una advances, > indicating that any RTO after that point will be a new and distinct > loss episode. > > Previously there was a very specific sequence that could cause FRTO to > fail to notice a new loss episode had started: > > (1) RTO timer fires, enter FRTO and retransmit packet 1 in write queue > (2) receiver ACKs packet 1 > (3) FRTO sends 2 more packets > (4) RTO timer fires again (should start a new loss episode) > > The problem was in step (3) above, where tcp_process_loss() returned > early (in the spot marked "Step 2.b"), so that it never got to the > logic to clear icsk_retransmits. Thus icsk_retransmits stayed > non-zero. Thus in step (4) tcp_enter_loss() would see the non-zero > icsk_retransmits, decide that this RTO is not a new episode, and > decide not to cut ssthresh and remember the current cwnd and ssthresh > for undo. > > There were two main consequences to the bug that we have > observed. First, ssthresh was not decreased in step (4). Second, when > there was a series of such FRTO (1-4) sequences that happened to be > followed by an FRTO undo, we would restore the cwnd and ssthresh from > before the entire series started (instead of the cwnd and ssthresh > from before the most recent RTO). This could result in cwnd and > ssthresh being restored to values much bigger than the proper values. > > Signed-off-by: Neal Cardwell > Signed-off-by: Yuchung Cheng > Fixes: e33099f96d99c ("tcp: implement RFC5682 F-RTO") Applied and queued up for -stable, thanks.