Skip to content

Commit

Permalink
net: Always poll at least one device in net_rx_action
Browse files Browse the repository at this point in the history
We should only perform the softnet_break check after we have polled
at least one device in net_rx_action.  Otherwise a zero or negative
setting of netdev_budget can lock up the whole system.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Herbert Xu authored and David S. Miller committed Dec 24, 2014
1 parent 001ce54 commit 6bd373e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions net/core/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -4634,16 +4634,15 @@ static void net_rx_action(struct softirq_action *h)
while (!list_empty(&list)) {
struct napi_struct *n;

n = list_first_entry(&list, struct napi_struct, poll_list);
budget -= napi_poll(n, &repoll);

/* If softirq window is exhausted then punt.
* Allow this to run for 2 jiffies since which will allow
* an average latency of 1.5/HZ.
*/
if (unlikely(budget <= 0 || time_after_eq(jiffies, time_limit)))
goto softnet_break;


n = list_first_entry(&list, struct napi_struct, poll_list);
budget -= napi_poll(n, &repoll);
}

if (!sd_has_rps_ipi_waiting(sd) &&
Expand Down

0 comments on commit 6bd373e

Please sign in to comment.