Skip to content

Commit 6bdb7fe

Browse files
Amerigo Wangdavem330
authored andcommitted
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 <[email protected]> Signed-off-by: Cong Wang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 689971b commit 6bdb7fe

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

net/core/netpoll.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,16 +168,24 @@ static void poll_napi(struct net_device *dev)
168168
struct napi_struct *napi;
169169
int budget = 16;
170170

171+
WARN_ON_ONCE(!irqs_disabled());
172+
171173
list_for_each_entry(napi, &dev->napi_list, dev_list) {
174+
local_irq_enable();
172175
if (napi->poll_owner != smp_processor_id() &&
173176
spin_trylock(&napi->poll_lock)) {
177+
rcu_read_lock_bh();
174178
budget = poll_one_napi(rcu_dereference_bh(dev->npinfo),
175179
napi, budget);
180+
rcu_read_unlock_bh();
176181
spin_unlock(&napi->poll_lock);
177182

178-
if (!budget)
183+
if (!budget) {
184+
local_irq_disable();
179185
break;
186+
}
180187
}
188+
local_irq_disable();
181189
}
182190
}
183191

0 commit comments

Comments
 (0)