Skip to content

Commit

Permalink
net: Detect drivers that reschedule NAPI and exhaust budget
Browse files Browse the repository at this point in the history
The commit d75b1ad (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>
  • Loading branch information
Herbert Xu authored and David S. Miller committed Dec 24, 2014
1 parent 726ce70 commit 001ce54
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions net/core/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -4602,6 +4602,15 @@ static int napi_poll(struct napi_struct *n, struct list_head *repoll)
napi_gro_flush(n, HZ >= 1000);
}

/* Some drivers may have called napi_schedule
* prior to exhausting their budget.
*/
if (unlikely(!list_empty(&n->poll_list))) {
pr_warn_once("%s: Budget exhausted after napi rescheduled\n",
n->dev ? n->dev->name : "backlog");
goto out_unlock;
}

list_add_tail(&n->poll_list, repoll);

out_unlock:
Expand Down

0 comments on commit 001ce54

Please sign in to comment.