net: drv: netdevsim: don't napi_complete() from netpoll
Subsystems (3)
Jakub Kicinski
maintainerPATCH 1/1 net: drv: netdevsim: don't napi_complete() from netpoll
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.
---
CC: [email protected]
--- drivers/net/netdevsim/netdev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/netdevsim/netdev.c +2 -1
@@ -371,7 +371,8 @@ static int nsim_poll(struct napi_struct *napi, int budget)int done; done =nsim_rcv (rq, budget); -napi_complete (napi); +if (done < budget) +napi_complete_done (napi, done);return done; }
Signature · 1 line
2.49.0
Quoted 3 lines · Jakub Kicinski
netdevsim supports netpoll. Make sure we don't call
napi_complete()from it, since it may not be scheduled. Breno reports hitting a warning innapi_complete_done():
I decided to go learn a bit more about netdevsim, and ran across a typo in Documentation/networking/devlink/netdevsim.rst:
The ``netdevsim`` driver supports rate objects management, which includes:
- registerging/unregistering leaf rate objects per VF devlink port; ^^^^^^^^^^^^
-Dave
Hello Dave,
Quoted 8 lines · Dave Marquardt
Quoted 3 lines · Jakub Kicinski
netdevsim supports netpoll. Make sure we don't call
napi_complete()from it, since it may not be scheduled. Breno reports hitting a warning innapi_complete_done():I decided to go learn a bit more about netdevsim, and ran across a typo in
Documentation/networking/devlink/netdevsim.rst:
I acknowledge the bug exists in the latest netnext/main repo. Would you like to send a patch and fix it, or, should we?
Thanks for reporting it.
--breno
Quoted 9 lines · Breno Leitao
Hello Dave,
Quoted 6 lines · Dave Marquardt
Quoted 3 lines · Jakub Kicinski
netdevsim supports netpoll. Make sure we don't call
napi_complete()from it, since it may not be scheduled. Breno reports hitting a warning innapi_complete_done():
Quoted 5 lines
Quoted 2 lines
I decided to go learn a bit more about netdevsim, and ran across a typo in
Documentation/networking/devlink/netdevsim.rst:I acknowledge the bug exists in the latest netnext/main repo. Would you like to send a patch and fix it, or, should we?
I'll send in a patch. Thanks.
Quoted 1 line
Thanks for reporting it.
You're welcome!
-Dave
Hello Jakub,
Quoted 8 lines · Jakub Kicinski
netdevsim supports netpoll. Make sure we don't call
napi_complete()from it, since it may not be scheduled. Breno reports hitting a warning innapi_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
Quoted 5 lines
This is presumably after netpoll stole the SCHED bit prematurely.
Reported-by Breno Leitao <[email protected]>Fixes 3762ec05a9fb ("netdevsim: add NAPI support")Signed-off-by Jakub Kicinski <[email protected]>
Thanks for the quick fix,
--breno
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:
Quoted 9 lines · On Wed, 11 Jun 2025 10:46:43 -0700 you wrote:
netdevsim supports netpoll. Make sure we don't call
napi_complete()from it, since it may not be scheduled. Breno reports hitting a warning innapi_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[...]
Here is the summary with links:
- [net] net: drv: netdevsim: don't napi_complete() from netpoll
https://git.kernel.org/netdev/net/c/1264971017b4
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html