diff options
author | David S. Miller <davem@davemloft.net> | 2008-01-07 21:00:40 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-08 23:30:13 -0800 |
commit | fed17f3094b960d3a54b10f17abbe4b57e976eec (patch) | |
tree | c4ee0aa07a23fef95768056655cd30a437dd59e0 /net/core/dev.c | |
parent | d1d08d1265810ef1f165864850416dcbc9725ee7 (diff) | |
download | linux-fed17f3094b960d3a54b10f17abbe4b57e976eec.tar.bz2 |
[NET]: Stop polling when napi_disable() is pending.
This finally adds the code in net_rx_action() to break out of the
->poll()'ing loop when a napi_disable() is found to be pending.
Now, even if a device is being flooded with packets it can be cleanly
brought down.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/dev.c')
-rw-r--r-- | net/core/dev.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index be9d3015beaa..0879f52115eb 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -2207,8 +2207,12 @@ static void net_rx_action(struct softirq_action *h) * still "owns" the NAPI instance and therefore can * move the instance around on the list at-will. */ - if (unlikely(work == weight)) - list_move_tail(&n->poll_list, list); + if (unlikely(work == weight)) { + if (unlikely(napi_disable_pending(n))) + __napi_complete(n); + else + list_move_tail(&n->poll_list, list); + } netpoll_poll_unlock(have); } |