diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2014-03-14 23:45:17 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-03-17 15:47:22 -0400 |
commit | 9852fbec2c95b6e168c55e97e6051b99aead6f31 (patch) | |
tree | 12fd8bc7a669d93646c22786517c68fd0b3efdf4 /net/core/netpoll.c | |
parent | b249b51b983db1773d3531b7266c397b6b16a7cd (diff) |
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: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/netpoll.c')
-rw-r--r-- | net/core/netpoll.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/core/netpoll.c b/net/core/netpoll.c index ef4f45df539f..147c75855c9b 100644 --- a/net/core/netpoll.c +++ b/net/core/netpoll.c | |||
@@ -165,10 +165,9 @@ static int poll_one_napi(struct napi_struct *napi, int budget) | |||
165 | return budget - work; | 165 | return budget - work; |
166 | } | 166 | } |
167 | 167 | ||
168 | static void poll_napi(struct net_device *dev) | 168 | static void poll_napi(struct net_device *dev, int budget) |
169 | { | 169 | { |
170 | struct napi_struct *napi; | 170 | struct napi_struct *napi; |
171 | int budget = 16; | ||
172 | 171 | ||
173 | list_for_each_entry(napi, &dev->napi_list, dev_list) { | 172 | list_for_each_entry(napi, &dev->napi_list, dev_list) { |
174 | if (napi->poll_owner != smp_processor_id() && | 173 | if (napi->poll_owner != smp_processor_id() && |
@@ -196,6 +195,7 @@ static void netpoll_poll_dev(struct net_device *dev) | |||
196 | { | 195 | { |
197 | const struct net_device_ops *ops; | 196 | const struct net_device_ops *ops; |
198 | struct netpoll_info *ni = rcu_dereference_bh(dev->npinfo); | 197 | struct netpoll_info *ni = rcu_dereference_bh(dev->npinfo); |
198 | int budget = 16; | ||
199 | 199 | ||
200 | /* Don't do any rx activity if the dev_lock mutex is held | 200 | /* Don't do any rx activity if the dev_lock mutex is held |
201 | * the dev_open/close paths use this to block netpoll activity | 201 | * 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 | /* Process pending work on NIC */ | 221 | /* Process pending work on NIC */ |
222 | ops->ndo_poll_controller(dev); | 222 | ops->ndo_poll_controller(dev); |
223 | 223 | ||
224 | poll_napi(dev); | 224 | poll_napi(dev, budget); |
225 | 225 | ||
226 | atomic_dec(&trapped); | 226 | atomic_dec(&trapped); |
227 | ni->rx_flags &= ~NETPOLL_RX_DROP; | 227 | ni->rx_flags &= ~NETPOLL_RX_DROP; |