Skip to content

Commit 3e4d79c

Browse files
committed
net: warn if NAPI instance wasn't shut down
JIRA: https://issues.redhat.com/browse/RHEL-77816 Upstream Status: net.git commit 9dd05df commit 9dd05df Author: Jakub Kicinski <kuba@kernel.org> Date: Mon Feb 3 13:58:16 2025 -0800 net: warn if NAPI instance wasn't shut down Drivers should always disable a NAPI instance before removing it. If they don't the instance may be queued for polling. Since commit 86e25f4 ("net: napi: Add napi_config") we also remove the NAPI from the busy polling hash table in napi_disable(), so not disabling would leave a stale entry there. Use of busy polling is relatively uncommon so bugs may be lurking in the drivers. Add an explicit warning. Reviewed-by: Joe Damato <jdamato@fastly.com> Reviewed-by: Eric Dumazet <edumazet@google.com> Link: https://patch.msgid.link/20250203215816.1294081-1-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Davide Caratti <dcaratti@redhat.com>
1 parent 4368586 commit 3e4d79c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

net/core/dev.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6743,6 +6743,9 @@ void __netif_napi_del(struct napi_struct *napi)
67436743
if (!test_and_clear_bit(NAPI_STATE_LISTED, &napi->state))
67446744
return;
67456745

6746+
/* Make sure NAPI is disabled (or was never enabled). */
6747+
WARN_ON(!test_bit(NAPI_STATE_SCHED, &napi->state));
6748+
67466749
if (napi->config) {
67476750
napi->index = -1;
67486751
napi->config = NULL;

0 commit comments

Comments
 (0)