Commit a0a4619
committed
[NET]: Add NAPI_STATE_DISABLE.
Create a bit to signal that a napi_disable() is in progress.
This sets up infrastructure such that net_rx_action() can generically
break out of the ->poll() loop on a NAPI context that has a pending
napi_disable() yet is being bombed with packets (and thus would
otherwise poll endlessly and not allow the napi_disable() to finish).
Now, what napi_disable() does is first set the NAPI_STATE_DISABLE bit
(to indicate that a disable is pending), then it polls for the
NAPI_STATE_SCHED bit, and once the NAPI_STATE_SCHED bit is acquired
the NAPI_STATE_DISABLE bit is cleared. Here, the test_and_set_bit()
provides the necessary memory barrier between the various bitops.
napi_schedule_prep() now tests for a pending disable as it's first
action and won't try to obtain the NAPI_STATE_SCHED bit if a disable
is pending.
As a result, we can remove the netif_running() check in
netif_rx_schedule_prep() because the NAPI disable pending state serves
this purpose. And, it does so in a NAPI centric manner which is what
we really want.
Signed-off-by: David S. Miller <davem@davemloft.net>1 parent bdb95b1 commit a0a4619
1 file changed
+13
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
319 | 319 | | |
320 | 320 | | |
321 | 321 | | |
| 322 | + | |
322 | 323 | | |
323 | 324 | | |
324 | 325 | | |
325 | 326 | | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
326 | 332 | | |
327 | 333 | | |
328 | 334 | | |
329 | 335 | | |
330 | 336 | | |
331 | 337 | | |
332 | | - | |
| 338 | + | |
| 339 | + | |
333 | 340 | | |
334 | 341 | | |
335 | 342 | | |
336 | | - | |
| 343 | + | |
| 344 | + | |
337 | 345 | | |
338 | 346 | | |
339 | 347 | | |
| |||
389 | 397 | | |
390 | 398 | | |
391 | 399 | | |
| 400 | + | |
392 | 401 | | |
393 | 402 | | |
| 403 | + | |
394 | 404 | | |
395 | 405 | | |
396 | 406 | | |
| |||
1268 | 1278 | | |
1269 | 1279 | | |
1270 | 1280 | | |
1271 | | - | |
| 1281 | + | |
1272 | 1282 | | |
1273 | 1283 | | |
1274 | 1284 | | |
| |||
0 commit comments