Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp731695ybl; Fri, 31 Jan 2020 07:04:44 -0800 (PST) X-Google-Smtp-Source: APXvYqyZuZO/TGQC23/pRTC25tEmWJdUrfTLGtVRRR+QqXJ2Inm6DdcvogoaWBLtKaxDXR0L3NJ6 X-Received: by 2002:a05:6830:9a:: with SMTP id a26mr8027476oto.273.1580483084699; Fri, 31 Jan 2020 07:04:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580483084; cv=none; d=google.com; s=arc-20160816; b=LGI7CSJurgfpnqfQ+OiaFVSv+C3wsPnYkqlANF+FhwnEGtPHGqCsob+hjXWrVea7y0 6bc1n+0dGKEPUJiTPdx0V+/KX4EdWCNd3MBvHjWqeKiyXCDH1Ux/5lNh6x5xSEwMrt8S gn9rwUsufK+i9wCGCPXfUpIgYMDxknFjcADwMQ8f7UPQhFOrBX5w9uqvJ0KT+r9MOsFi Qeo99QZiTdn4f4VCnBubePOLqgG3IhIkEYkvP5GJnCp8/89evrX9zFDAfzPBAn8bzXVz ci/9B7COojlRLYO/ptcS10TdKfGXk5rUsIy/TEZOyugCk7JuQExoRhLOMKHUJ2LUnK0G 61nA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=lP6TzEP91d7hLsESfdMqNdtjrOfbthLJkOU6UXoqTVs=; b=rpGkOO8rf0da7uY4ZVVRvErYiFbKnta7/kG4na4l2SuCV1UFwWBuGPPDC/WLwefy3X zRgn/heKQOd0D1wQCZ+YgH0Z7cxRpCX+0clWnnu5yeSM0/HSIgVXgmHN5mnBCS41chkn zTPP+AowB2JYTM98XbhrV7qVh0bp1cUanawHIWXf4lTqf0Idi0tHBV4DrHLFdjrIL9zB hCquMh7s4A3LoKDsJXAn80OkES16LH7ZEbhuT8gCiJA5qM+yEez9pPEInP3Q7V30X6Xd MIH6a/33c9DaHy13kVzol+LMjgANYBJq4enza9OfoIiKIyDk1/kUrn4ICcKnoZZwK8fw mDwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=JjC9sj0b; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x23si4749938otq.41.2020.01.31.07.04.31; Fri, 31 Jan 2020 07:04:44 -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; dkim=pass header.i=@google.com header.s=20161025 header.b=JjC9sj0b; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729143AbgAaPBe (ORCPT + 99 others); Fri, 31 Jan 2020 10:01:34 -0500 Received: from mail-yw1-f65.google.com ([209.85.161.65]:41885 "EHLO mail-yw1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729099AbgAaPBe (ORCPT ); Fri, 31 Jan 2020 10:01:34 -0500 Received: by mail-yw1-f65.google.com with SMTP id l22so4927752ywc.8 for ; Fri, 31 Jan 2020 07:01:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=lP6TzEP91d7hLsESfdMqNdtjrOfbthLJkOU6UXoqTVs=; b=JjC9sj0bkY+d7wSCXaj+o8kYk69s9tJNc3C2A70tF2dKMLJG5FFvog7iey+EBH5tkS R2aSMJpoMMRCHqY17xrSS5Cr6n0aReHPNRY3UI1Q2jNoC28C+IB6ZSKLOi2Ljy3ucS8i VbZ7wosy2IjQCeQQRaYpJ8CIuxVesucU1Ll0y323e9Fp4ZPxPB1VSSDMuAlFeShpoVJ2 Zp/zpk9vDLlIvK1X6Xrs/P5eKsJhXpaHJy4chljIaOzmj9gXt8yeNTN7HueQPSF93WJN bBfbkKkvNhAGzoUiF6pP4gzT1Glae++rA5nYHhRAa1zXKG8rCazvnGSwwk+05bmdG2uG PwTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=lP6TzEP91d7hLsESfdMqNdtjrOfbthLJkOU6UXoqTVs=; b=UPfPqZMcwS4rUmJf3cIaju/nA2VnChGP+DFPzziX6FiM2m4ULqBOJaZJt/N2Oss6P/ WQB7Y3sBQTUys62SIviNQSdO7qgqdm9Vx5oH45LnuTYkSmtWzvFs5019u6jFvGMZKVqu qAZ+ZhGvKuho0VST/wPODB/Orz6iUnzf7KuVmD0ZpMHOpNDl3VloLm4n1QOEo76u0c3n qywaVnK6mke+eNKKsShqf67eCkW19ioUY+IRbEeiRFUoAS2XoBjJonwswirnWX5ea3ER DvR9CoeggAO9uBQZN2KxDKl0oax6MzD98rkwcSFh+Q3Xx4ImTOKgBTgI8EORiW2TOofG Ypnw== X-Gm-Message-State: APjAAAVpkZ8GDIXkz2M26KU8VqnCMLIRGSLPsj0MW/sAT4vrUVWgQA/d 3KT7ETSSe2kfdAoVTAHpRQDA89PBkbzm8ApXVWiKug== X-Received: by 2002:a81:b38a:: with SMTP id r132mr8677745ywh.114.1580482892732; Fri, 31 Jan 2020 07:01:32 -0800 (PST) MIME-Version: 1.0 References: <20200131122421.23286-1-sjpark@amazon.com> <20200131122421.23286-3-sjpark@amazon.com> In-Reply-To: <20200131122421.23286-3-sjpark@amazon.com> From: Eric Dumazet Date: Fri, 31 Jan 2020 07:01:21 -0800 Message-ID: Subject: Re: [PATCH 2/3] tcp: Reduce SYN resend delay if a suspicous ACK is received To: sjpark@amazon.com Cc: David Miller , Shuah Khan , netdev , "open list:KERNEL SELFTEST FRAMEWORK" , LKML , sj38.park@gmail.com, aams@amazon.com, SeongJae Park 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 On Fri, Jan 31, 2020 at 4:25 AM wrote: > Signed-off-by: SeongJae Park > --- > net/ipv4/tcp_input.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c > index 2a976f57f7e7..b168e29e1ad1 100644 > --- a/net/ipv4/tcp_input.c > +++ b/net/ipv4/tcp_input.c > @@ -5893,8 +5893,12 @@ static int tcp_rcv_synsent_state_process(struct sock *sk, struct sk_buff *skb, > * the segment and return)" > */ > if (!after(TCP_SKB_CB(skb)->ack_seq, tp->snd_una) || > - after(TCP_SKB_CB(skb)->ack_seq, tp->snd_nxt)) > + after(TCP_SKB_CB(skb)->ack_seq, tp->snd_nxt)) { > + /* Previous FIN/ACK or RST/ACK might be ignore. */ > + inet_csk_reset_xmit_timer(sk, ICSK_TIME_RETRANS, > + TCP_ATO_MIN, TCP_RTO_MAX); This is not what I suggested. I suggested implementing a strategy where only the _first_ retransmit would be done earlier. So you need to look at the current counter of retransmit attempts, then reset the timer if this SYN_SENT socket never resent a SYN. We do not want to trigger packet storms, if for some reason the remote peer constantly sends us the same packet. Thanks. > goto reset_and_undo; > + } > > if (tp->rx_opt.saw_tstamp && tp->rx_opt.rcv_tsecr && > !between(tp->rx_opt.rcv_tsecr, tp->retrans_stamp, > -- > 2.17.1 >