提交 9852fbec 编写于 作者: E Eric W. Biederman 提交者: David S. Miller

netpoll: Pass budget into poll_napi

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: N"Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 b249b51b
...@@ -165,10 +165,9 @@ static int poll_one_napi(struct napi_struct *napi, int budget) ...@@ -165,10 +165,9 @@ static int poll_one_napi(struct napi_struct *napi, int budget)
return budget - work; 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; struct napi_struct *napi;
int budget = 16;
list_for_each_entry(napi, &dev->napi_list, dev_list) { list_for_each_entry(napi, &dev->napi_list, dev_list) {
if (napi->poll_owner != smp_processor_id() && if (napi->poll_owner != smp_processor_id() &&
...@@ -196,6 +195,7 @@ static void netpoll_poll_dev(struct net_device *dev) ...@@ -196,6 +195,7 @@ static void netpoll_poll_dev(struct net_device *dev)
{ {
const struct net_device_ops *ops; const struct net_device_ops *ops;
struct netpoll_info *ni = rcu_dereference_bh(dev->npinfo); 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 /* Don't do any rx activity if the dev_lock mutex is held
* the dev_open/close paths use this to block netpoll activity * the dev_open/close paths use this to block netpoll activity
...@@ -221,7 +221,7 @@ static void netpoll_poll_dev(struct net_device *dev) ...@@ -221,7 +221,7 @@ static void netpoll_poll_dev(struct net_device *dev)
/* Process pending work on NIC */ /* Process pending work on NIC */
ops->ndo_poll_controller(dev); ops->ndo_poll_controller(dev);
poll_napi(dev); poll_napi(dev, budget);
atomic_dec(&trapped); atomic_dec(&trapped);
ni->rx_flags &= ~NETPOLL_RX_DROP; ni->rx_flags &= ~NETPOLL_RX_DROP;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册