[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250721233608.111860-1-skhawaja@google.com>
Date: Mon, 21 Jul 2025 23:36:08 +0000
From: Samiullah Khawaja <skhawaja@...gle.com>
To: Jakub Kicinski <kuba@...nel.org>, "David S . Miller " <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>, almasrymina@...gle.com,
willemb@...gle.com
Cc: netdev@...r.kernel.org, skhawaja@...gle.com
Subject: [PATCH net-next] net: Restore napi threaded state only when it is enabled
Commit 2677010e7793 ("Add support to set NAPI threaded for individual
NAPI") added support to enable/disable threaded napi using netlink. This
also extended the napi config save/restore functionality to set the napi
threaded state. This breaks the netdev reset when threaded napi is
enabled at device level as the napi_restore_config tries to stop the
kthreads as napi->config->thread is false when threaded is enabled at
device level.
The napi_restore_config should only restore the napi threaded state when
threaded is enabled at NAPI level.
The issue can be reproduced on virtio-net device using qemu. To
reproduce the issue run following,
echo 1 > /sys/class/net/threaded
ethtool -L eth0 combined 1
Fixes: 2677010e7793 ("Add support to set NAPI threaded for individual NAPI")
Signed-off-by: Samiullah Khawaja <skhawaja@...gle.com>
---
net/core/dev.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/core/dev.c b/net/core/dev.c
index 621a639aeba1..1cab04b8f60a 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -7244,7 +7244,8 @@ static void napi_restore_config(struct napi_struct *n)
n->config->napi_id = n->napi_id;
}
- WARN_ON_ONCE(napi_set_threaded(n, n->config->threaded));
+ if (n->config->threaded)
+ WARN_ON_ONCE(napi_set_threaded(n, n->config->threaded));
}
static void napi_save_config(struct napi_struct *n)
base-commit: c3886ccaadf8fdc2c91bfbdcdca36ccdc6ef8f70
--
2.50.0.727.gbf7dc18ff4-goog
Powered by blists - more mailing lists