aboutsummaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2014-12-20 15:16:22 -0500
committerDavid S. Miller <davem@davemloft.net>2014-12-23 23:20:21 -0500
commit001ce546bb537bb5b7821f05633556a0c9787e32 (patch)
tree3e3fde752c8c4bd05e6c3cb57318069e6e54bbd7 /net/core
parent726ce70e9e4050409243f3a1d735dc86bc6e6e57 (diff)
net: Detect drivers that reschedule NAPI and exhaust budget
The commit d75b1ade567ffab085e8adbbdacf0092d10cd09c (net: less interrupt masking in NAPI) required drivers to leave poll_list empty if the entire budget is consumed. We have already had two broken drivers so let's add a check for this. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/dev.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index 493ae8ee569f..c0cf1293df06 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -4602,6 +4602,15 @@ static int napi_poll(struct napi_struct *n, struct list_head *repoll)
4602 napi_gro_flush(n, HZ >= 1000); 4602 napi_gro_flush(n, HZ >= 1000);
4603 } 4603 }
4604 4604
4605 /* Some drivers may have called napi_schedule
4606 * prior to exhausting their budget.
4607 */
4608 if (unlikely(!list_empty(&n->poll_list))) {
4609 pr_warn_once("%s: Budget exhausted after napi rescheduled\n",
4610 n->dev ? n->dev->name : "backlog");
4611 goto out_unlock;
4612 }
4613
4605 list_add_tail(&n->poll_list, repoll); 4614 list_add_tail(&n->poll_list, repoll);
4606 4615
4607out_unlock: 4616out_unlock: