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=-16.6 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,USER_AGENT_GIT,USER_IN_DEF_DKIM_WL autolearn=ham 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 AE445C43387 for ; Thu, 17 Jan 2019 19:24:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7C90920859 for ; Thu, 17 Jan 2019 19:24:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="oey4j6m8" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728566AbfAQTYA (ORCPT ); Thu, 17 Jan 2019 14:24:00 -0500 Received: from mail-pl1-f194.google.com ([209.85.214.194]:42108 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728515AbfAQTX7 (ORCPT ); Thu, 17 Jan 2019 14:23:59 -0500 Received: by mail-pl1-f194.google.com with SMTP id y1so5174067plp.9 for ; Thu, 17 Jan 2019 11:23:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=F8hL71RK9yDmbjbHqklM2P1BmEQjOwdqwqhyj2TEgL8=; b=oey4j6m8x7sUW+vCnQm/Ygho5fSmqysQEcNbELSmusR+JJl7Agu29FheqxwOaidvXH E99yVWW5BW6cG+UZ6QhUVVLs+agT616oRCuEZNLJz9n3vvp6qs/ZdujXcfD8FFd8W6jv 3c16pl53ddqxprZR9eldD0BWoJF9iRLBy1h02pTbHAn/FdtxIHvajn6TIBkcavalivDQ I43ATP6e+LOf1eFfxugtE0ctliPWgZ8cODTl2hckd5RbWDIAjZpni2dFVrjXC9zQTel/ 5eI/r5VkxCzfCjgr1x89/V6ve3CIQC90EEepqwIhn8gT5YyLLFwTisS6DhomXgjL1CQD Ys0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=F8hL71RK9yDmbjbHqklM2P1BmEQjOwdqwqhyj2TEgL8=; b=d63sq8U3KRZ8/Jd14FtXmcYpeV4tgjO1RiHyofzJ1cDmCmxRZcQtsHbE/bUPAQkyYC gksIK9kAafS42ljJL7UqLgX+dQur4n/3QNLTX3CAiaHGHvy+BkVO8l8KhJre6t3TzODE G/0Cf1lf61vDn4WCmBAZwSzNYVfDburY0ag918sdcqT0wmc1jssXe+VDuH1Zhcqf3Hec 3MAvleUs4JGYa02ff1P4uX+3vP8oFX055HJ3inVygTSAuCg2iXguHHpqzwo6Nn9wtkw7 0Xst0RkJDhZKjB0WSe38sttODhdBADTkA9xkG105iT25ArK+OLX7YseaAf3NKpcIZhYR 4pVA== X-Gm-Message-State: AJcUukcevvcGfetY8GA/smpdfpNFpn28hSFhmwVDAVZHkOevKH1d/+1l pyzjjVIEBvgoWi4DGZWKyYP81A== X-Google-Smtp-Source: ALg8bN7nFwUwyT9Kwh0a/qXu8kQY+1ot3Pqao86qbPyZaF0DbCwonqOar2nkVag1LkcpM5H3aWXwyQ== X-Received: by 2002:a17:902:4523:: with SMTP id m32mr16093414pld.53.1547753038170; Thu, 17 Jan 2019 11:23:58 -0800 (PST) Received: from localhost ([2620:15c:2c4:201:f5a:7eca:440a:3ead]) by smtp.gmail.com with ESMTPSA id z127sm5571487pfb.80.2019.01.17.11.23.57 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 17 Jan 2019 11:23:57 -0800 (PST) From: Eric Dumazet To: "David S . Miller" Cc: netdev , Soheil Hassas Yeganeh , Neal Cardwell , Yuchung Cheng , Eric Dumazet , Eric Dumazet Subject: [PATCH net-next 06/11] tcp: move snd_cwnd & snd_cwnd_cnt init to tcp_disconnect() Date: Thu, 17 Jan 2019 11:23:37 -0800 Message-Id: <20190117192342.71126-7-edumazet@google.com> X-Mailer: git-send-email 2.20.1.321.g9e740568ce-goog In-Reply-To: <20190117192342.71126-1-edumazet@google.com> References: <20190117192342.71126-1-edumazet@google.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Passive connections can inherit proper value by cloning, if we make sure all listeners have the proper values there. tcp_disconnect() was setting snd_cwnd to 2, which seems quite obsolete since IW10 adoption. Also remove an obsolete comment. Signed-off-by: Eric Dumazet --- net/ipv4/tcp.c | 2 +- net/ipv4/tcp_minisocks.c | 8 -------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 731b1c6e88a992e51b9e303803444dc255d888fa..3f99ad92eaedb2364e339842365f553fca8922e1 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -2578,10 +2578,10 @@ int tcp_disconnect(struct sock *sk, int flags) if (tp->write_seq == 0) tp->write_seq = 1; icsk->icsk_backoff = 0; - tp->snd_cwnd = 2; icsk->icsk_probes_out = 0; icsk->icsk_rto = TCP_TIMEOUT_INIT; tp->snd_ssthresh = TCP_INFINITE_SSTHRESH; + tp->snd_cwnd = TCP_INIT_CWND; tp->snd_cwnd_cnt = 0; tp->window_clamp = 0; tp->delivered_ce = 0; diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c index 35906b44e2cfa767f760773d0321a992114fee5b..ca96e7da99b6e450a5e881e280ad84137a57409d 100644 --- a/net/ipv4/tcp_minisocks.c +++ b/net/ipv4/tcp_minisocks.c @@ -490,14 +490,6 @@ struct sock *tcp_create_openreq_child(const struct sock *sk, newtp->last_oow_ack_time = 0; newtp->total_retrans = req->num_retrans; - /* So many TCP implementations out there (incorrectly) count the - * initial SYN frame in their delayed-ACK and congestion control - * algorithms that we must have the following bandaid to talk - * efficiently to them. -DaveM - */ - newtp->snd_cwnd = TCP_INIT_CWND; - newtp->snd_cwnd_cnt = 0; - /* There's a bubble in the pipe until at least the first ACK. */ newtp->app_limited = ~0U; -- 2.20.1.321.g9e740568ce-goog