From patchwork Thu Jan 17 19:23:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 1026917 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b="Dhl0nXwK"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 43gYsM0b6lz9sBZ for ; Fri, 18 Jan 2019 06:23:51 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728346AbfAQTXt (ORCPT ); Thu, 17 Jan 2019 14:23:49 -0500 Received: from mail-pf1-f195.google.com ([209.85.210.195]:41441 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726811AbfAQTXt (ORCPT ); Thu, 17 Jan 2019 14:23:49 -0500 Received: by mail-pf1-f195.google.com with SMTP id b7so5290123pfi.8 for ; Thu, 17 Jan 2019 11:23:48 -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=U6J7DaDD+TWl71EheTK3yf79nF4SvoyVf58QfBgAUs4=; b=Dhl0nXwKdHLvHeXAuVPSGU48CwiZXQ3iFDLk/Pz+RiDmncoXhpeqbpLKhZUf3A17J0 0YzOAte/qb7kyBlw7/egVNqJDGnDi2KoavVYcKf8nr+IyIrA1agU9KdlqmBqSGTrLipH MEZDkF3oOg841ihCsxmifVO9nOCd3zdZiA4UevK1R1206SvdbNOTk0+izVgq7Okqq0pG pYmm0euRPjiHrWvVAJLHT40A08MWz4oLkxmYLzKyyZl0IypjSJyx/AWrnO6opIjlNnvw Ioyd+UdKKf5IGhNUzUgFByyReujmR8xhOrA4jAk6NVp8pcUvOb4C0vbQHapNqU7d2b3d jhjA== 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=U6J7DaDD+TWl71EheTK3yf79nF4SvoyVf58QfBgAUs4=; b=Nqi1p3oOpkdMGnlifSYR4Io5fdKPGXvnEJ33tVU2nkziGwFP+EP+wUkYzEHtkHsSRu GQswe2mRhFsL/wzSGcgf1t9RWlXeszJHHTch+vGZsXFGMGjD/XuTxsOFlQJsp4cuR7yq gRhOMH8sD/ZVVvkWDGO1auv1xScfHLE696KMNGs8zFJUuvWZybyL47UX7OkEKARMFGrZ CXCysnl+w+bU89bbKwMxjJ1NrGWCgDpzDDiHht+UKqm5M+qnweTUBQF+KKRYRrNtmfpy 1JJzeB1x/QhTq/Cux7OrSwkikhu/Frv5DYPWJOFPxj2REJnLRCL82ENcTMk8BTGfJQEb KAJQ== X-Gm-Message-State: AJcUukfRt/os6ddJevobvZGJrCIf8/yr1dmM7Gf6z3uyv5gYE4GKEiFk 4gQWnrPfLMm3EJFlU//q5uBTpy5NdMY= X-Google-Smtp-Source: ALg8bN6B3VVFiyEbiE4yiw2ew/SI2G011H47GMG21lhs6uRliigT8+4TGWLJyuBaIE2CyP+BeXcntA== X-Received: by 2002:a62:33c1:: with SMTP id z184mr16122802pfz.104.1547753028243; Thu, 17 Jan 2019 11:23:48 -0800 (PST) Received: from localhost ([2620:15c:2c4:201:f5a:7eca:440a:3ead]) by smtp.gmail.com with ESMTPSA id l5sm7628777pgu.86.2019.01.17.11.23.46 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 17 Jan 2019 11:23:47 -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 01/11] tcp: do not set snd_ssthresh in tcp_create_openreq_child() Date: Thu, 17 Jan 2019 11:23:32 -0800 Message-Id: <20190117192342.71126-2-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 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org New sockets get the field set to TCP_INFINITE_SSTHRESH in tcp_init_sock() In case a socket had this field changed and transitions to TCP_LISTEN state, tcp_disconnect() also makes sure snd_ssthresh is set to TCP_INFINITE_SSTHRESH. So a listener has this field set to TCP_INFINITE_SSTHRESH already. Signed-off-by: Eric Dumazet --- net/ipv4/tcp_minisocks.c | 1 - 1 file changed, 1 deletion(-) diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c index 12affb7864d981a6494059232c4965aaee756803..0cffa5937b1261984c3986b107220af495264437 100644 --- a/net/ipv4/tcp_minisocks.c +++ b/net/ipv4/tcp_minisocks.c @@ -488,7 +488,6 @@ struct sock *tcp_create_openreq_child(const struct sock *sk, newtp->packets_out = 0; newtp->retrans_out = 0; newtp->sacked_out = 0; - newtp->snd_ssthresh = TCP_INFINITE_SSTHRESH; newtp->tlp_high_seq = 0; newtp->lsndtime = tcp_jiffies32; newsk->sk_txhash = treq->txhash; From patchwork Thu Jan 17 19:23:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 1026918 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b="rc4Iug0J"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 43gYsP1VjKz9sBZ for ; Fri, 18 Jan 2019 06:23:53 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728454AbfAQTXv (ORCPT ); Thu, 17 Jan 2019 14:23:51 -0500 Received: from mail-pl1-f193.google.com ([209.85.214.193]:44405 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726811AbfAQTXv (ORCPT ); Thu, 17 Jan 2019 14:23:51 -0500 Received: by mail-pl1-f193.google.com with SMTP id e11so5167852plt.11 for ; Thu, 17 Jan 2019 11:23:50 -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=/ctxZfg3TRQGFzaG7Ffmpf692LcU/EVHXP4CpD7kyh0=; b=rc4Iug0J2LuUDZfiWUGry865HmqiKNoQ4bvePA6YD+pzC7rauzZXTOoi+2cyavYElv VO8KO8EqB8wpUkWp44R/Cjlvsry1vGNv4189CEjdJlikNaAa+8Rls+Xvm0jzW24CwQ7A djGp2S4tuWptAgmpVqO7BRLUfaKiuLkfKPYFJG3FLq7dNY0i3E5+pwTwIkmbZ6tRMik7 ZIONi93sKvn1pa5yNXgB3wYWRSghN6HkLY0Q7Zmklr5RtXLhfAGjIPolFcZdxsMcqVJX TMSzUoeBI8JYDd13XLohAdAEFdcNyOCG96hoU/D3rOriAnBIXcVti2hq7NCXY+XOCbYJ 3rAA== 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=/ctxZfg3TRQGFzaG7Ffmpf692LcU/EVHXP4CpD7kyh0=; b=T9XSCpYgYsMh2jmRgx+76Uu72T5on/Vguu0p69qp7x7uVWtdAe+Sne92KtXXyBycTl YWshC8Df32GwivgDNdV4igGvpJbreW6ZBQip5IphHdn5E9MFjMe02aVfGhHOioHYqmfI PyLrvBxs44S5DTWZCVfTBxi2lTMhX95ZukMseIskJuBODkz1LqSr4gUvyl1fC4rKJ1Ns QNUY4InyFJ3uASfZZQ4uPHAaPPIoMVi4djPMvPQ28jDJ3+pHEfN4/DXsWvGOiXn7mlo2 lDcIhErc+IEVdlEYud+5fl2QVnIRFNxIm1bJSTtVFJBJpYMGhQY8jdmqS1C8mqXWt2w4 fmHw== X-Gm-Message-State: AJcUukdgkydL9hbCOZ1DaULjlj9kg+dIRBwORWDs8MrT8Yg01FRVrqRG sO56oUjauPLB18JjtEsdOIZBzQ== X-Google-Smtp-Source: ALg8bN4egFtqutAyYvelL3l52yE4seoeA11hGUYcKpX+wDY0kjZmMX2g4t/tfmFUL+YGR++GWIQAcg== X-Received: by 2002:a17:902:780c:: with SMTP id p12mr15836797pll.197.1547753030199; Thu, 17 Jan 2019 11:23:50 -0800 (PST) Received: from localhost ([2620:15c:2c4:201:f5a:7eca:440a:3ead]) by smtp.gmail.com with ESMTPSA id r8sm3354532pgu.38.2019.01.17.11.23.49 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 17 Jan 2019 11:23:49 -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 02/11] tcp: move icsk_rto init to tcp_disconnect() Date: Thu, 17 Jan 2019 11:23:33 -0800 Message-Id: <20190117192342.71126-3-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 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org If we make sure a listener always has its icsk_rto field set to TCP_TIMEOUT_INIT, we do not need to rewrite this field after a new clone is created. tcp_disconnect() is very seldom used in real applications. Signed-off-by: Eric Dumazet --- net/ipv4/tcp.c | 1 + net/ipv4/tcp_minisocks.c | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 27e2f6837062374baaea267a8788b9fd91db25ff..9d8131f95a9732fb873c8a8b2c918657e1dade30 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -2579,6 +2579,7 @@ int tcp_disconnect(struct sock *sk, int flags) 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_cnt = 0; tp->window_clamp = 0; diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c index 0cffa5937b1261984c3986b107220af495264437..9799f1d32e44f4c733b41c4d8fc7739970ccca28 100644 --- a/net/ipv4/tcp_minisocks.c +++ b/net/ipv4/tcp_minisocks.c @@ -482,7 +482,6 @@ struct sock *tcp_create_openreq_child(const struct sock *sk, newtp->srtt_us = 0; newtp->mdev_us = jiffies_to_usecs(TCP_TIMEOUT_INIT); minmax_reset(&newtp->rtt_min, tcp_jiffies32, ~0U); - newicsk->icsk_rto = TCP_TIMEOUT_INIT; newicsk->icsk_ack.lrcvtime = tcp_jiffies32; newtp->packets_out = 0; From patchwork Thu Jan 17 19:23:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 1026920 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b="QDCbdWag"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 43gYsT6hP1z9sBZ for ; Fri, 18 Jan 2019 06:23:57 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728479AbfAQTXz (ORCPT ); Thu, 17 Jan 2019 14:23:55 -0500 Received: from mail-pl1-f195.google.com ([209.85.214.195]:38407 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726811AbfAQTXx (ORCPT ); Thu, 17 Jan 2019 14:23:53 -0500 Received: by mail-pl1-f195.google.com with SMTP id e5so5180732plb.5 for ; Thu, 17 Jan 2019 11:23:52 -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=8vChZulYXQQw5LZAYTihXyExBUxLh5752IfQyWqGAB0=; b=QDCbdWag4yXWmluGFMIRRln9ZWEFnCpBKZ8WPyrjyXJKGGsYspCfJi6GUnR3cuZfTj I3JSn6Zk5txdKUB0C+p2wRvKIeH0TYT5hI0wY+8ch5iP1HFWYFrHKtiPRVLYpS1f9oot zcTfLWz6qlhCq2g7Z3A8sXP+WoaC/wuqW26REhajtk29g4NONiV28HyLD7MtRMiuug3F KcDiT3vv04p3IAJM/+lafYE1S91vsH3MoLPkVWysZwJ3RSCRZ5jGSswClufvbb89Rig+ nlXbHX0Euib7snVWRs2Q/r3Iuh+5m8RV/7pmDD8RDRtcjU10+OsapdQf4cy0lBV9zqra 04nA== 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=8vChZulYXQQw5LZAYTihXyExBUxLh5752IfQyWqGAB0=; b=hX640mAxafC7NFbmfBZMU7KP9JQKiv1Ug/qRKd6kfyVBCBosjVdWw7Yga3JEaTP//0 0PlDT+g+8oFViLGJnSWk1qcVWAMTE+Bb0OcT8piLtcdgt8l268nMykhzDYg+NyyXxMHl zmeOcW2AF8NCqjwMEURgtUWOdBLc8nN2svijHi8iU5G9LQNStw9C7BgVhoN31m1FG9Ph Ge7HwnRFyOYaoSzkHBuPFTGc0d0TesRmeko50gvB/6f4TsOFy2iGUtjF1zEFDI1sfxin Y3zxYXCVpFjanOBmGprRCKGD1YIxFAYfuISD+diydYh75DptQnhy3hyJm9fhRQPBxIJ2 8nfg== X-Gm-Message-State: AJcUukfc4D0cmna7ZWoWYFVqrh9A4H025cyljYdPWO9ck+1mmnOYIaR7 qC9i9HyC+gEH+VGkJjE9qiOn2g== X-Google-Smtp-Source: ALg8bN6k8Pn4M5zOP66rmSNNyb6NVFGVCzGER9/1DTbIcDQgppbM+7wO7EnYpVTD1DUOIoKPSxIAyQ== X-Received: by 2002:a17:902:bb86:: with SMTP id m6mr16339625pls.315.1547753032325; Thu, 17 Jan 2019 11:23:52 -0800 (PST) Received: from localhost ([2620:15c:2c4:201:f5a:7eca:440a:3ead]) by smtp.gmail.com with ESMTPSA id p6sm4007178pfn.53.2019.01.17.11.23.51 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 17 Jan 2019 11:23:51 -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 03/11] tcp: do not clear packets_out in tcp_create_openreq_child() Date: Thu, 17 Jan 2019 11:23:34 -0800 Message-Id: <20190117192342.71126-4-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 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org New sockets have this field cleared, and tcp_disconnect() calls tcp_write_queue_purge() which among other things also clear tp->packets_out So a listener is guaranteed to have this field cleared. Signed-off-by: Eric Dumazet --- net/ipv4/tcp_minisocks.c | 1 - 1 file changed, 1 deletion(-) diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c index 9799f1d32e44f4c733b41c4d8fc7739970ccca28..830e4eb558f8861fb3813c35b215425a53cacf62 100644 --- a/net/ipv4/tcp_minisocks.c +++ b/net/ipv4/tcp_minisocks.c @@ -484,7 +484,6 @@ struct sock *tcp_create_openreq_child(const struct sock *sk, minmax_reset(&newtp->rtt_min, tcp_jiffies32, ~0U); newicsk->icsk_ack.lrcvtime = tcp_jiffies32; - newtp->packets_out = 0; newtp->retrans_out = 0; newtp->sacked_out = 0; newtp->tlp_high_seq = 0; From patchwork Thu Jan 17 19:23:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 1026919 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b="ktDeWic3"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 43gYsS2kZJz9sBZ for ; Fri, 18 Jan 2019 06:23:56 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728503AbfAQTXz (ORCPT ); Thu, 17 Jan 2019 14:23:55 -0500 Received: from mail-pl1-f193.google.com ([209.85.214.193]:40632 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728457AbfAQTXz (ORCPT ); Thu, 17 Jan 2019 14:23:55 -0500 Received: by mail-pl1-f193.google.com with SMTP id u18so5180188plq.7 for ; Thu, 17 Jan 2019 11:23:54 -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=9u/1OI8yK+xNU4ZpZyFAV5R6+XBcv4f1YEjO0kjztnk=; b=ktDeWic3XbYqiz3rJVQIhvZRhKlUShMkwCffWsJ14gBwp5TqYTwQIolGiqQSjKNh3+ TTqnjwiT1QVGPGABxHbiaDz8GY+cn4UDYdiNHvKrDkaY0UkmENHqHjiY9Hnpllyofyx5 dQYt6lTr9+iP8i+r1N6L/ECxvTcr1mBVFQRz/cXgyCPZ5VKRILR613qsXO1R+u240o6j +ygJyOEvZAXlk/zSRS9PGbI1d3zsLczphI+2WRLoRVkvbYDpAKgKHxahalFMv78/y/UN 160j/CkbBEfinMetMEHFnF8AogzBihrPmMjvcgfN7oHr+ipNVf+xEy3Kd7MdxLTPUsc3 XbHg== 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=9u/1OI8yK+xNU4ZpZyFAV5R6+XBcv4f1YEjO0kjztnk=; b=SfTXtJl/nGEUzNEGnjlsuhViqJhWVZxOFfVhE0DMBfKZqajDBipczMSVV4u8v/i2e0 UrqNoFdxp+Kguw/D0uhlo/qmRTP7iIhVnXdPiD7C6Q51H/8Ks6QyGO38Wv1E6c4Vda4e 4jejNL11t/LM01UnCBnZCBkL1HTuMiw8Iuh/cE+vYUBOjvPrAwCrBRHf90rEsornRZQL b4PlnbEKpdRT5J7Z9J+ceWoP0xMqnSoLKxs6E5UtKciyDB2dvXjy+h37ZXHA6ss6cnPW p63Jy+Vzk4QvI9MsnMC88g52lvM0hieqQT/EVWoU/TvEhsJQfAmf+eoJCkr3L/IunsEa RcTw== X-Gm-Message-State: AJcUukenAzGR/1hHBTuafElqbAOhwUX34nSLGFJej/yc8KJMYLupZjDq +F2NOybXE12a9to+v3Yi3GhM4ZaRQoE= X-Google-Smtp-Source: ALg8bN6/9DyUAy2ABBnCAUU0ZGbA6qhcM69Xc1L0CBhnDZm9q7BC4QmrhcraALo6wTcKvi6JeAAD4g== X-Received: by 2002:a17:902:6f09:: with SMTP id w9mr16548170plk.309.1547753034309; Thu, 17 Jan 2019 11:23:54 -0800 (PST) Received: from localhost ([2620:15c:2c4:201:f5a:7eca:440a:3ead]) by smtp.gmail.com with ESMTPSA id d68sm3546762pfa.64.2019.01.17.11.23.53 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 17 Jan 2019 11:23:53 -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 04/11] tcp: do not clear srtt_us in tcp_create_openreq_child Date: Thu, 17 Jan 2019 11:23:35 -0800 Message-Id: <20190117192342.71126-5-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 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org All listeners have this field cleared already, since tcp_disconnect() clears it and newly created sockets have also a zero value here. So a clone will inherit a zero value here. Signed-off-by: Eric Dumazet --- net/ipv4/tcp_minisocks.c | 1 - 1 file changed, 1 deletion(-) diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c index 830e4eb558f8861fb3813c35b215425a53cacf62..977ad1c0cccad564fa111556ad0a0f3af4534381 100644 --- a/net/ipv4/tcp_minisocks.c +++ b/net/ipv4/tcp_minisocks.c @@ -479,7 +479,6 @@ struct sock *tcp_create_openreq_child(const struct sock *sk, tcp_init_wl(newtp, treq->rcv_isn); - newtp->srtt_us = 0; newtp->mdev_us = jiffies_to_usecs(TCP_TIMEOUT_INIT); minmax_reset(&newtp->rtt_min, tcp_jiffies32, ~0U); newicsk->icsk_ack.lrcvtime = tcp_jiffies32; From patchwork Thu Jan 17 19:23:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 1026921 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b="ZX0OWRBt"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 43gYsW5GNgz9sBZ for ; Fri, 18 Jan 2019 06:23:59 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728537AbfAQTX6 (ORCPT ); Thu, 17 Jan 2019 14:23:58 -0500 Received: from mail-pf1-f193.google.com ([209.85.210.193]:36724 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728457AbfAQTX5 (ORCPT ); Thu, 17 Jan 2019 14:23:57 -0500 Received: by mail-pf1-f193.google.com with SMTP id b85so5299301pfc.3 for ; Thu, 17 Jan 2019 11:23:56 -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=7YiBeVDTUuhBpOk0Xc2wOvwo7j8S51odBfQhw5BvF/g=; b=ZX0OWRBtD+OB/1O6RPfA/09BlDxT3fuz4aa8vMd2JO430WIw8fkeHoNjwTbSAPX/8T FrTC++BxrzmWSkDdkDK+BwPf740XW3k7ZCdHoGlCVGaCKWmuq9y3srsDQyoh/Hfc64zJ oBCUrjIgFLG0rYRbQ6FzFBQ7xkfv3+ji5E+f/B2gtBm6cEUEZYAhIypvMU8aSNtxJXbX CFux9cEbfVbocmumwBLY7PMI3tMzR2oh9/x+qrAWaxhuSG4aGso7GeOeV3z5EKheMBfR Dj9f95W4kXY2g616iPCphSBN265SZZ+Qt7wtjTddq5CZ/RDwFcgZ283zVEmsyJ1o85JZ XrWg== 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=7YiBeVDTUuhBpOk0Xc2wOvwo7j8S51odBfQhw5BvF/g=; b=Ne54c8sr+t9XSYeCnKUBvM6XqkDOWcGPm8LVifVfHiF2P30H4L6gWlYx00tRLfBZ3/ xd0CB2R5mML1KpAqk2DR5i+sWfPLcaYNXuhbxaLIWaihyOfIniMA9qqHZEcakhO9Z02k aT5gYnKT2vucCDHT1lWDZBfZV6jTf/w8Rh/Qnh9nb/s3cjzNP7SCsC8ksSithG9V+dZ3 hGOB+kLGcASPc5dTKy2zALWdFuvrX127I5/KpcvZYouY2q4AyaR/KhhHWk/MTiGeOk7c nhdFEksS5AVuKfMEyDXuQitwddu6ERPSGjPMbpfckKqUlply3on0gWdLV/uLta8P8+eU 0kOg== X-Gm-Message-State: AJcUuketXy1O1k+84SoZLJ0XXLpmpVZgaHWgFXj31ifBcYWpYXajpLR9 B5yp+B9s0dWLHZxfke8pJe0YSw== X-Google-Smtp-Source: ALg8bN4p25Gh5gekqZ3uL78n7ww0cbEEBTuDKQS1iP6tcg8InyiRUj65l84wbskVlGxndd85D4jUcw== X-Received: by 2002:a63:5f50:: with SMTP id t77mr14639454pgb.76.1547753036227; Thu, 17 Jan 2019 11:23:56 -0800 (PST) Received: from localhost ([2620:15c:2c4:201:f5a:7eca:440a:3ead]) by smtp.gmail.com with ESMTPSA id h185sm3278481pfg.143.2019.01.17.11.23.55 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 17 Jan 2019 11:23:55 -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 05/11] tcp: move mdev_us init to tcp_disconnect() Date: Thu, 17 Jan 2019 11:23:36 -0800 Message-Id: <20190117192342.71126-6-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 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org If we make sure a listener always has its mdev_us field set to TCP_TIMEOUT_INIT, we do not need to rewrite this field after a new clone is created. tcp_disconnect() is very seldom used in real applications. Signed-off-by: Eric Dumazet --- net/ipv4/tcp.c | 1 + net/ipv4/tcp_minisocks.c | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 9d8131f95a9732fb873c8a8b2c918657e1dade30..731b1c6e88a992e51b9e303803444dc255d888fa 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -2572,6 +2572,7 @@ int tcp_disconnect(struct sock *sk, int flags) sk->sk_shutdown = 0; sock_reset_flag(sk, SOCK_DONE); tp->srtt_us = 0; + tp->mdev_us = jiffies_to_usecs(TCP_TIMEOUT_INIT); tp->rcv_rtt_last_tsecr = 0; tp->write_seq += tp->max_window + 2; if (tp->write_seq == 0) diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c index 977ad1c0cccad564fa111556ad0a0f3af4534381..35906b44e2cfa767f760773d0321a992114fee5b 100644 --- a/net/ipv4/tcp_minisocks.c +++ b/net/ipv4/tcp_minisocks.c @@ -479,7 +479,6 @@ struct sock *tcp_create_openreq_child(const struct sock *sk, tcp_init_wl(newtp, treq->rcv_isn); - newtp->mdev_us = jiffies_to_usecs(TCP_TIMEOUT_INIT); minmax_reset(&newtp->rtt_min, tcp_jiffies32, ~0U); newicsk->icsk_ack.lrcvtime = tcp_jiffies32; From patchwork Thu Jan 17 19:23:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 1026922 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b="oey4j6m8"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 43gYsZ4M7Bz9sBZ for ; Fri, 18 Jan 2019 06:24:02 +1100 (AEDT) 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 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; From patchwork Thu Jan 17 19:23:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 1026923 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b="ab6u8AR5"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 43gYsc35Hdz9sBZ for ; Fri, 18 Jan 2019 06:24:04 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728571AbfAQTYC (ORCPT ); Thu, 17 Jan 2019 14:24:02 -0500 Received: from mail-pg1-f195.google.com ([209.85.215.195]:38537 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728542AbfAQTYB (ORCPT ); Thu, 17 Jan 2019 14:24:01 -0500 Received: by mail-pg1-f195.google.com with SMTP id g189so4860107pgc.5 for ; Thu, 17 Jan 2019 11:24:00 -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=Ln8un1JifUdIYYRzJ1qaBlvIw09pGybu1JjaIB2x73M=; b=ab6u8AR5ua+6KE5sziSmo5iJ0VTG4VvFoHX0BqaHLnMoE9XWiv9WwBlDaXnlGsUPMs AjTrGk2Adt0nHLUS4/c12pq31LOpZE4+9ugCdb94bKq3wVhHe+4Rotobm0i0JtDqUojT kOcjlLtbrFPcCWUjboZ3F7vWkIIrSnFFXgdroiTKwj2NKpdiC8DuREV4TTPZ6zuOL9WK k7OEJv5cbES6k9fTJ+c0uhy7R4XoHBc257c+TVb6/OLn4mYkH8QBLeMv/FbssOJDADd+ kVnmd8NFwvM/Id60EBCc9GoRpT8wBHmP3bGH926UyQKdUlcsirUC1hnfAmMJOzDWLk9g DfNg== 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=Ln8un1JifUdIYYRzJ1qaBlvIw09pGybu1JjaIB2x73M=; b=DpTwoJL/+l4eTtBRaC/h+jqLdLO3ru77etiIvcf1+siLQUNTDZlr2KlFS+xhcNXo55 RnNMpwULQz0YKZ1o0DES7iVGMLSmOqQ4zkZ1SwtR1AZvvJlWlH6kznq0wMfAhqrW8Ren Wtc79t2MQhGv/njdUi4kaS6l32AroC/dUJ+kSEZRkPUb0vm6MSltz/XhLKAmOs7O/JzJ 2AfDANJvKmpBdd7aZKrcGhlEgiY8IHBXY8Juc+68XcD4WoqUCUZ7xOfyTu+73ZQgiC7I b2IX3vLMzooIGr7HHOjjlMzE6zOZzIegi4PR3RkIw7R3RhV7TSlv60NHp+KXBLUY4hvd 7GCA== X-Gm-Message-State: AJcUukd76yjdMKU4gGaiExdLXqqq89V7fV+/WC7OhtTYqyN5cMuJqecU NH4vXHH+hT6aznqEsfgd1pe7QQ== X-Google-Smtp-Source: ALg8bN51boBn9XTQnNB9pSYV1YRGRXN/ujG7sZsXYKeIm0UtZgM5qG+v9irbcv1dUovczEcHyqh7oQ== X-Received: by 2002:a63:6984:: with SMTP id e126mr14809562pgc.143.1547753040054; Thu, 17 Jan 2019 11:24:00 -0800 (PST) Received: from localhost ([2620:15c:2c4:201:f5a:7eca:440a:3ead]) by smtp.gmail.com with ESMTPSA id j70sm3376012pfc.43.2019.01.17.11.23.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 17 Jan 2019 11:23:59 -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 07/11] tcp: do not clear urg_data in tcp_create_openreq_child Date: Thu, 17 Jan 2019 11:23:38 -0800 Message-Id: <20190117192342.71126-8-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 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org All listeners have this field cleared already, since tcp_disconnect() clears it and newly created sockets have also a zero value here. So a clone will inherit a zero value here. Signed-off-by: Eric Dumazet --- net/ipv4/tcp_minisocks.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c index ca96e7da99b6e450a5e881e280ad84137a57409d..2747aa72b8e2b5c190c2c3e68a7dea04ee97dcac 100644 --- a/net/ipv4/tcp_minisocks.c +++ b/net/ipv4/tcp_minisocks.c @@ -501,8 +501,6 @@ struct sock *tcp_create_openreq_child(const struct sock *sk, newtp->rx_opt.dsack = 0; newtp->rx_opt.num_sacks = 0; - newtp->urg_data = 0; - if (sock_flag(newsk, SOCK_KEEPOPEN)) inet_csk_reset_keepalive_timer(newsk, keepalive_time_when(newtp)); From patchwork Thu Jan 17 19:23:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 1026924 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b="fzYqC5Vq"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 43gYsf2tDyz9sBn for ; Fri, 18 Jan 2019 06:24:06 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728587AbfAQTYF (ORCPT ); Thu, 17 Jan 2019 14:24:05 -0500 Received: from mail-pg1-f195.google.com ([209.85.215.195]:33147 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728570AbfAQTYD (ORCPT ); Thu, 17 Jan 2019 14:24:03 -0500 Received: by mail-pg1-f195.google.com with SMTP id z11so4874804pgu.0 for ; Thu, 17 Jan 2019 11:24:02 -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=C+tAZLIJRdKrZe8u1mlMNpAYHQzaJ0CVyBU8x9p28tk=; b=fzYqC5VqFcDPHiC0+5u3R36xlbHIuixJ5eBQ3rIxD6PG+Y34wZyTP0hocUcYkUHBQk OiiepdQXla3jsfKpJ/6ZR4jxJAbGEQPzO7qwr5OzBtvIcHSMgzZ7mL4NSKSdgX2+sc6s kZ9uzUCdhihQmlo5axvDadRmRi49neB9Qau32Cdr2M9ijWLWjJ8Zn52aEUut37COMPXb ZeLO/r1xpleTWeLcKwkUJrgdtvIiArmHPNj1QZcjUjhv9kCKymESia3Eit9t260jKm3+ Y6yD7gqbCVtFx3WeAPMPxgT5bKhTr7D+LCmk2h9YE6y2c8XtkIjOTuvwUeZl2ujU+mUT IdcA== 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=C+tAZLIJRdKrZe8u1mlMNpAYHQzaJ0CVyBU8x9p28tk=; b=nK9oXQq/htdwMcqMrbxEjwJURR5WsDwzsLMMCrDDBLA6Wf/PHGKxAi0+K29lwc1+6J P1lrNLjNWgojBP+L6n6LPXS0WBtpCA2G15CZHqwNeJ9Tu5hMbem+ercGQbszrlhy+BVF FV8M1w6bBnrFJ0kN7OVdVF2FMXlw9kfCVUl2KZ1r0JPNDZMHvzXh0hPLXSOrEJbXMlUo lrFkgFE4cWOLW55xh4MhrIvlG9V47j4uehZbHorZQR2eDuCyF64GiWGDb/eOXUm//Fyy OA3u8CWyDjGgehQizGOiBhzCvda+53IFXIGc1qYzTFKmXTJC77/S8Fo97GJXFzSIatOM pHHQ== X-Gm-Message-State: AJcUukfHHeV4gaa7hn/x2F1ZlIU/EVfJgi+Dlffm2MUTUMdVvjZPRfbs DPmSRW98jhmY7YKqo9xRd1Vgdw== X-Google-Smtp-Source: ALg8bN6XPrDeNt1Gq4QD3RX47h/IcNmj5Bds072fPcpXnxxyldKZkAo4SrtucOREp9rw9dlLNxXnOQ== X-Received: by 2002:a62:29c3:: with SMTP id p186mr16391039pfp.117.1547753042022; Thu, 17 Jan 2019 11:24:02 -0800 (PST) Received: from localhost ([2620:15c:2c4:201:f5a:7eca:440a:3ead]) by smtp.gmail.com with ESMTPSA id l184sm4247468pfc.112.2019.01.17.11.24.01 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 17 Jan 2019 11:24:01 -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 08/11] tcp: move retrans_out, sacked_out, tlp_high_seq, last_oow_ack_time init to tcp_disconnect() Date: Thu, 17 Jan 2019 11:23:39 -0800 Message-Id: <20190117192342.71126-9-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 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org If we make sure all listeners have these fields cleared, then a clone will also inherit zero values. Signed-off-by: Eric Dumazet --- net/ipv4/tcp.c | 4 ++++ net/ipv4/tcp_minisocks.c | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 3f99ad92eaedb2364e339842365f553fca8922e1..551ad8604bea0cb459805165bb216a99fd3bd8e2 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -2605,6 +2605,10 @@ int tcp_disconnect(struct sock *sk, int flags) tp->duplicate_sack[0].end_seq = 0; tp->dsack_dups = 0; tp->reord_seen = 0; + tp->retrans_out = 0; + tp->sacked_out = 0; + tp->tlp_high_seq = 0; + tp->last_oow_ack_time = 0; /* Clean up fastopen related fields */ tcp_free_fastopen_req(tp); diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c index 2747aa72b8e2b5c190c2c3e68a7dea04ee97dcac..29fba13849a79695b3f62a989b27157b57caedfb 100644 --- a/net/ipv4/tcp_minisocks.c +++ b/net/ipv4/tcp_minisocks.c @@ -482,12 +482,8 @@ struct sock *tcp_create_openreq_child(const struct sock *sk, minmax_reset(&newtp->rtt_min, tcp_jiffies32, ~0U); newicsk->icsk_ack.lrcvtime = tcp_jiffies32; - newtp->retrans_out = 0; - newtp->sacked_out = 0; - newtp->tlp_high_seq = 0; newtp->lsndtime = tcp_jiffies32; newsk->sk_txhash = treq->txhash; - newtp->last_oow_ack_time = 0; newtp->total_retrans = req->num_retrans; /* There's a bubble in the pipe until at least the first ACK. */ From patchwork Thu Jan 17 19:23:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 1026925 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b="GkyL0fd2"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 43gYsg6Q9pz9sBn for ; Fri, 18 Jan 2019 06:24:07 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728599AbfAQTYG (ORCPT ); Thu, 17 Jan 2019 14:24:06 -0500 Received: from mail-pf1-f194.google.com ([209.85.210.194]:43536 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728577AbfAQTYF (ORCPT ); Thu, 17 Jan 2019 14:24:05 -0500 Received: by mail-pf1-f194.google.com with SMTP id w73so5283300pfk.10 for ; Thu, 17 Jan 2019 11:24:04 -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=fSbSz0jGKrJSoGIO4W9LcTdIeM0vHMDhnFGnRA9Ydkk=; b=GkyL0fd2nVgh8pW0LA9PjQKJ1aeCLt1oS2Kwh2IhyGfgKI4hZ+5c0GKPgwT/OdVfMG bPB0sP5ouLnwou0nEAVOGfTn/7+nmPAQaJe6bKdjsV5B6JQBhyM/TQPNy8cWMv/VJ6bx HKli0SBzMq1dYIijd7PGRDTTwj2ZXWiHBQ0GV3BIvt07RS6JaLuha2zJ63oG1nR9u8bU ZUqvlzdnUXFM+J6yW8klbk30GbArHNHuHPZLYZg5L/D79uolTu1ur2O53Ef8U/ZfAzje bLowauK9sh/763TOE6EmZShTRF36MZSAkZv9HhVAEfKCedN3Rpe1/64DZqyr65km5EKx i6yw== 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=fSbSz0jGKrJSoGIO4W9LcTdIeM0vHMDhnFGnRA9Ydkk=; b=T5AqKo+QstmVGgb3bhPR1HuYWHs0OQRkEpn3QBle89lpPJyoayBca2+pUFnJCFPKS5 Y/tj1a07JwTN6hSZRz6a9gaFDQUkr2g8aryr+8kG4vO8Xb00Vsg0wvBZw6R1EvzBg6Ro ASiGig/gWm/Fyqd4oLNPNbbFTb4r0WY99wlQgpnk7X9yCVjqEff6z6NrnPF7qGMp+Ryx pwqXGCDQaV8htw8Bux799iN39r6/91VEGZkKonlbA6/okauyP685pY4ZBXMkX06xSJAW TDw6CYmyoGfoltNcJimLKwtS3SmbozeHaiZ1cPDZ3bi9RDxDj6+ui7GdnfiW9mMXkphn vS8g== X-Gm-Message-State: AJcUukfr8FSCPH7CIuw4B1yZuD3NZ3/MT8DSKFut/IP7W1e6wriu3F7t CbdzXyQsZOeI/7Mh0SWqcgOBPA== X-Google-Smtp-Source: ALg8bN6OG872mgE4LSyQXywlDaAgkis1C2LIEKn9SU9/d7LXLPkLyycNTDHxirR/kjk9sQ/H6TAxKg== X-Received: by 2002:a62:140a:: with SMTP id 10mr15975983pfu.157.1547753044271; Thu, 17 Jan 2019 11:24:04 -0800 (PST) Received: from localhost ([2620:15c:2c4:201:f5a:7eca:440a:3ead]) by smtp.gmail.com with ESMTPSA id 5sm5199925pfz.149.2019.01.17.11.24.03 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 17 Jan 2019 11:24:03 -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 09/11] tcp: move app_limited init to tcp_disconnect() Date: Thu, 17 Jan 2019 11:23:40 -0800 Message-Id: <20190117192342.71126-10-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 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org If we make sure all listeners have app_limited set to ~0U, then a clone will also inherit proper initial value. Signed-off-by: Eric Dumazet --- net/ipv4/tcp.c | 3 +++ net/ipv4/tcp_minisocks.c | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 551ad8604bea0cb459805165bb216a99fd3bd8e2..5f15fcc9612ae6b6964ca15660dbb7eb8cd71d83 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -2609,6 +2609,9 @@ int tcp_disconnect(struct sock *sk, int flags) tp->sacked_out = 0; tp->tlp_high_seq = 0; tp->last_oow_ack_time = 0; + /* There's a bubble in the pipe until at least the first ACK. */ + tp->app_limited = ~0U; + /* Clean up fastopen related fields */ tcp_free_fastopen_req(tp); diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c index 29fba13849a79695b3f62a989b27157b57caedfb..13f3c6444efa63b63fe38bf4606c91fa962ec584 100644 --- a/net/ipv4/tcp_minisocks.c +++ b/net/ipv4/tcp_minisocks.c @@ -486,9 +486,6 @@ struct sock *tcp_create_openreq_child(const struct sock *sk, newsk->sk_txhash = treq->txhash; newtp->total_retrans = req->num_retrans; - /* There's a bubble in the pipe until at least the first ACK. */ - newtp->app_limited = ~0U; - tcp_init_xmit_timers(newsk); newtp->write_seq = newtp->pushed_seq = treq->snt_isn + 1; From patchwork Thu Jan 17 19:23:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 1026926 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b="j5oGUqsj"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 43gYsk1vTKz9sBZ for ; Fri, 18 Jan 2019 06:24:10 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728626AbfAQTYI (ORCPT ); Thu, 17 Jan 2019 14:24:08 -0500 Received: from mail-pg1-f194.google.com ([209.85.215.194]:37169 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728577AbfAQTYH (ORCPT ); Thu, 17 Jan 2019 14:24:07 -0500 Received: by mail-pg1-f194.google.com with SMTP id c25so4866338pgb.4 for ; Thu, 17 Jan 2019 11:24:07 -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=fyRNu/mCSJO2WmfVbWvgjGL5+hKT7/GINi1Ne3FvUuc=; b=j5oGUqsjS9OBwchPVEpdFbYSDw3eNlf0gY3UYJbcPI1V6Nx1gbUAHJm+BUbpUkV15v 5OptOz2jkpurfGK5DbD1SRf3QWSOH3TUfXQ7LN9WpE7WLY6VM5EPgGIGdfA3om/SfDFR n6HDWt25gUZlGAyKAYhRRLSnuwN8pO21rvLHH4M+Wm6e+aYhux7Z7eH+nB2vyCcAmxKC Vi9bwDkD35O+nealoXx353zMi3OeC/HUs/XMf6yWEx3H7PkFA9On2zNq9r5sDqjhbVa8 AisCdCLBdfw5C+j98eVIrUaMrt4HLfIlQkhcYHUH/TMOox+8WJ7XdfZblonoDLpXGch9 I1kg== 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=fyRNu/mCSJO2WmfVbWvgjGL5+hKT7/GINi1Ne3FvUuc=; b=MziUlghURT2UeR4MsrUs9s+y8TY2Gia0BXbeJ6u3ACw50FYmQPwgxzh30TwuQ4HopQ jpuvXTSlrn0qEz9YBH9drAnTEPipF8bkgCVGTLCeCa8+3CPP6aFyLAMewWwas1FPrWdn +YIneFr5onoOaq9oRqVTuL4CF7ytlJ4+TL6K/3HionO6Tfx1qoScPsuV3trCIlEulykM i3N7n/L7waStku6VfC0pXzirOaLaKMU4tcdg05Z0T8xiyUZZtoBNMbpGOm945jDPI5Zn K6TIiICw/KKJIIAB+kAuPAyvNcGHdbROglfIQ+i65rHnKgzCBFPAsj2DGyrTINRnZddG ufwQ== X-Gm-Message-State: AJcUukeAD6YRGhEiJ1rl1FGksX7Y3HftOX8MDibFOknhenoFj0gZJt1h rAOslyQqAnClPtQWgVIW1+Fhpg== X-Google-Smtp-Source: ALg8bN6cjEL3iSgiNwf2jkNVMO72MPekaYZ7NaVLB5PoxjD0Y69axgBklztf7+uPi2mw4zJkoTKoNg== X-Received: by 2002:a63:235f:: with SMTP id u31mr14537329pgm.122.1547753046503; Thu, 17 Jan 2019 11:24:06 -0800 (PST) Received: from localhost ([2620:15c:2c4:201:f5a:7eca:440a:3ead]) by smtp.gmail.com with ESMTPSA id y71sm4279684pfi.123.2019.01.17.11.24.05 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 17 Jan 2019 11:24:05 -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 10/11] tcp: move tp->rack init to tcp_disconnect() Date: Thu, 17 Jan 2019 11:23:41 -0800 Message-Id: <20190117192342.71126-11-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 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org If we make sure all listeners have proper tp->rack value, then a clone will also inherit proper initial value. Note that fresh sockets init tp->rack from tcp_init_sock() Signed-off-by: Eric Dumazet --- net/ipv4/tcp.c | 6 ++++++ net/ipv4/tcp_minisocks.c | 6 ------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 5f15fcc9612ae6b6964ca15660dbb7eb8cd71d83..2348199e6cee9b644177b1d5158680359fa2b57d 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -2611,6 +2611,12 @@ int tcp_disconnect(struct sock *sk, int flags) tp->last_oow_ack_time = 0; /* There's a bubble in the pipe until at least the first ACK. */ tp->app_limited = ~0U; + tp->rack.mstamp = 0; + tp->rack.advanced = 0; + tp->rack.reo_wnd_steps = 1; + tp->rack.last_delivered = 0; + tp->rack.reo_wnd_persist = 0; + tp->rack.dsack_seen = 0; /* Clean up fastopen related fields */ diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c index 13f3c6444efa63b63fe38bf4606c91fa962ec584..27e11eb4164ca18da0e939eb928b5b2442f300dd 100644 --- a/net/ipv4/tcp_minisocks.c +++ b/net/ipv4/tcp_minisocks.c @@ -535,12 +535,6 @@ struct sock *tcp_create_openreq_child(const struct sock *sk, newtp->fastopen_req = NULL; newtp->fastopen_rsk = NULL; newtp->syn_data_acked = 0; - newtp->rack.mstamp = 0; - newtp->rack.advanced = 0; - newtp->rack.reo_wnd_steps = 1; - newtp->rack.last_delivered = 0; - newtp->rack.reo_wnd_persist = 0; - newtp->rack.dsack_seen = 0; __TCP_INC_STATS(sock_net(sk), TCP_MIB_PASSIVEOPENS); From patchwork Thu Jan 17 19:23:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 1026927 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b="laOHtKpa"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 43gYsn2GQzz9sBZ for ; Fri, 18 Jan 2019 06:24:13 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728658AbfAQTYM (ORCPT ); Thu, 17 Jan 2019 14:24:12 -0500 Received: from mail-pf1-f196.google.com ([209.85.210.196]:39837 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728577AbfAQTYJ (ORCPT ); Thu, 17 Jan 2019 14:24:09 -0500 Received: by mail-pf1-f196.google.com with SMTP id r136so5296215pfc.6 for ; Thu, 17 Jan 2019 11:24:09 -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=shbTGhYrC6pwkyY+/RnYUM9NoFUPxv8v7ssRuLZIEv0=; b=laOHtKpa1e11ecEpAGKGb0zJPIqWfoXVc2ZS/ziPYnoueW3E50sEze+3NbVCvSNuDG yV9uQnBF27U8twDLFWQJg4oQWcEyPPE3njJAmNqEdq6t5TmTGaEQ1LSTofwirgDIyFlJ XIbY7uCiBn2egvyYb7l5vufjHnPD8DZYOo3N+DCiAe2dUHRG7M+GIVYTFFWe4/40yGhg leAuIuiLl+ncqmap34BKE1gf5TqFD6KhYMnxZCp7YaVLpuCsE91+Spt+zIwKqsvJfyqG mNs9FFx9yCZXfmVzVoDvYUJCJIEt4BKi/+TTt25rMHbhL/xIxltKqqFMkkyPGemXC9nU lpbw== 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=shbTGhYrC6pwkyY+/RnYUM9NoFUPxv8v7ssRuLZIEv0=; b=oVfFGOMrokG8Mju1g85+UZfinCxwEZIxwYhDD3PPsSz5O8VZsIwWmGVU2/Gpjfb6z3 boGAg3j/9kOqF9YqfIhAqdTT90KvTMp8gqA2OUZVRzxlE3a7Uv07F9Lec/9NyjVQU87p g5B/gZ189APOSUTf+FNMtpX6y8GJSRKci/AjpuX23gSQbn0RcPT8oEbGq8sqIwAkltja Z70craX/gsXpTh8sVJBPRpqsncY0bh+kONfa4PqLol6JL+s4EX+WivCJPDecT1wrcOU6 WopN/iP25EfF7XFe7C2XOh1iUSN6koUtntAq3eqmpaAIxFew7sx2EMrljOkwOJR+jsiV utFA== X-Gm-Message-State: AJcUukfrVv6c9z/g+/6oUeqnbSPCn1OjmYnxj/m0ROijnVs7aJkhNhnU pn0NOKhd1zlMGgXliTKRO4PNlQ== X-Google-Smtp-Source: ALg8bN4LEcX9azb3X9yyzK5MtFQXm8Eees5WfcNB1S1BoYxFIxTX4IFKTjGbwghps/y29Ywmc7OsZw== X-Received: by 2002:a63:df50:: with SMTP id h16mr14724948pgj.421.1547753048757; Thu, 17 Jan 2019 11:24:08 -0800 (PST) Received: from localhost ([2620:15c:2c4:201:f5a:7eca:440a:3ead]) by smtp.gmail.com with ESMTPSA id r1sm3464430pgo.17.2019.01.17.11.24.07 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 17 Jan 2019 11:24:07 -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 11/11] tcp: move rx_opt & syn_data_acked init to tcp_disconnect() Date: Thu, 17 Jan 2019 11:23:42 -0800 Message-Id: <20190117192342.71126-12-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 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org If we make sure all listeners have these fields cleared, then a clone will also inherit zero values. Signed-off-by: Eric Dumazet --- net/ipv4/tcp.c | 4 ++++ net/ipv4/tcp_minisocks.c | 6 ------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 2348199e6cee9b644177b1d5158680359fa2b57d..541bdb9f81d791ca84c7f03d9caf15d84066c32e 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -2617,6 +2617,10 @@ int tcp_disconnect(struct sock *sk, int flags) tp->rack.last_delivered = 0; tp->rack.reo_wnd_persist = 0; tp->rack.dsack_seen = 0; + tp->syn_data_acked = 0; + tp->rx_opt.saw_tstamp = 0; + tp->rx_opt.dsack = 0; + tp->rx_opt.num_sacks = 0; /* Clean up fastopen related fields */ diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c index 27e11eb4164ca18da0e939eb928b5b2442f300dd..182595e2d40ff5b48cd6d095d4bd97b4cb26d3c0 100644 --- a/net/ipv4/tcp_minisocks.c +++ b/net/ipv4/tcp_minisocks.c @@ -489,11 +489,6 @@ struct sock *tcp_create_openreq_child(const struct sock *sk, tcp_init_xmit_timers(newsk); newtp->write_seq = newtp->pushed_seq = treq->snt_isn + 1; - newtp->rx_opt.saw_tstamp = 0; - - newtp->rx_opt.dsack = 0; - newtp->rx_opt.num_sacks = 0; - if (sock_flag(newsk, SOCK_KEEPOPEN)) inet_csk_reset_keepalive_timer(newsk, keepalive_time_when(newtp)); @@ -534,7 +529,6 @@ struct sock *tcp_create_openreq_child(const struct sock *sk, tcp_ecn_openreq_child(newtp, req); newtp->fastopen_req = NULL; newtp->fastopen_rsk = NULL; - newtp->syn_data_acked = 0; __TCP_INC_STATS(sock_net(sk), TCP_MIB_PASSIVEOPENS);