selftests: drv-net: test the napi init state
Subsystems (3)
Jakub Kicinski
maintainerPATCH 1/1 selftests: drv-net: test the napi init state
Test that threaded state (in the persistent NAPI config) gets updated even when NAPI with given ID is not allocated at the time.
This test is validating commit ccba9f6baa90 ("net: update NAPI threaded config even for disabled NAPIs").
---
Somehow I missed sending this out with the fix series.
--- .../selftests/drivers/net/napi_threaded.py | 31 ++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-)
tools/testing/selftests/drivers/net/napi_threaded.py +30 -1
@@ -38,6 +38,34 @@ from lib.py import cmd, defer, ethtool return combined +def napi_init(cfg, nl) -> None: + """ + Test that threaded state (in the persistent NAPI config) gets updated + even when NAPI with given ID is not allocated at the time. + """ + + qcnt = _setup_deferred_cleanup(cfg) + + _set_threaded_state(cfg, 1) + cmd(f"ethtool -L {cfg.ifname} combined 1") + _set_threaded_state(cfg, 0) + cmd(f"ethtool -L {cfg.ifname} combined {qcnt}") + + napis = nl.napi_get({'ifindex': cfg.ifindex}, dump=True) + for napi in napis: + ksft_eq(napi['threaded'], 'disabled') + ksft_eq(napi.get('pid'), None) + + cmd(f"ethtool -L {cfg.ifname} combined 1") + _set_threaded_state(cfg, 1) + cmd(f"ethtool -L {cfg.ifname} combined {qcnt}") + + napis = nl.napi_get({'ifindex': cfg.ifindex}, dump=True) + for napi in napis: + ksft_eq(napi['threaded'], 'enabled') + ksft_ne(napi.get('pid'), None) + + def enable_dev_threaded_disable_napi_threaded(cfg, nl) -> None: """ Test that when napi threaded is enabled at device level and
@@ -103,7 +131,8 @@ from lib.py import cmd, defer, ethtool """ Ksft boiler plate main """ with NetDrvEnv(__file__, queue_count=2) as cfg: - ksft_run([change_num_queues, + ksft_run([napi_init, + change_num_queues, enable_dev_threaded_disable_napi_threaded], args=(cfg, NetdevFamily())) ksft_exit()
Signature · 1 line
2.50.1
Quoted 10 lines · Jakub Kicinski
Test that threaded state (in the persistent NAPI config) gets updated even when NAPI with given ID is not allocated at the time.
This test is validating commit
ccba9f6baa90("net: update NAPI threaded config even for disabled NAPIs").Signed-off-by Jakub Kicinski <[email protected]>---
Somehow I missed sending this out with the fix series.
Quoted 7 lines
--- .../selftests/drivers/net/napi_threaded.py | 31 ++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-)
This patch was applied to netdev/net-next.git (main) by Paolo Abeni <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by Paolo Abeni <[email protected]>:
Quoted 9 lines · On Thu, 14 Aug 2025 18:33:14 -0700 you wrote:
Test that threaded state (in the persistent NAPI config) gets updated even when NAPI with given ID is not allocated at the time.
This test is validating commit
ccba9f6baa90("net: update NAPI threaded config even for disabled NAPIs").Signed-off-by Jakub Kicinski <[email protected]>[...]
Here is the summary with links:
- [net-next] selftests: drv-net: test the napi init state
https://git.kernel.org/netdev/net-next/c/0283b8f134e4
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html