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 <[email protected]>
Cc: Eric Dumazet <[email protected]>
Cc: Carlo Augusto Grazia <[email protected]>
Tested-by: Carlo Augusto Grazia <[email protected]>
---
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