Skip to content

Commit

Permalink
[NET]: Stop polling when napi_disable() is pending.
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
davem330 committed Jan 9, 2008
1 parent d1d08d1 commit fed17f3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions net/core/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit fed17f3

Please sign in to comment.