Skip to contentSkip to conversation

docs: netdev: refine netdevsim testing guidance

PATCH Applied Jakub Kicinski 3 participants 3 messages Mar 4 – Mar 6

Subsystems (4)
lore
Share & tools
lore

Jakub Kicinski

author maintainer
#0 lore raw

PATCH 1/1 docs: netdev: refine netdevsim testing guidance

The library to create tests for both NIC HW and netdevsim has existed for almost a year. netdevsim-only tests we get increasingly feel like a waste, we should try to write tests that work both on netdevsim and real HW. Refine the guidance accordingly.

---
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]

---
 Documentation/process/maintainer-netdev.rst | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
Documentation/process/maintainer-netdev.rst +8 -2
index 6bce4507d5d3..3aa13bc2405d 100644
@@ -479,8 +479,14 @@ netdevsim
 
 ``netdevsim`` is a test driver which can be used to exercise driver
 configuration APIs without requiring capable hardware.
-Mock-ups and tests based on ``netdevsim`` are strongly encouraged when
-adding new APIs, but ``netdevsim`` in itself is **not** considered
+Mock-ups and tests based on ``netdevsim`` are encouraged when
+adding new APIs with complex logic in the stack. The tests should
+be written so that they can run both against ``netdevsim`` and a real
+device (see ``tools/testing/selftests/drivers/net/README.rst``).
+``netdevsim``-only tests should focus on testing corner cases
+and failure paths in the core which are hard to exercise with a real driver.
+
+``netdevsim`` in itself is **not** considered
 a use case/user. You must also implement the new APIs in a real driver.
 
 We give no guarantees that ``netdevsim`` won't change in the future
Signature · 1 line
2.53.0
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Jakub Kicinski

The library to create tests for both NIC HW and netdevsim has existed for almost a year. netdevsim-only tests we get increasingly feel like a waste, we should try to write tests that work both on netdevsim and real HW. Refine the guidance accordingly.

---
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]

Quoted 13 lines
---
 Documentation/process/maintainer-netdev.rst | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
Documentation/process/maintainer-netdev.rst +0 -1
index 6bce4507d5d3..3aa13bc2405d 100644
@@ -479,8 +479,14 @@ netdevsim
 
 ``netdevsim`` is a test driver which can be used to exercise driver
 configuration APIs without requiring capable hardware.
-Mock-ups and tests based on ``netdevsim`` are strongly encouraged when

Documentation/process/maintainer-netdev.rst netdevsim · line 490

Quoted 10 lines
Documentation/process/maintainer-netdev.rst +8 -1
-adding new APIs, but ``netdevsim`` in itself is **not** considered
+Mock-ups and tests based on ``netdevsim`` are encouraged when
+adding new APIs with complex logic in the stack. The tests should
+be written so that they can run both against ``netdevsim`` and a real
+device (see ``tools/testing/selftests/drivers/net/README.rst``).
+``netdevsim``-only tests should focus on testing corner cases
+and failure paths in the core which are hard to exercise with a real driver.
+
+``netdevsim`` in itself is **not** considered
 a use case/user. You must also implement the new APIs in a real driver.

I don't know if it's desirable, but the line wrapping could also be updated.

Quoted 5 lines
Documentation/process/maintainer-netdev.rst +0 -0
 We give no guarantees that ``netdevsim`` won't change in the future
Signature · 1 line
2.53.0
#2 lore raw
In reply to Jakub Kicinski
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 8 lines · On Wed, 4 Mar 2026 07:16:46 -0800 you wrote:

The library to create tests for both NIC HW and netdevsim has existed for almost a year. netdevsim-only tests we get increasingly feel like a waste, we should try to write tests that work both on netdevsim and real HW. Refine the guidance accordingly.

[...]

Here is the summary with links:
- [net-next] docs: netdev: refine netdevsim testing guidance

    https://git.kernel.org/netdev/net-next/c/8e235bc43326

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html