Skip to content

Commit bc21000

Browse files
edumazetkuba-moo
authored andcommitted
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: 29f834a ("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>
1 parent 4786fe2 commit bc21000

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

net/sched/sch_fq.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,9 @@ static struct sk_buff *fq_dequeue(struct Qdisc *sch)
663663
pband = &q->band_flows[q->band_nr];
664664
pband->credit = min(pband->credit + pband->quantum,
665665
pband->quantum);
666-
goto begin;
666+
if (pband->credit > 0)
667+
goto begin;
668+
retry = 0;
667669
}
668670
if (q->time_next_delayed_flow != ~0ULL)
669671
qdisc_watchdog_schedule_range_ns(&q->watchdog,

0 commit comments

Comments
 (0)