{"id":831083,"url":"http://patchwork.ozlabs.org/api/1.2/patches/831083/?format=json","web_url":"http://patchwork.ozlabs.org/project/netdev/patch/20171027045510.5827-14-edumazet@google.com/","project":{"id":7,"url":"http://patchwork.ozlabs.org/api/1.2/projects/7/?format=json","name":"Linux network development","link_name":"netdev","list_id":"netdev.vger.kernel.org","list_email":"netdev@vger.kernel.org","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20171027045510.5827-14-edumazet@google.com>","list_archive_url":null,"date":"2017-10-27T04:55:08","name":"[v2,net-next,13/15] tcp: Namespace-ify sysctl_tcp_app_win","commit_ref":null,"pull_url":null,"state":"accepted","archived":true,"hash":"24e2ab17bc1d7f47bee8c19dbdd3264672d95107","submitter":{"id":13357,"url":"http://patchwork.ozlabs.org/api/1.2/people/13357/?format=json","name":"Eric Dumazet","email":"edumazet@google.com"},"delegate":{"id":34,"url":"http://patchwork.ozlabs.org/api/1.2/users/34/?format=json","username":"davem","first_name":"David","last_name":"Miller","email":"davem@davemloft.net"},"mbox":"http://patchwork.ozlabs.org/project/netdev/patch/20171027045510.5827-14-edumazet@google.com/mbox/","series":[{"id":10492,"url":"http://patchwork.ozlabs.org/api/1.2/series/10492/?format=json","web_url":"http://patchwork.ozlabs.org/project/netdev/list/?series=10492","date":"2017-10-27T04:54:55","name":"tcp: move 14 sysctls to namespaces","version":2,"mbox":"http://patchwork.ozlabs.org/series/10492/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/831083/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/831083/checks/","tags":{},"related":[],"headers":{"Return-Path":"<netdev-owner@vger.kernel.org>","X-Original-To":"patchwork-incoming@ozlabs.org","Delivered-To":"patchwork-incoming@ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=google.com header.i=@google.com\n\theader.b=\"ZVqy2A96\"; dkim-atps=neutral"],"Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3yNWmX6rdVz9t30\n\tfor <patchwork-incoming@ozlabs.org>;\n\tFri, 27 Oct 2017 15:56:12 +1100 (AEDT)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751932AbdJ0E4L (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tFri, 27 Oct 2017 00:56:11 -0400","from mail-io0-f193.google.com ([209.85.223.193]:44562 \"EHLO\n\tmail-io0-f193.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1751950AbdJ0Ezn (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Fri, 27 Oct 2017 00:55:43 -0400","by mail-io0-f193.google.com with SMTP id m16so10138873iod.1\n\tfor <netdev@vger.kernel.org>; Thu, 26 Oct 2017 21:55:42 -0700 (PDT)","from localhost ([2620:15c:2c4:201:c5be:583d:61a8:d070])\n\tby smtp.gmail.com with ESMTPSA id\n\tm141sm478871itm.12.2017.10.26.21.55.41\n\t(version=TLS1_2 cipher=AES128-SHA bits=128/128);\n\tThu, 26 Oct 2017 21:55:41 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=google.com; s=20161025;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=U5HryTKHcIxgeLLZN1mOl3ROS/+0IkEjaMY2mTeT3CM=;\n\tb=ZVqy2A96txWY5wHHR43a6Mr18sFcHYsMKR7cub+3MG88NOTebZWuvzDxGKT3JI1+5c\n\tgdYcDSkyRUHD2WXgZLEZueoYKuItFFDujwK3eWJSHC6h32YqrxmiE4GG1XELYlUmRiKp\n\tGokKIf8ESqFLplCirnkENHXMpAh5yoeXLwQmgbfsx2Uoo2RrW3Yh/1cJ/m485pHbMW6D\n\tNtYylW0djNVNutia2EcEB17DzQ2lun0qUk1KsFO5xpmVLPprU7oKbKZhUWeNPkj261gP\n\tsTH+T9C2uAqB74RbRpHo8cmGO4APMjTgjw1BympAfKIj/nTzS34nN4JyM0gs2zkfWYFi\n\tnE2A==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=U5HryTKHcIxgeLLZN1mOl3ROS/+0IkEjaMY2mTeT3CM=;\n\tb=DVWc/uZr1XTJ2lgk4kEHkeL7oIe5pLrivKtaDsvgP/AAH2XUhwF+HMLYTGDS94KJ5F\n\tFvBYDUvkGbyrUYYw4iWHEqojCJ0PkYMP/lmkLUyzOHdaShX5Q7yJXw3tE8MdsRqn6kZx\n\tMuImOzzPzsxgP2/mbYeEkOGpF5hpojdrmb6Pxc52oVbYS2nI/0pThrKGnAAPGM67nAFB\n\t/ZvHu8r0Jt9ROa0vR0MmmhQ1QqcUI+n4po53SgjtByZGrfx3lpNQhK/67Xwjw+IrtOC1\n\tzh4GXeB5aZGZqd1gI6/WDID9kaWDalmEXq/vuM7oWjJxw5LkYHFjolAOxtHfeb1xomVL\n\tyXow==","X-Gm-Message-State":"AMCzsaW2CYKCNeiT5hFLZEHW5m1gLOu/p5cQIxeANEk+qthFLEiuaDfh\n\taPU43WUjREChYusmGpjgz/gCAw==","X-Google-Smtp-Source":"ABhQp+TK4lGvSpqe/Tt4x7U+jTkUFF4ebKjYJ50NQ4klHYg5LlUZlv1Xrzs0GWTy2DnIglURzCGuqg==","X-Received":"by 10.107.163.15 with SMTP id m15mr32907248ioe.61.1509080142096; \n\tThu, 26 Oct 2017 21:55:42 -0700 (PDT)","From":"Eric Dumazet <edumazet@google.com>","To":"\"David S . Miller\" <davem@davemloft.net>","Cc":"netdev <netdev@vger.kernel.org>, Eric Dumazet <edumazet@google.com>,\n\tEric Dumazet <eric.dumazet@gmail.com>","Subject":"[PATCH v2 net-next 13/15] tcp: Namespace-ify sysctl_tcp_app_win","Date":"Thu, 26 Oct 2017 21:55:08 -0700","Message-Id":"<20171027045510.5827-14-edumazet@google.com>","X-Mailer":"git-send-email 2.15.0.rc2.357.g7e34df9404-goog","In-Reply-To":"<20171027045510.5827-1-edumazet@google.com>","References":"<20171027045510.5827-1-edumazet@google.com>","Sender":"netdev-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netdev.vger.kernel.org>","X-Mailing-List":"netdev@vger.kernel.org"},"content":"Signed-off-by: Eric Dumazet <edumazet@google.com>\n---\n include/net/netns/ipv4.h   |  1 +\n include/net/tcp.h          |  1 -\n net/ipv4/sysctl_net_ipv4.c | 14 +++++++-------\n net/ipv4/tcp_input.c       |  8 ++++----\n net/ipv4/tcp_ipv4.c        |  1 +\n 5 files changed, 13 insertions(+), 12 deletions(-)","diff":"diff --git a/include/net/netns/ipv4.h b/include/net/netns/ipv4.h\nindex 956957a77db96ad3d231cc018c13503d615d8d2e..63f91d52cbc0ad35d8e04a8da0d9f57aa960bcb0 100644\n--- a/include/net/netns/ipv4.h\n+++ b/include/net/netns/ipv4.h\n@@ -139,6 +139,7 @@ struct netns_ipv4 {\n \tint sysctl_tcp_fack;\n \tint sysctl_tcp_max_reordering;\n \tint sysctl_tcp_dsack;\n+\tint sysctl_tcp_app_win;\n \tstruct inet_timewait_death_row tcp_death_row;\n \tint sysctl_max_syn_backlog;\n \tint sysctl_tcp_fastopen;\ndiff --git a/include/net/tcp.h b/include/net/tcp.h\nindex 8b2ae3e8d79f223d4637226fc7278fe751d0b5d7..7aa3d65062a14a98358f8868fa2c0dbb2c74a0ce 100644\n--- a/include/net/tcp.h\n+++ b/include/net/tcp.h\n@@ -247,7 +247,6 @@ extern int sysctl_tcp_max_orphans;\n extern long sysctl_tcp_mem[3];\n extern int sysctl_tcp_wmem[3];\n extern int sysctl_tcp_rmem[3];\n-extern int sysctl_tcp_app_win;\n extern int sysctl_tcp_adv_win_scale;\n extern int sysctl_tcp_frto;\n extern int sysctl_tcp_nometrics_save;\ndiff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c\nindex 7652a9c2a65d3f1cfa0a75d1198e1d9d56761c35..e057788834a99cf99e141a602ddbe19b8e6fce3c 100644\n--- a/net/ipv4/sysctl_net_ipv4.c\n+++ b/net/ipv4/sysctl_net_ipv4.c\n@@ -437,13 +437,6 @@ static struct ctl_table ipv4_table[] = {\n \t\t.proc_handler\t= proc_dointvec_minmax,\n \t\t.extra1\t\t= &one,\n \t},\n-\t{\n-\t\t.procname\t= \"tcp_app_win\",\n-\t\t.data\t\t= &sysctl_tcp_app_win,\n-\t\t.maxlen\t\t= sizeof(int),\n-\t\t.mode\t\t= 0644,\n-\t\t.proc_handler\t= proc_dointvec\n-\t},\n \t{\n \t\t.procname\t= \"tcp_adv_win_scale\",\n \t\t.data\t\t= &sysctl_tcp_adv_win_scale,\n@@ -1145,6 +1138,13 @@ static struct ctl_table ipv4_net_table[] = {\n \t\t.mode\t\t= 0644,\n \t\t.proc_handler\t= proc_dointvec\n \t},\n+\t{\n+\t\t.procname\t= \"tcp_app_win\",\n+\t\t.data\t\t= &init_net.ipv4.sysctl_tcp_app_win,\n+\t\t.maxlen\t\t= sizeof(int),\n+\t\t.mode\t\t= 0644,\n+\t\t.proc_handler\t= proc_dointvec\n+\t},\n \t{ }\n };\n \ndiff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c\nindex fd77037ac800a1153ec0ef904fcf00b93c061fa1..6af4b58ac6d5de54bdbb418f41a0b18eee38ca50 100644\n--- a/net/ipv4/tcp_input.c\n+++ b/net/ipv4/tcp_input.c\n@@ -79,7 +79,6 @@\n #include <linux/unaligned/access_ok.h>\n #include <linux/static_key.h>\n \n-int sysctl_tcp_app_win __read_mostly = 31;\n int sysctl_tcp_adv_win_scale __read_mostly = 1;\n EXPORT_SYMBOL(sysctl_tcp_adv_win_scale);\n \n@@ -428,6 +427,7 @@ static void tcp_fixup_rcvbuf(struct sock *sk)\n  */\n void tcp_init_buffer_space(struct sock *sk)\n {\n+\tint tcp_app_win = sock_net(sk)->ipv4.sysctl_tcp_app_win;\n \tstruct tcp_sock *tp = tcp_sk(sk);\n \tint maxwin;\n \n@@ -446,14 +446,14 @@ void tcp_init_buffer_space(struct sock *sk)\n \tif (tp->window_clamp >= maxwin) {\n \t\ttp->window_clamp = maxwin;\n \n-\t\tif (sysctl_tcp_app_win && maxwin > 4 * tp->advmss)\n+\t\tif (tcp_app_win && maxwin > 4 * tp->advmss)\n \t\t\ttp->window_clamp = max(maxwin -\n-\t\t\t\t\t       (maxwin >> sysctl_tcp_app_win),\n+\t\t\t\t\t       (maxwin >> tcp_app_win),\n \t\t\t\t\t       4 * tp->advmss);\n \t}\n \n \t/* Force reservation of one segment. */\n-\tif (sysctl_tcp_app_win &&\n+\tif (tcp_app_win &&\n \t    tp->window_clamp > 2 * tp->advmss &&\n \t    tp->window_clamp + tp->advmss > maxwin)\n \t\ttp->window_clamp = max(2 * tp->advmss, maxwin - tp->advmss);\ndiff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c\nindex d9d4d191e8f3c962a6ee68015ffe5a6e7fb8e9c1..189664ebd28e4cda7ef40a47591c3bd8cac3574b 100644\n--- a/net/ipv4/tcp_ipv4.c\n+++ b/net/ipv4/tcp_ipv4.c\n@@ -2490,6 +2490,7 @@ static int __net_init tcp_sk_init(struct net *net)\n \tnet->ipv4.sysctl_tcp_retrans_collapse = 1;\n \tnet->ipv4.sysctl_tcp_max_reordering = 300;\n \tnet->ipv4.sysctl_tcp_dsack = 1;\n+\tnet->ipv4.sysctl_tcp_app_win = 31;\n \n \tnet->ipv4.sysctl_tcp_fastopen = TFO_CLIENT_ENABLE;\n \tspin_lock_init(&net->ipv4.tcp_fastopen_ctx_lock);\n","prefixes":["v2","net-next","13/15"]}