Received: by 10.213.65.68 with SMTP id h4csp311641imn; Fri, 23 Mar 2018 05:18:42 -0700 (PDT) X-Google-Smtp-Source: AG47ELszg6ZntUcP7NJ0Ei0pAaPbnx7Skxjm06+Q50F8MlXoKj2M2GxCbFd3SS/fBRMDxQzZ+b2i X-Received: by 2002:a17:902:684:: with SMTP id 4-v6mr29727668plh.262.1521807521960; Fri, 23 Mar 2018 05:18:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521807521; cv=none; d=google.com; s=arc-20160816; b=mCtTZZkbvAPY0oRQ4TApH5vSgSU0iz5H1HQURWrZ1uVgw/vfKURLXk51yPXLFLhJi4 Bpz3J3REAgaIRZspMInOAGj/6DM0EfhmZJa1IHKCtafFcEY+rMCLhIpaBXmfchNAvDap iQIVgLkLzqE10/e9EUUoPagX2csEHTNb+qraA0Lo/ShdQ72vjUKsl9f3pXh4WLZulubj nnO0adVG29HGUf+k/2xJZUdRVBS045nR7FSnnoS0QFhJabEA2kfeAoDfoHw2DDFT4Qpy 10KklA43LSoCZ6KrE9YBmvmzgfn3XodEMOzmdBc/t29dyK2M/IuISSFE43tRRl2PJNHc 4TTA== 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=N5YBEU3M7TsKb1Mo9w4iurxwPNe+aZgqOPYrIzcSpAI=; b=Jmg5RxAmM7ls49FLGvKC66UB82/Jk+njKCu8wfpetRBtMcJsnQka/NXgPkAkI5BCGl WZD90luENr1KX2Wh+S0F+zh8EeBrOhBulvchZkVAoSc87iNoO+7fz8h3YF3CdSX4/CHj S9D9bg8J65z/0kj6K+NuLGMnKMnzzFQQuWvOQWfwfDZcH7365zynqE7TfOZoaGV4sMiQ 3yNoViZsPib6RScRmgqndOV3vySBKM/ia4PfvKJnH0YhCIv0+VGTa12MIJyepKcM+YnF Xf1jzRbohmSMZriIDNcTlkhPmE0FZZknfL3cUmyHlk9SlC0xZ/uIVfzoNgxu7Qnpx69E 5pbQ== 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 y11si5929868pgv.74.2018.03.23.05.18.27; Fri, 23 Mar 2018 05:18:41 -0700 (PDT) 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 S1752563AbeCWJ4N (ORCPT + 99 others); Fri, 23 Mar 2018 05:56:13 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:33876 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751687AbeCWJ4J (ORCPT ); Fri, 23 Mar 2018 05:56:09 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id F325CDBE; Fri, 23 Mar 2018 09:56:08 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Steve Ibanez , Neal Cardwell , Yuchung Cheng , Nandita Dukkipati , Eric Dumazet , "David S. Miller" , Sasha Levin Subject: [PATCH 4.15 14/84] tcp: allow TLP in ECN CWR Date: Fri, 23 Mar 2018 10:53:28 +0100 Message-Id: <20180323095414.070509290@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180323095411.913234798@linuxfoundation.org> References: <20180323095411.913234798@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.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Neal Cardwell [ Upstream commit b4f70c3d4ec32a2ff4c62e1e2da0da5f55fe12bd ] This patch enables tail loss probe in cwnd reduction (CWR) state to detect potential losses. Prior to this patch, since the sender uses PRR to determine the cwnd in CWR state, the combination of CWR+PRR plus tcp_tso_should_defer() could cause unnecessary stalls upon losses: PRR makes cwnd so gentle that tcp_tso_should_defer() defers sending wait for more ACKs. The ACKs may not come due to packet losses. Disallowing TLP when there is unused cwnd had the primary effect of disallowing TLP when there is TSO deferral, Nagle deferral, or we hit the rwin limit. Because basically every application write() or incoming ACK will cause us to run tcp_write_xmit() to see if we can send more, and then if we sent something we call tcp_schedule_loss_probe() to see if we should schedule a TLP. At that point, there are a few common reasons why some cwnd budget could still be unused: (a) rwin limit (b) nagle check (c) TSO deferral (d) TSQ For (d), after the next packet tx completion the TSQ mechanism will allow us to send more packets, so we don't really need a TLP (in practice it shouldn't matter whether we schedule one or not). But for (a), (b), (c) the sender won't send any more packets until it gets another ACK. But if the whole flight was lost, or all the ACKs were lost, then we won't get any more ACKs, and ideally we should schedule and send a TLP to get more feedback. In particular for a long time we have wanted some kind of timer for TSO deferral, and at least this would give us some kind of timer Reported-by: Steve Ibanez Signed-off-by: Neal Cardwell Signed-off-by: Yuchung Cheng Reviewed-by: Nandita Dukkipati Reviewed-by: Eric Dumazet Signed-off-by: David S. Miller Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- net/ipv4/tcp_output.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c @@ -2440,15 +2440,12 @@ bool tcp_schedule_loss_probe(struct sock early_retrans = sock_net(sk)->ipv4.sysctl_tcp_early_retrans; /* Schedule a loss probe in 2*RTT for SACK capable connections - * in Open state, that are either limited by cwnd or application. + * not in loss recovery, that are either limited by cwnd or application. */ if ((early_retrans != 3 && early_retrans != 4) || !tp->packets_out || !tcp_is_sack(tp) || - icsk->icsk_ca_state != TCP_CA_Open) - return false; - - if ((tp->snd_cwnd > tcp_packets_in_flight(tp)) && - !tcp_write_queue_empty(sk)) + (icsk->icsk_ca_state != TCP_CA_Open && + icsk->icsk_ca_state != TCP_CA_CWR)) return false; /* Probe timeout is 2*rtt. Add minimum RTO to account