Received: by 10.223.185.116 with SMTP id b49csp5458427wrg; Wed, 7 Mar 2018 12:06:38 -0800 (PST) X-Google-Smtp-Source: AG47ELu4NcfExbgUi3Lgm3WQeknMYQRI7dzvRcfDWhScjxlydGSkBpEVqK29Oz+xQuCk76pTbc/4 X-Received: by 2002:a17:902:ad0b:: with SMTP id i11-v6mr13336832plr.10.1520453198144; Wed, 07 Mar 2018 12:06:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520453198; cv=none; d=google.com; s=arc-20160816; b=zBU2Q2hVE/6ASKsDTr/m+fJIKp9qQ35LWJJFy3Bvrxv1G9oRg3ZTbArGIINek/FNB2 AMoefeemHfxvSyYCj+b7kE7+stmE63qzNtgGBU7coBzuF47srnK7OSz9Ddaobha23wmb ImJIWc3mpKuXk8Wl5nRnkVWxnpOP7a0iTDLpMAutQccRTPwscvhWNALdy+WyNj48Q3ZY l23cY1hX+U85SuIrxF9WJwEayXZznxyv6O0uAze1clMAjiClmN1NBi3+DdcNBatMJU2o WLxs24BE+dUFYX9I37GwbQ0K7L38HYPlFqkGVGGsNaethUjaB/AtTdmG324wgF4P/N0r r+TQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=3Er53ybPz1O0Qta4FTdRF2KpnPDGxZTy58ZO2X8eQmM=; b=EO8NcieSBv1FCHJpojkNFWrdfaJ3TYH8vvEmnuTa7Y+gmEzj+RceSq5xpNNAlJmbOJ e/aCO2ow8Z0Pijn2VbzJ/o8011c2/N3ZDIDotXuaHMQf/dDzT6IMPYL9JdrwjqXB5V3S vBoYnSifyQGR/h2iY6GnPrl4KWCLTnLAd1bPn8z3W2QSv4/cooZXct5+04AO7/iPMb0V Bw/5rnVBt5ZPWM1Mt7w1Ai80eoV95t0yXE5bdaoE7WAulfzBDNDpNTOn5qijcyvtP357 D/t/JSZXEJBENthmRdl98nJt/HmSKRcCLSARi4ho653UZ3G5uJpTvIK8bYf4uiXtmWEY wsLA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o86si14405441pfi.253.2018.03.07.12.06.23; Wed, 07 Mar 2018 12:06:38 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935066AbeCGUEW (ORCPT + 99 others); Wed, 7 Mar 2018 15:04:22 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:44596 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965528AbeCGTqZ (ORCPT ); Wed, 7 Mar 2018 14:46:25 -0500 Received: from localhost (unknown [185.236.200.248]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 01E61106A; Wed, 7 Mar 2018 19:46:24 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Teodor Milkov , Yuchung Cheng , Neal Cardwell , "David S. Miller" Subject: [PATCH 4.14 061/110] tcp: revert F-RTO extension to detect more spurious timeouts Date: Wed, 7 Mar 2018 11:38:44 -0800 Message-Id: <20180307191047.384165827@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180307191039.748351103@linuxfoundation.org> References: <20180307191039.748351103@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Yuchung Cheng [ Upstream commit fc68e171d376c322e6777a3d7ac2f0278b68b17f ] This reverts commit 89fe18e44f7ee5ab1c90d0dff5835acee7751427. While the patch could detect more spurious timeouts, it could cause poor TCP performance on broken middle-boxes that modifies TCP packets (e.g. receive window, SACK options). Since the performance gain is much smaller compared to the potential loss. The best solution is to fully revert the change. Fixes: 89fe18e44f7e ("tcp: extend F-RTO to catch more spurious timeouts") Reported-by: Teodor Milkov Signed-off-by: Yuchung Cheng Signed-off-by: Neal Cardwell Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/ipv4/tcp_input.c | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c @@ -1947,6 +1947,7 @@ void tcp_enter_loss(struct sock *sk) struct tcp_sock *tp = tcp_sk(sk); struct net *net = sock_net(sk); struct sk_buff *skb; + bool new_recovery = icsk->icsk_ca_state < TCP_CA_Recovery; bool is_reneg; /* is receiver reneging on SACKs? */ bool mark_lost; @@ -2009,15 +2010,12 @@ void tcp_enter_loss(struct sock *sk) tp->high_seq = tp->snd_nxt; tcp_ecn_queue_cwr(tp); - /* F-RTO RFC5682 sec 3.1 step 1 mandates to disable F-RTO - * if a previous recovery is underway, otherwise it may incorrectly - * call a timeout spurious if some previously retransmitted packets - * are s/acked (sec 3.2). We do not apply that retriction since - * retransmitted skbs are permanently tagged with TCPCB_EVER_RETRANS - * so FLAG_ORIG_SACK_ACKED is always correct. But we do disable F-RTO - * on PTMU discovery to avoid sending new data. + /* 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 */ tp->frto = sysctl_tcp_frto && + (new_recovery || icsk->icsk_retransmits) && !inet_csk(sk)->icsk_mtup.probe_size; } @@ -2696,18 +2694,14 @@ static void tcp_process_loss(struct sock 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 */