aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-01-08 00:00:40 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-09 02:30:13 -0500
commitfed17f3094b960d3a54b10f17abbe4b57e976eec (patch)
treec4ee0aa07a23fef95768056655cd30a437dd59e0 /net
parentd1d08d1265810ef1f165864850416dcbc9725ee7 (diff)
[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')
-rw-r--r--net/core/dev.c8
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)
2207 * still "owns" the NAPI instance and therefore can 2207 * still "owns" the NAPI instance and therefore can
2208 * move the instance around on the list at-will. 2208 * move the instance around on the list at-will.
2209 */ 2209 */
2210 if (unlikely(work == weight)) 2210 if (unlikely(work == weight)) {
2211 list_move_tail(&n->poll_list, list); 2211 if (unlikely(napi_disable_pending(n)))
2212 __napi_complete(n);
2213 else
2214 list_move_tail(&n->poll_list, list);
2215 }
2212 2216
2213 netpoll_poll_unlock(have); 2217 netpoll_poll_unlock(have);
2214 } 2218 }