From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1490AC35240 for ; Fri, 31 Jan 2020 17:05:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DFCBA206F0 for ; Fri, 31 Jan 2020 17:05:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=amazon.com header.i=@amazon.com header.b="unrLJr1J" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726912AbgAaRFm (ORCPT ); Fri, 31 Jan 2020 12:05:42 -0500 Received: from smtp-fw-33001.amazon.com ([207.171.190.10]:17033 "EHLO smtp-fw-33001.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726157AbgAaRFl (ORCPT ); Fri, 31 Jan 2020 12:05:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1580490342; x=1612026342; h=from:to:cc:subject:date:message-id:in-reply-to: mime-version; bh=Lp308P1N7kGC/rh/RrKm6hjiPc5fQG13jwWaLGsBMuc=; b=unrLJr1JaaaLLLMi1EOr1ONSP3AOW+h/uiP6aNpw/gArQtveVMyGhLWR JK9bu2XnbuHWeFK0MvqC8V8Kl/cTztoz8kkpYq4e2jkJ+TFIAmY/wHdOR iXcSN2arLrtp5JuDz82281z75OY6oDIDGNtEet0Co0uaAm1/LGI3Z6A1+ s=; IronPort-SDR: hJOb1UZ9E4WP7nS7CRBi6GSs6l46cEbFUcWmYWKn1QHr4cDgWAU08NBVz4WIvmLvdoGz6yIOZ8 0coMk6GYblHA== X-IronPort-AV: E=Sophos;i="5.70,386,1574121600"; d="scan'208";a="23645832" Received: from sea32-co-svc-lb4-vlan3.sea.corp.amazon.com (HELO email-inbound-relay-1a-7d76a15f.us-east-1.amazon.com) ([10.47.23.38]) by smtp-border-fw-out-33001.sea14.amazon.com with ESMTP; 31 Jan 2020 17:05:30 +0000 Received: from EX13MTAUEA002.ant.amazon.com (iad55-ws-svc-p15-lb9-vlan2.iad.amazon.com [10.40.159.162]) by email-inbound-relay-1a-7d76a15f.us-east-1.amazon.com (Postfix) with ESMTPS id BA1D7A060B; Fri, 31 Jan 2020 17:05:26 +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 17:05:26 +0000 Received: from u886c93fd17d25d.ant.amazon.com (10.43.162.50) by EX13D31EUA001.ant.amazon.com (10.43.165.15) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Fri, 31 Jan 2020 17:05:21 +0000 From: To: Eric Dumazet CC: , David Miller , Shuah Khan , netdev , "open list:KERNEL SELFTEST FRAMEWORK" , LKML , , , SeongJae Park Subject: Re: Re: Re: [PATCH 2/3] tcp: Reduce SYN resend delay if a suspicous ACK is received Date: Fri, 31 Jan 2020 18:05:08 +0100 Message-ID: <20200131170508.21323-1-sjpark@amazon.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.43.162.50] X-ClientProxiedBy: EX13D35UWC002.ant.amazon.com (10.43.162.218) 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 08:55:08 -0800 Eric Dumazet wrote: > On Fri, Jan 31, 2020 at 8:12 AM wrote: > > > > 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) > > canonical fied would be icsk->icsk_retransmits (look in net/ipv4/tcp_timer.c ) > > AFAIK, it seems we forget to clear tp->total_retrans in tcp_disconnect() > I will send a patch for this tp->total_retrans thing. Oh, then I will use 'tcsk->icsk_retransmits' instead of 'tp->total_retrans', in next spin. May I also ask you to Cc me for your 'tp->total_retrans' fix patch? Thanks, SeongJae Park > > > + 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 > > > > > > > >