Skip to content

Commit 6837dd8

Browse files
kuba-moogregkh
authored andcommitted
net: drv: netdevsim: don't napi_complete() from netpoll
[ Upstream commit 1264971 ] netdevsim supports netpoll. Make sure we don't call napi_complete() from it, since it may not be scheduled. Breno reports hitting a warning in napi_complete_done(): WARNING: CPU: 14 PID: 104 at net/core/dev.c:6592 napi_complete_done+0x2cc/0x560 __napi_poll+0x2d8/0x3a0 handle_softirqs+0x1fe/0x710 This is presumably after netpoll stole the SCHED bit prematurely. Reported-by: Breno Leitao <[email protected]> Fixes: 3762ec0 ("netdevsim: add NAPI support") Tested-by: Breno Leitao <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent fed94bd commit 6837dd8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/net/netdevsim/netdev.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,8 @@ static int nsim_poll(struct napi_struct *napi, int budget)
369369
int done;
370370

371371
done = nsim_rcv(rq, budget);
372-
napi_complete(napi);
372+
if (done < budget)
373+
napi_complete_done(napi, done);
373374

374375
return done;
375376
}

0 commit comments

Comments
 (0)