Skip to content

Commit

Permalink
netpoll: Pass budget into poll_napi
Browse files Browse the repository at this point in the history
This moves the control logic to the top level in netpoll_poll_dev
instead of having it dispersed throughout netpoll_poll_dev,
poll_napi and poll_one_napi.

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 b249b51 commit 9852fbe
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions net/core/netpoll.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,9 @@ static int poll_one_napi(struct napi_struct *napi, int budget)
return budget - work;
}

static void poll_napi(struct net_device *dev)
static void poll_napi(struct net_device *dev, int budget)
{
struct napi_struct *napi;
int budget = 16;

list_for_each_entry(napi, &dev->napi_list, dev_list) {
if (napi->poll_owner != smp_processor_id() &&
Expand Down Expand Up @@ -196,6 +195,7 @@ static void netpoll_poll_dev(struct net_device *dev)
{
const struct net_device_ops *ops;
struct netpoll_info *ni = rcu_dereference_bh(dev->npinfo);
int budget = 16;

/* Don't do any rx activity if the dev_lock mutex is held
* the dev_open/close paths use this to block netpoll activity
Expand All @@ -221,7 +221,7 @@ static void netpoll_poll_dev(struct net_device *dev)
/* Process pending work on NIC */
ops->ndo_poll_controller(dev);

poll_napi(dev);
poll_napi(dev, budget);

atomic_dec(&trapped);
ni->rx_flags &= ~NETPOLL_RX_DROP;
Expand Down

0 comments on commit 9852fbe

Please sign in to comment.