Commit 6bdb7fe3 authored by Amerigo Wang's avatar Amerigo Wang Committed by David S. Miller

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: default avatarCong Wang <amwang@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 689971b4
...@@ -168,16 +168,24 @@ static void poll_napi(struct net_device *dev) ...@@ -168,16 +168,24 @@ static void poll_napi(struct net_device *dev)
struct napi_struct *napi; struct napi_struct *napi;
int budget = 16; int budget = 16;
WARN_ON_ONCE(!irqs_disabled());
list_for_each_entry(napi, &dev->napi_list, dev_list) { list_for_each_entry(napi, &dev->napi_list, dev_list) {
local_irq_enable();
if (napi->poll_owner != smp_processor_id() && if (napi->poll_owner != smp_processor_id() &&
spin_trylock(&napi->poll_lock)) { spin_trylock(&napi->poll_lock)) {
rcu_read_lock_bh();
budget = poll_one_napi(rcu_dereference_bh(dev->npinfo), budget = poll_one_napi(rcu_dereference_bh(dev->npinfo),
napi, budget); napi, budget);
rcu_read_unlock_bh();
spin_unlock(&napi->poll_lock); spin_unlock(&napi->poll_lock);
if (!budget) if (!budget) {
local_irq_disable();
break; break;
}
} }
local_irq_disable();
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment