|
Revision tags: v6.15, v6.15-rc7, v6.15-rc6, v6.15-rc5, v6.15-rc4, v6.15-rc3, v6.15-rc2, v6.15-rc1, v6.14, v6.14-rc7, v6.14-rc6, v6.14-rc5 |
|
| #
da87caba |
| 24-Feb-2025 |
Gal Pressman <[email protected]> |
selftests: drv-net-hw: Add a test for symmetric RSS hash
Add a selftest that verifies symmetric RSS hash is working as intended. The test runs iterations of traffic, swapping the src/dst UDP ports,
selftests: drv-net-hw: Add a test for symmetric RSS hash
Add a selftest that verifies symmetric RSS hash is working as intended. The test runs iterations of traffic, swapping the src/dst UDP ports, and verifies that the same RX queue is receiving the traffic in both cases.
Reviewed-by: Nimrod Oren <[email protected]> Signed-off-by: Gal Pressman <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
show more ...
|
| #
01632500 |
| 24-Feb-2025 |
Gal Pressman <[email protected]> |
selftests: drv-net: Make rand_port() get a port more reliably
Instead of guessing a port and checking whether it's available, get an available port from the OS.
Reviewed-by: Nimrod Oren <noren@nvid
selftests: drv-net: Make rand_port() get a port more reliably
Instead of guessing a port and checking whether it's available, get an available port from the OS.
Reviewed-by: Nimrod Oren <[email protected]> Signed-off-by: Gal Pressman <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
show more ...
|
|
Revision tags: v6.14-rc4 |
|
| #
71477137 |
| 19-Feb-2025 |
Jakub Kicinski <[email protected]> |
selftests: drv-net: add a way to wait for a local process
We use wait_port_listen() extensively to wait for a process we spawned to be ready. Not all processes will open listening sockets. Add a met
selftests: drv-net: add a way to wait for a local process
We use wait_port_listen() extensively to wait for a process we spawned to be ready. Not all processes will open listening sockets. Add a method of explicitly waiting for a child to be ready. Pass a FD to the spawned process and wait for it to write a message to us. FD number is passed via KSFT_READY_FD env variable.
Similarly use KSFT_WAIT_FD to let the child process for a sign that we are done and child should exit. Sending a signal to a child with shell=True can get tricky.
Make use of this method in the queues test to make it less flaky.
Acked-by: Stanislav Fomichev <[email protected]> Acked-by: Joe Damato <[email protected]> Tested-by: Joe Damato <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
show more ...
|
| #
846742f7 |
| 19-Feb-2025 |
Jakub Kicinski <[email protected]> |
selftests: drv-net: add a warning for bkg + shell + terminate
Joe Damato reports that some shells will fork before running the command when python does "sh -c $cmd", while bash on my machine does an
selftests: drv-net: add a warning for bkg + shell + terminate
Joe Damato reports that some shells will fork before running the command when python does "sh -c $cmd", while bash on my machine does an exec of $cmd directly.
This will have implications for our ability to terminate the child process on various configurations of bash and other shells. Warn about using
bkg(... shell=True, termininate=True)
most background commands can hopefully exit cleanly (exit_wait).
Link: https://lore.kernel.org/Z7Yld21sv_Ip3gQx@LQ3V64L9R2 Acked-by: Stanislav Fomichev <[email protected]> Acked-by: Joe Damato <[email protected]> Tested-by: Joe Damato <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
show more ...
|
|
Revision tags: v6.14-rc3, v6.14-rc2, v6.14-rc1, v6.13, v6.13-rc7, v6.13-rc6, v6.13-rc5, v6.13-rc4 |
|
| #
f288c7a1 |
| 20-Dec-2024 |
Jakub Kicinski <[email protected]> |
selftests: drv-net: assume stats refresh is 0 if no ethtool -c support
Tests using HW stats wait for them to stabilize, using data from ethtool -c as the delay. Not all drivers implement ethtool -c
selftests: drv-net: assume stats refresh is 0 if no ethtool -c support
Tests using HW stats wait for them to stabilize, using data from ethtool -c as the delay. Not all drivers implement ethtool -c so handle the errors gracefully.
Reviewed-by: Andrew Lunn <[email protected]> Reviewed-by: Willem de Bruijn <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
show more ...
|
|
Revision tags: v6.13-rc3, v6.13-rc2, v6.13-rc1, v6.12, v6.12-rc7, v6.12-rc6, v6.12-rc5, v6.12-rc4, v6.12-rc3, v6.12-rc2, v6.12-rc1, v6.11, v6.11-rc7, v6.11-rc6, v6.11-rc5, v6.11-rc4, v6.11-rc3, v6.11-rc2, v6.11-rc1, v6.10, v6.10-rc7, v6.10-rc6 |
|
| #
8510801a |
| 27-Jun-2024 |
Jakub Kicinski <[email protected]> |
selftests: drv-net: add ability to schedule cleanup with defer()
This implements what I was describing in [1]. When writing a test author can schedule cleanup / undo actions right after the creation
selftests: drv-net: add ability to schedule cleanup with defer()
This implements what I was describing in [1]. When writing a test author can schedule cleanup / undo actions right after the creation completes, eg:
cmd("touch /tmp/file") defer(cmd, "rm /tmp/file")
defer() takes the function name as first argument, and the rest are arguments for that function. defer()red functions are called in inverse order after test exits. It's also possible to capture them and execute earlier (in which case they get automatically de-queued).
undo = defer(cmd, "rm /tmp/file") # ... some unsafe code ... undo.exec()
As a nice safety all exceptions from defer()ed calls are captured, printed, and ignored (they do make the test fail, however). This addresses the common problem of exceptions in cleanup paths often being unhandled, leading to potential leaks.
There is a global action queue, flushed by ksft_run(). We could support function level defers too, I guess, but there's no immediate need..
Link: https://lore.kernel.org/all/[email protected]/ # [1] Reviewed-by: Przemek Kitszel <[email protected]> Reviewed-by: Petr Machata <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
show more ...
|
| #
f898c16a |
| 26-Jun-2024 |
Jakub Kicinski <[email protected]> |
selftests: drv-net: rss_ctx: add tests for RSS configuration and contexts
Add tests focusing on indirection table configuration and creating extra RSS contexts in drivers which support it.
$ expo
selftests: drv-net: rss_ctx: add tests for RSS configuration and contexts
Add tests focusing on indirection table configuration and creating extra RSS contexts in drivers which support it.
$ export NETIF=eth0 REMOTE_... $ ./drivers/net/hw/rss_ctx.py KTAP version 1 1..8 ok 1 rss_ctx.test_rss_key_indir ok 2 rss_ctx.test_rss_context ok 3 rss_ctx.test_rss_context4 # Increasing queue count 44 -> 66 # Failed to create context 32, trying to test what we got ok 4 rss_ctx.test_rss_context32 # SKIP Tested only 31 contexts, wanted 32 ok 5 rss_ctx.test_rss_context_overlap ok 6 rss_ctx.test_rss_context_overlap2 # .. sprays traffic like a headless chicken .. not ok 7 rss_ctx.test_rss_context_out_of_order ok 8 rss_ctx.test_rss_context4_create_with_cfg # Totals: pass:6 fail:1 xfail:0 xpass:0 skip:1 error:0
Note that rss_ctx.test_rss_context_out_of_order fails with the device I tested with, but it seems to be a device / driver bug.
Reviewed-by: Petr Machata <[email protected]> Reviewed-by: Willem de Bruijn <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
show more ...
|
| #
af8e5164 |
| 26-Jun-2024 |
Jakub Kicinski <[email protected]> |
selftests: drv-net: add helper to wait for HW stats to sync
Some devices DMA stats to the host periodically. Add a helper which can wait for that to happen, based on frequency reported by the driver
selftests: drv-net: add helper to wait for HW stats to sync
Some devices DMA stats to the host periodically. Add a helper which can wait for that to happen, based on frequency reported by the driver in ethtool.
Reviewed-by: Petr Machata <[email protected]> Reviewed-by: Willem de Bruijn <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
show more ...
|
| #
8b8fe280 |
| 26-Jun-2024 |
Jakub Kicinski <[email protected]> |
selftests: drv-net: try to check if port is in use
We use random ports for communication. As Willem predicted this leads to occasional failures. Try to check if port is already in use by opening a s
selftests: drv-net: try to check if port is in use
We use random ports for communication. As Willem predicted this leads to occasional failures. Try to check if port is already in use by opening a socket and binding to that port.
Reviewed-by: Przemek Kitszel <[email protected]> Reviewed-by: Petr Machata <[email protected]> Reviewed-by: Willem de Bruijn <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
show more ...
|
|
Revision tags: v6.10-rc5, v6.10-rc4, v6.10-rc3, v6.10-rc2, v6.10-rc1, v6.9 |
|
| #
1cf27042 |
| 07-May-2024 |
David Wei <[email protected]> |
net: selftest: add test for netdev netlink queue-get API
Add a selftest for netdev generic netlink. For now there is only a single test that exercises the `queue-get` API.
The test works with netde
net: selftest: add test for netdev netlink queue-get API
Add a selftest for netdev generic netlink. For now there is only a single test that exercises the `queue-get` API.
The test works with netdevsim by default or with a real device by setting NETIF.
Add a timeout param to cmd() since ethtool -L can take a long time on real devices.
Signed-off-by: David Wei <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
show more ...
|
|
Revision tags: v6.9-rc7 |
|
| #
e1bb5e65 |
| 02-May-2024 |
Jakub Kicinski <[email protected]> |
selftests: net: py: check process exit code in bkg() and background cmd()
We're a bit too loose with error checking for background processes. cmd() completely ignores the fail argument passed to the
selftests: net: py: check process exit code in bkg() and background cmd()
We're a bit too loose with error checking for background processes. cmd() completely ignores the fail argument passed to the constructor if background is True. Default to checking for errors if process is not terminated explicitly. Caller can override with True / False.
For bkg() the processing step is called magically by __exit__ so record the value passed in the constructor.
Reported-by: Willem de Bruijn <[email protected]> Tested-by: Willem de Bruijn <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
show more ...
|
| #
ee2512d6 |
| 29-Apr-2024 |
Jakub Kicinski <[email protected]> |
selftests: net: py: avoid all ports < 10k
When picking TCP ports to use, avoid all below 10k. This should lower the chance of collision or running afoul whatever random policies may be on the host.
selftests: net: py: avoid all ports < 10k
When picking TCP ports to use, avoid all below 10k. This should lower the chance of collision or running afoul whatever random policies may be on the host.
Reviewed-by: Willem de Bruijn <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
show more ...
|
| #
32a4ca13 |
| 29-Apr-2024 |
Jakub Kicinski <[email protected]> |
selftests: net: py: extract tool logic
The main use of the ip() wrapper over cmd() is that it can parse JSON. cmd("ip -j link show") will return stdout as a string, and test has to call json.loads()
selftests: net: py: extract tool logic
The main use of the ip() wrapper over cmd() is that it can parse JSON. cmd("ip -j link show") will return stdout as a string, and test has to call json.loads(). With ip("link show", json=True) the return value will be already parsed.
More tools (ethtool, bpftool etc.) support the --json switch. To avoid having to wrap all of them individually create a tool() helper.
Switch from -j to --json (for ethtool). While at it consume the netns attribute at the ip() level.
Reviewed-by: Willem de Bruijn <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
show more ...
|
|
Revision tags: v6.9-rc6, v6.9-rc5 |
|
| #
31611cea |
| 20-Apr-2024 |
Jakub Kicinski <[email protected]> |
selftests: drv-net: add a TCP ping test case (and useful helpers)
More complex tests often have to spawn a background process, like a server which will respond to requests or tcpdump.
Add support f
selftests: drv-net: add a TCP ping test case (and useful helpers)
More complex tests often have to spawn a background process, like a server which will respond to requests or tcpdump.
Add support for creating such processes using the with keyword:
with bkg("my-daemon", ..): # my-daemon is alive in this block
My initial thought was to add this support to cmd() directly but it runs the command in the constructor, so by the time we __enter__ it's too late to make sure we used "background=True".
Second useful helper transplanted from net_helper.sh is wait_port_listen().
The test itself uses socat, which insists on v6 addresses being wrapped in [], it's not the only command which requires this format, so add the wrapped address to env. The hope is to save test code from checking if address is v6.
Reviewed-by: Willem de Bruijn <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
show more ...
|
| #
1a20a9a0 |
| 20-Apr-2024 |
Jakub Kicinski <[email protected]> |
selftests: drv-net: define endpoint structures
Define the remote endpoint "model". To execute most meaningful device driver tests we need to be able to communicate with a remote system, and have it
selftests: drv-net: define endpoint structures
Define the remote endpoint "model". To execute most meaningful device driver tests we need to be able to communicate with a remote system, and have it send traffic to the device under test.
Various test environments will have different requirements.
0) "Local" netdevsim-based testing can simply use net namespaces. netdevsim supports connecting two devices now, to form a veth-like construct.
1) Similarly on hosts with multiple NICs, the NICs may be connected together with a loopback cable or internal device loopback. One interface may be placed into separate netns, and tests would proceed much like in the netdevsim case. Note that the loopback config or the moving of one interface into a netns is not expected to be part of selftest code.
2) Some systems may need to communicate with the remote endpoint via SSH.
3) Last but not least environment may have its own custom communication method.
Fundamentally we only need two operations: - run a command remotely - deploy a binary (if some tool we need is built as part of kselftests)
Wrap these two in a class. Use dynamic loading to load the Remote class. This will allow very easy definition of other communication methods without bothering upstream code base.
Stick to the "simple" / "no unnecessary abstractions" model for referring to the remote endpoints. The host / remote object are passed as an argument to the usual cmd() or ip() invocation. For example:
ip("link show", json=True, host=remote)
Reviewed-by: Willem de Bruijn <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
show more ...
|
| #
232d79aa |
| 16-Apr-2024 |
Jakub Kicinski <[email protected]> |
selftests: drv-net: add stdout to the command failed exception
ping prints all the info to stdout. To make debug easier capture stdout in the Exception raised when command unexpectedly fails.
Revie
selftests: drv-net: add stdout to the command failed exception
ping prints all the info to stdout. To make debug easier capture stdout in the Exception raised when command unexpectedly fails.
Reviewed-by: Willem de Bruijn <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
show more ...
|
|
Revision tags: v6.9-rc4, v6.9-rc3 |
|
| #
b86761ff |
| 05-Apr-2024 |
Jakub Kicinski <[email protected]> |
selftests: net: add scaffolding for Netlink tests in Python
Add glue code for accessing the YNL library which lives under tools/net and YAML spec files from under Documentation/. Automatically figur
selftests: net: add scaffolding for Netlink tests in Python
Add glue code for accessing the YNL library which lives under tools/net and YAML spec files from under Documentation/. Automatically figure out if tests are run in tree or not. Since we'll want to use this library both from net and drivers/net test targets make the library a target as well, and automatically include it when net or drivers/net are included. Making net/lib a target ensures that we end up with only one copy of it, and saves us some path guessing.
Add a tiny bit of formatting support to be able to output KTAP from the start.
Reviewed-by: Petr Machata <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: David S. Miller <[email protected]>
show more ...
|