net_sched: sch_fq: fix incorrect behavior for small weights
authorEric Dumazet <edumazet@google.com>
Sat, 24 Aug 2024 18:19:01 +0000 (18:19 +0000)
committerJakub Kicinski <kuba@kernel.org>
Tue, 27 Aug 2024 15:20:45 +0000 (08:20 -0700)
commitbc21000e99f92a6b5540d7267c6b22806c5c33d3
tree6b9d75cc4df99c20abae1cc4abaa4f652cbc757b
parent4786fe29f5a0dd74d9ccdce8c734bde1fb88cf37
net_sched: sch_fq: fix incorrect behavior for small weights

fq_dequeue() has a complex logic to find packets in one of the 3 bands.

As Neal found out, it is possible that one band has a deficit smaller
than its weight. fq_dequeue() can return NULL while some packets are
elligible for immediate transmit.

In this case, more than one iteration is needed to refill pband->credit.

With default parameters (weights 589824 196608 65536) bug can trigger
if large BIG TCP packets are sent to the lowest priority band.

Bisected-by: John Sperbeck <jsperbeck@google.com>
Diagnosed-by: Neal Cardwell <ncardwell@google.com>
Fixes: 29f834aa326e ("net_sched: sch_fq: add 3 bands and WRR scheduling")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Neal Cardwell <ncardwell@google.com>
Link: https://patch.msgid.link/20240824181901.953776-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/sched/sch_fq.c