Re: [PATCH net v7 3/3] net: sched: fix tx action reschedule issue with stopped queue

From
Jakub Kicinski <kuba@kernel.org>
Date
2021-05-13 15:22:40
Also in
bpf, linux-can, lkml
Reply to
Yunsheng Lin, 2021-05-13
On Thu, 13 May 2021 09:11:00 +0800 Yunsheng Lin wrote:
The netdev qeueue might be stopped when byte queue limit has
reached or tx hw ring is full, net_tx_action() may still be
rescheduled endlessly if STATE_MISSED is set, which consumes
a lot of cpu without dequeuing and transmiting any skb because
the netdev queue is stopped, see qdisc_run_end().

This patch fixes it by checking the netdev queue state before
calling qdisc_run() and clearing STATE_MISSED if netdev queue is
stopped during qdisc_run(), the net_tx_action() is recheduled
again when netdev qeueue is restarted, see netif_tx_wake_queue().

As there is time window betewwn netif_xmit_frozen_or_stopped()
checking and STATE_MISSED clearing, between which STATE_MISSED
is set by net_tx_action() scheduled by netif_tx_wake_queue(),
so set the STATE_MISSED again if netdev queue is restarted.

Fixes: 6b3ba9146fe6 ("net: sched: allow qdiscs to handle locking")
Reported-by: Michal Kubecek <redacted>
Signed-off-by: Yunsheng Lin <redacted>
quoted hunk ↗ jump to hunk
@@ -35,6 +35,25 @@
 const struct Qdisc_ops *default_qdisc_ops = &pfifo_fast_ops;
 EXPORT_SYMBOL(default_qdisc_ops);
 
+static void qdisc_maybe_stop_tx(struct Qdisc *q,
nit: qdisc_maybe_clear_missed()?
Thread (6 messages) 6 messages, 2 authors, last reply 2021-05-13
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help