Commit dcad9ee
net: sched: fix tx action reschedule issue with stopped queue
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 if STATE_MISSED is set, which consumes unnecessary
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 rescheduled
again when netdev qeueue is restarted, see netif_tx_wake_queue().
As there is time window between netif_xmit_frozen_or_stopped()
checking and STATE_MISSED clearing, between which STATE_MISSED
may set by net_tx_action() scheduled by netif_tx_wake_queue(),
so set the STATE_MISSED again if netdev queue is restarted.
Fixes: 6b3ba91 ("net: sched: allow qdiscs to handle locking")
Reported-by: Michal Kubecek <mkubecek@suse.cz>
Acked-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>1 parent 102b55e commit dcad9ee
2 files changed
+28
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3853 | 3853 | | |
3854 | 3854 | | |
3855 | 3855 | | |
3856 | | - | |
| 3856 | + | |
| 3857 | + | |
3857 | 3858 | | |
3858 | 3859 | | |
3859 | 3860 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
38 | 57 | | |
39 | 58 | | |
40 | 59 | | |
| |||
74 | 93 | | |
75 | 94 | | |
76 | 95 | | |
| 96 | + | |
77 | 97 | | |
78 | 98 | | |
79 | 99 | | |
| |||
242 | 262 | | |
243 | 263 | | |
244 | 264 | | |
| 265 | + | |
245 | 266 | | |
246 | 267 | | |
247 | 268 | | |
| |||
251 | 272 | | |
252 | 273 | | |
253 | 274 | | |
254 | | - | |
| 275 | + | |
| 276 | + | |
255 | 277 | | |
| 278 | + | |
256 | 279 | | |
257 | 280 | | |
258 | 281 | | |
| |||
311 | 334 | | |
312 | 335 | | |
313 | 336 | | |
| 337 | + | |
| 338 | + | |
314 | 339 | | |
315 | 340 | | |
316 | 341 | | |
| |||
0 commit comments