Skip to content

Commit c73e580

Browse files
edumazetdavem330
authored andcommitted
tcp: tsq: no longer use limit_output_bytes for paced flows
FQ pacing guarantees that paced packets queued by one flow do not add head-of-line blocking for other flows. After TCP GSO conversion, increasing limit_output_bytes to 1 MB is safe, since this maps to 16 skbs at most in qdisc or device queues. (or slightly more if some drivers lower {gso_max_segs|size}) We still can queue at most 1 ms worth of traffic (this can be scaled by wifi drivers if they need to) Tested: # ethtool -c eth0 | egrep "tx-usecs:|tx-frames:" # 40 Gbit mlx4 NIC tx-usecs: 16 tx-frames: 16 # tc qdisc replace dev eth0 root fq # for f in {1..10};do netperf -P0 -H lpaa24,6 -o THROUGHPUT;done Before patch: 27711 26118 27107 27377 27712 27388 27340 27117 27278 27509 After patch: 37434 36949 36658 36998 37711 37291 37605 36659 36544 37349 Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 83afb36 commit c73e580

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

Documentation/networking/ip-sysctl.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,7 @@ tcp_limit_output_bytes - INTEGER
759759
flows, for typical pfifo_fast qdiscs. tcp_limit_output_bytes
760760
limits the number of bytes on qdisc or device to reduce artificial
761761
RTT/cwnd and reduce bufferbloat.
762-
Default: 262144
762+
Default: 1048576 (16 * 65536)
763763

764764
tcp_challenge_ack_limit - INTEGER
765765
Limits number of Challenge ACK sent per second, as recommended

net/ipv4/tcp_ipv4.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2574,8 +2574,8 @@ static int __net_init tcp_sk_init(struct net *net)
25742574
* which are too large can cause TCP streams to be bursty.
25752575
*/
25762576
net->ipv4.sysctl_tcp_tso_win_divisor = 3;
2577-
/* Default TSQ limit of four TSO segments */
2578-
net->ipv4.sysctl_tcp_limit_output_bytes = 262144;
2577+
/* Default TSQ limit of 16 TSO segments */
2578+
net->ipv4.sysctl_tcp_limit_output_bytes = 16 * 65536;
25792579
/* rfc5961 challenge ack rate limiting */
25802580
net->ipv4.sysctl_tcp_challenge_ack_limit = 1000;
25812581
net->ipv4.sysctl_tcp_min_tso_segs = 2;

net/ipv4/tcp_output.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2220,8 +2220,9 @@ static bool tcp_small_queue_check(struct sock *sk, const struct sk_buff *skb,
22202220
limit = max_t(unsigned long,
22212221
2 * skb->truesize,
22222222
sk->sk_pacing_rate >> sk->sk_pacing_shift);
2223-
limit = min_t(unsigned long, limit,
2224-
sock_net(sk)->ipv4.sysctl_tcp_limit_output_bytes);
2223+
if (sk->sk_pacing_status == SK_PACING_NONE)
2224+
limit = min_t(unsigned long, limit,
2225+
sock_net(sk)->ipv4.sysctl_tcp_limit_output_bytes);
22252226
limit <<= factor;
22262227

22272228
if (refcount_read(&sk->sk_wmem_alloc) > limit) {

0 commit comments

Comments
 (0)