Skip to content

Commit

Permalink
netpoll: Warn if more packets are processed than are budgeted
Browse files Browse the repository at this point in the history
There is already a warning for this case in the normal netpoll path,
but put a copy here in case how netpoll calls the poll functions
causes a differenet result.

netpoll will shortly call the napi poll routine with a budget 0 to
avoid any rx packets being processed.  As nothing does that today
we may encounter drivers that have problems so a netpoll specific
warning seems desirable.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Eric W. Biederman authored and David S. Miller committed Mar 17, 2014
1 parent eb8143b commit e97dc3f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions net/core/netpoll.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ static int poll_one_napi(struct napi_struct *napi, int budget)
set_bit(NAPI_STATE_NPSVC, &napi->state);

work = napi->poll(napi, budget);
WARN_ONCE(work > budget, "%pF exceeded budget in poll\n", napi->poll);
trace_napi_poll(napi);

clear_bit(NAPI_STATE_NPSVC, &napi->state);
Expand Down

0 comments on commit e97dc3f

Please sign in to comment.