Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp801679ybl; Fri, 31 Jan 2020 08:13:33 -0800 (PST) X-Google-Smtp-Source: APXvYqwE1bkmvrqa9+B2SPmPWx/6Mt0q04Qd3I0aicPbSH5ZC3Abn1lr/P1bwdvTI9afTo5CGR4s X-Received: by 2002:a9d:6a85:: with SMTP id l5mr8566182otq.231.1580487212928; Fri, 31 Jan 2020 08:13:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580487212; cv=none; d=google.com; s=arc-20160816; b=A4EHaZoF3QuRpsA92dfYiQ35Kl3iKaGlCTMsFy68lqSYCTj+U5kB/i3BqWAS219qns ZVepVz8GhW1IPKfmT049BsqHlb8J2sctPdHE92DVLXAQgaNfDiimliymuN+axogVKBGj +WhSp/GiKVvtjnyxtDZQPRtyI7m3FgW0CXO7+rsdKurdWQ5sRdNflO+DH30UOLLwvxlr sgQVZ/FZoCXbmuPgGadpzIZ/ZT5oG/GnFDgdgw8ZSbl7gkGnEAiJSJWzShBW0iFKno5p LxeLlDnjb+GMRsy/PonBLIFtnKdKl+jrFR1pGUJE6lPdi87bmPW29rU8VRgklE/PYvpv 6gvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:in-reply-to:message-id:date :subject:cc:to:from:ironport-sdr:dkim-signature; bh=haMvOsyZc78AVx3AOqC58ELvTFvW3Ug/nhb6F0XmDZ8=; b=bLUFEhwxV5fmW1ULioBbps43g1S1ysFpg025EJaFbmTNDSIg8qyyVv1WOcrY9DhXVj +W3qxqdFhZiVA7+L/BCxBEg3QZseSsBUzhQtBZQ9GPipB7UkSsZPMnGblFWkJ32hEhpz a92oKrxvPq80JAQ/ummVBodrK+InZ1HIldB9qLxvUaKivD52EqwJLEoW/8gzRumiZnw5 84m87HSnqqXUY4Q/kOy7hxxRZhfFoaNEDulavJHjO2FWWALaYoluKMujWILBzfSSmLo9 idC4qv/xzV5By51VkmUmnABFLX2iv2FCWQuZQSI0iJ0646Fskk7U3rFdaGVKWukvLnlC ffrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=OBjuH0le; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p26si4793507oto.240.2020.01.31.08.13.20; Fri, 31 Jan 2020 08:13:32 -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=@amazon.com header.s=amazon201209 header.b=OBjuH0le; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729276AbgAaQMX (ORCPT + 99 others); Fri, 31 Jan 2020 11:12:23 -0500 Received: from smtp-fw-6002.amazon.com ([52.95.49.90]:54212 "EHLO smtp-fw-6002.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729162AbgAaQMX (ORCPT ); Fri, 31 Jan 2020 11:12:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1580487143; x=1612023143; h=from:to:cc:subject:date:message-id:in-reply-to: mime-version; bh=haMvOsyZc78AVx3AOqC58ELvTFvW3Ug/nhb6F0XmDZ8=; b=OBjuH0leZzo9+07WS9tfrKtYa+MIC3IXoToIKQCG27laXRAnSXndDSeJ JZhZJ/fYkuTEE5339sHr5rwLbuPMGb6YSQnsXMcmMLgrqByVwWOyKmqbc LqFBDpuVjLdU5AHI/xqpvQQCnmSdD+Vnh8guZUEyqlMEHBSdS3S5mocic w=; IronPort-SDR: vyo7DKfoJqzBftCArd4OozalyrQLXy5tcIabPnObduFsX93IRKN3fwCGMyGMiYp2as5jzCLpZc NfqLafiDGrIA== X-IronPort-AV: E=Sophos;i="5.70,386,1574121600"; d="scan'208";a="14203199" Received: from iad12-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-2a-69849ee2.us-west-2.amazon.com) ([10.43.8.6]) by smtp-border-fw-out-6002.iad6.amazon.com with ESMTP; 31 Jan 2020 16:12:20 +0000 Received: from EX13MTAUEA002.ant.amazon.com (pdx4-ws-svc-p6-lb7-vlan2.pdx.amazon.com [10.170.41.162]) by email-inbound-relay-2a-69849ee2.us-west-2.amazon.com (Postfix) with ESMTPS id BB43AA2303; Fri, 31 Jan 2020 16:12:19 +0000 (UTC) Received: from EX13D31EUA001.ant.amazon.com (10.43.165.15) by EX13MTAUEA002.ant.amazon.com (10.43.61.77) with Microsoft SMTP Server (TLS) id 15.0.1236.3; Fri, 31 Jan 2020 16:12:19 +0000 Received: from u886c93fd17d25d.ant.amazon.com (10.43.162.249) by EX13D31EUA001.ant.amazon.com (10.43.165.15) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Fri, 31 Jan 2020 16:12:14 +0000 From: To: Eric Dumazet CC: , David Miller , Shuah Khan , netdev , "open list:KERNEL SELFTEST FRAMEWORK" , LKML , , , SeongJae Park Subject: Re: Re: [PATCH 2/3] tcp: Reduce SYN resend delay if a suspicous ACK is received Date: Fri, 31 Jan 2020 17:12:00 +0100 Message-ID: <20200131161200.8852-1-sjpark@amazon.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: (raw) MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.43.162.249] X-ClientProxiedBy: EX13D03UWC003.ant.amazon.com (10.43.162.79) To EX13D31EUA001.ant.amazon.com (10.43.165.15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 31 Jan 2020 07:01:21 -0800 Eric Dumazet wrote: > 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. You're right, I missed the important point, thank you for pointing it. Among retransmission related fields of 'tcp_sock', I think '->total_retrans' would fit for this check. How about below change? ``` diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 2a976f57f7e7..29fc0e4da931 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c @@ -5893,8 +5893,14 @@ 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 ignored. */ + if (tp->total_retrans == 0) + inet_csk_reset_xmit_timer(sk, + ICSK_TIME_RETRANS, TCP_ATO_MIN, + TCP_RTO_MAX); goto reset_and_undo; + } if (tp->rx_opt.saw_tstamp && tp->rx_opt.rcv_tsecr && !between(tp->rx_opt.rcv_tsecr, tp->retrans_stamp, ``` Thanks, SeongJae Park > > 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 > > >