From mboxrd@z Thu Jan 1 00:00:00 1970 From: Natale Patriciello Subject: [RFC PATCH 2/3] tcp: Negative values of sysctl_tcp_limit_output_bytes disable TSQ Date: Fri, 5 Jan 2018 12:32:55 +0100 Message-ID: <20180105113256.14835-3-natale.patriciello@gmail.com> References: <20180105113256.14835-1-natale.patriciello@gmail.com> Cc: Natale Patriciello , Eric Dumazet , Carlo Augusto Grazia To: netdev@vger.kernel.org Return-path: Received: from mail-wm0-f67.google.com ([74.125.82.67]:44647 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751067AbeAELed (ORCPT ); Fri, 5 Jan 2018 06:34:33 -0500 Received: by mail-wm0-f67.google.com with SMTP id t8so1885516wmc.3 for ; Fri, 05 Jan 2018 03:34:32 -0800 (PST) In-Reply-To: <20180105113256.14835-1-natale.patriciello@gmail.com> Sender: netdev-owner@vger.kernel.org List-ID: This commit adds the possibility for a user to disable the TSQ by using an existing sysctl knob. This feature existed until it was removed by the commit c9eeec26e32e ("tcp: TSQ can use a dynamic limit"). Fixes: c9eeec26e32e ("tcp: TSQ can use a dynamic limit") Signed-off-by: Natale Patriciello Cc: Eric Dumazet Cc: Carlo Augusto Grazia Tested-by: Carlo Augusto Grazia --- Documentation/networking/ip-sysctl.txt | 1 + net/ipv4/tcp_output.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt index 46c7e1085efc..3b530fe8a494 100644 --- a/Documentation/networking/ip-sysctl.txt +++ b/Documentation/networking/ip-sysctl.txt @@ -721,6 +721,7 @@ tcp_limit_output_bytes - INTEGER typical pfifo_fast qdiscs. tcp_limit_output_bytes limits the number of bytes on qdisc or device to reduce artificial RTT/cwnd and reduce bufferbloat. + Set to -1 to disable. Default: 262144 tcp_challenge_ack_limit - INTEGER diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index ef1ae727320f..997a6fbdbe1a 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c @@ -2198,6 +2198,9 @@ static bool tcp_small_queue_check(struct sock *sk, const struct sk_buff *skb, { unsigned int limit; + if (sock_net(sk)->ipv4.sysctl_tcp_limit_output_bytes < 0) + return false; + limit = max(2 * skb->truesize, sk->sk_pacing_rate >> 10); limit = min_t(u32, limit, sock_net(sk)->ipv4.sysctl_tcp_limit_output_bytes); -- 2.15.1