diff options
author | Amerigo Wang <amwang@redhat.com> | 2012-08-09 21:24:50 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-08-14 17:33:33 -0400 |
commit | 6bdb7fe31046ac50b47e83c35cd6c6b6160a475d (patch) | |
tree | c74da2bcfb27867bfc2fed58d3b5a9c84d445ef8 /net | |
parent | 689971b44613883ee74ae9c1b31a864aaa3a8e17 (diff) |
netpoll: re-enable irq in poll_napi()
napi->poll() needs IRQ enabled, so we have to re-enable IRQ before
calling it.
Cc: David Miller <davem@davemloft.net>
Signed-off-by: Cong Wang <amwang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/core/netpoll.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/net/core/netpoll.c b/net/core/netpoll.c index e4ba3e70c174..346b1eb83a1f 100644 --- a/net/core/netpoll.c +++ b/net/core/netpoll.c | |||
@@ -168,16 +168,24 @@ static void poll_napi(struct net_device *dev) | |||
168 | struct napi_struct *napi; | 168 | struct napi_struct *napi; |
169 | int budget = 16; | 169 | int budget = 16; |
170 | 170 | ||
171 | WARN_ON_ONCE(!irqs_disabled()); | ||
172 | |||
171 | list_for_each_entry(napi, &dev->napi_list, dev_list) { | 173 | list_for_each_entry(napi, &dev->napi_list, dev_list) { |
174 | local_irq_enable(); | ||
172 | if (napi->poll_owner != smp_processor_id() && | 175 | if (napi->poll_owner != smp_processor_id() && |
173 | spin_trylock(&napi->poll_lock)) { | 176 | spin_trylock(&napi->poll_lock)) { |
177 | rcu_read_lock_bh(); | ||
174 | budget = poll_one_napi(rcu_dereference_bh(dev->npinfo), | 178 | budget = poll_one_napi(rcu_dereference_bh(dev->npinfo), |
175 | napi, budget); | 179 | napi, budget); |
180 | rcu_read_unlock_bh(); | ||
176 | spin_unlock(&napi->poll_lock); | 181 | spin_unlock(&napi->poll_lock); |
177 | 182 | ||
178 | if (!budget) | 183 | if (!budget) { |
184 | local_irq_disable(); | ||
179 | break; | 185 | break; |
186 | } | ||
180 | } | 187 | } |
188 | local_irq_disable(); | ||
181 | } | 189 | } |
182 | } | 190 | } |
183 | 191 | ||