Re: [PATCH net-next] selftests: net: give up on the cmsg_time accuracy on slow machines

2025-01-17 Thread Petr Machata
Jakub Kicinski writes: > On Fri, 17 Jan 2025 13:49:23 +0100 Petr Machata wrote: >> This logging and xfail handling duplicates lib.sh. Would a patch like >> below be OK with you? The gist of it is to just use check_err, log_test >> and xfail_on_slow from lib.sh to achie

Re: [PATCH net-next] selftests: net: give up on the cmsg_time accuracy on slow machines

2025-01-17 Thread Petr Machata
Jakub Kicinski writes: > Commit b9d5f5711dd8 ("selftests: net: increase the delay for relative > cmsg_time.sh test") widened the accepted value range 8x but we still > see flakes (at a rate of around 7%). > > Return XFAIL for the most timing sensitive test on slow machines. > > Before: > > #

Re: [PATCH net-next] selftests: drv-net: test drivers sleeping in ndo_get_stats64

2025-01-06 Thread Petr Machata
tats.pkt_byte_sum > ok 4 stats.qstat_by_ifindex > ok 5 stats.check_down > ok 6 stats.procfs_hammer > # completed up/down cycles: 6 > ok 7 stats.procfs_downup_hammer > # Totals: pass:7 fail:0 xfail:0 xpass:0 skip:0 error:0 > > Signed-off-by: Jakub Kicinski Reviewed-by: Petr Machata

Re: [PATCH net 5/5] selftests: net-drv: stats: sanity check netlink dumps

2024-12-16 Thread Petr Machata
ult() exists for exactly these add-unless-already-exists scenarios: parsed_entry = parsed.setdefault(ifindex, {"rx":[], "tx": []}) parsed_entry[entry["queue-type"]].append(entry['queue-id']) Sometimes this can be used to inline the whole express

Re: [PATCH net 4/5] selftests: net-drv: queues: sanity check netlink dumps

2024-12-16 Thread Petr Machata
es, expected) > > > def addremove_queues(cfg, nl) -> None: > @@ -57,7 +60,7 @@ import glob > > > def main() -> None: > -with NetDrvEnv(__file__, queue_count=3) as cfg: > +with NetDrvEnv(__file__, queue_count=100) as cfg: > ksft_run([get_queues, addremove_queues], args=(cfg, NetdevFamily())) > ksft_exit() Hmm, get_queues() doesn't use the passed-in NetdevFamily(), but that gets created anyway for addremove_queues(), so whatever. Reviewed-by: Petr Machata

Re: [PATCH net 3/5] selftests: net: support setting recv_size in YNL

2024-12-16 Thread Petr Machata
y. > Keep the normal default, we don't want tests to unintentionally > behave very differently than normal code. > > Signed-off-by: Jakub Kicinski Reviewed-by: Petr Machata

[PATCH net 3/3] selftests: mlxsw: sharedbuffer: Ensure no extra packets are counted

2024-12-05 Thread Petr Machata
expected. Add egress filters on $h1 and $h2 that will guarantee the above. Fixes: a865ad999603 ("selftests: mlxsw: Add shared buffer traffic test") Signed-off-by: Danielle Ratson Reviewed-by: Ido Schimmel Signed-off-by: Ido Schimmel Signed-off-by: Petr Machata --- .../drivers

[PATCH net 2/3] selftests: mlxsw: sharedbuffer: Remove duplicate test cases

2024-12-05 Thread Petr Machata
: Add shared buffer traffic test") Signed-off-by: Danielle Ratson Reviewed-by: Ido Schimmel Signed-off-by: Ido Schimmel Signed-off-by: Petr Machata --- .../selftests/drivers/net/mlxsw/sharedbuffer.sh| 10 -- 1 file changed, 10 deletions(-) diff --git a/tools/testing/selftests/d

[PATCH net 1/3] selftests: mlxsw: sharedbuffer: Remove h1 ingress test case

2024-12-05 Thread Petr Machata
failures by removing unintentional test case regarding the ingress pool of $h1. Fixes: a865ad999603 ("selftests: mlxsw: Add shared buffer traffic test") Signed-off-by: Danielle Ratson Reviewed-by: Ido Schimmel Signed-off-by: Ido Schimmel Signed-off-by: Petr Machata --- tools/testing

[PATCH net 0/3] selftests: mlxsw: Add few fixes for sharedbuffer test

2024-12-05 Thread Petr Machata
Danielle Ratson writes: Currently, the sharedbuffer test fails sometimes because it is reading a maximum occupancy that is larger than expected on some different cases. This is happening because the test assumes that the packet it is sending is the only packet being passed to the device. In addi

[PATCH net-next v2 11/11] selftests: forwarding: Add a selftest for the new reserved_bits UAPI

2024-12-05 Thread Petr Machata
Run VXLAN packets through a gateway. Flip individual bits of the packet and/or reserved bits of the gateway, and check that the gateway treats the packets as expected. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel --- Notes: v2: - Add the new test to Makefile CC: Shuah

[PATCH net-next v2 09/11] selftests: net: lib: Rename ip_link_master() to ip_link_set_master()

2024-12-05 Thread Petr Machata
Let's have a verb in that function name to make it clearer what's going on. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel --- Notes: CC: Shuah Khan CC: Benjamin Poirier CC: Hangbin Liu CC: Vladimir Oltean CC: linux-kselftest@vger.kernel.org tools/testing/sel

[PATCH net-next v2 10/11] selftests: net: lib: Add several autodefer helpers

2024-12-05 Thread Petr Machata
Add ip_link_set_addr(), ip_link_set_up(), ip_addr_add() and ip_route_add() to the suite of helpers that automatically schedule a corresponding cleanup. When setting a new MAC, one needs to remember the old address first. Move mac_get() from forwarding/ to that end. Signed-off-by: Petr Machata

Re: [PATCH net-next v1 11/11] selftests: forwarding: Add a selftest for the new reserved_bits UAPI

2024-12-04 Thread Petr Machata
Jakub Kicinski writes: > On Tue, 3 Dec 2024 15:30:37 +0100 Petr Machata wrote: >> .../net/forwarding/vxlan_reserved.sh | 352 ++ >> 1 file changed, 352 insertions(+) >> create mode 100755 tools/testing/selftests/net/forwarding/vxlan_reserved.sh

[PATCH net-next v1 11/11] selftests: forwarding: Add a selftest for the new reserved_bits UAPI

2024-12-03 Thread Petr Machata
Run VXLAN packets through a gateway. Flip individual bits of the packet and/or reserved bits of the gateway, and check that the gateway treats the packets as expected. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel --- Notes: CC: Shuah Khan CC: Benjamin Poirier CC: Hangbin Liu CC

[PATCH net-next v1 10/11] selftests: net: lib: Add several autodefer helpers

2024-12-03 Thread Petr Machata
Add ip_link_set_addr(), ip_link_set_up(), ip_addr_add() and ip_route_add() to the suite of helpers that automatically schedule a corresponding cleanup. When setting a new MAC, one needs to remember the old address first. Move mac_get() from forwarding/ to that end. Signed-off-by: Petr Machata

[PATCH net-next v1 09/11] selftests: net: lib: Rename ip_link_master() to ip_link_set_master()

2024-12-03 Thread Petr Machata
Let's have a verb in that function name to make it clearer what's going on. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel --- Notes: CC: Shuah Khan CC: Benjamin Poirier CC: Hangbin Liu CC: Vladimir Oltean CC: linux-kselftest@vger.kernel.org tools/testing/sel

[RFC PATCH net-next 10/11] selftests: net: lib: Add several autodefer helpers

2024-11-18 Thread Petr Machata
Add ip_link_set_addr(), ip_link_set_up(), ip_addr_add() and ip_route_add() to the suite of helpers that automatically schedule a corresponding cleanup. When setting a new MAC, one needs to remember the old address first. Move mac_get() from forwarding/ to that end. Signed-off-by: Petr Machata

[RFC PATCH net-next 11/11] selftests: forwarding: Add a selftest for the new reserved_bits UAPI

2024-11-18 Thread Petr Machata
Run VXLAN packets through a gateway. Flip individual bits of the packet and/or reserved bits of the gateway, and check that the gateway treats the packets as expected. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel --- Notes: CC: Shuah Khan CC: Benjamin Poirier CC: Hangbin Liu CC

[RFC PATCH net-next 09/11] selftests: net: lib: Rename ip_link_master() to ip_link_set_master()

2024-11-18 Thread Petr Machata
Let's have a verb in that function name to make it clearer what's going on. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel --- Notes: CC: Shuah Khan CC: Benjamin Poirier CC: Hangbin Liu CC: Vladimir Oltean CC: linux-kselftest@vger.kernel.org tools/testing/sel

[PATCH net-next v4 3/7] selftests: net: lib: Move logging from forwarding/lib.sh here

2024-11-14 Thread Petr Machata
lways sourced near the top of the file (checked), and whatever new definitions will simply override the ones provided by lib.sh. Signed-off-by: Petr Machata Reviewed-by: Amit Cohen Acked-by: Shuah Khan --- Notes: CC: Shuah Khan CC: Benjamin Poirier CC: Hangbin Liu CC: linux-kselftest@vger.kerne

[PATCH net-next v4 6/7] selftests: net: lib: Add kill_process

2024-11-14 Thread Petr Machata
A number of selftests run processes in the background and need to kill them afterwards. Instead for everyone to open-code the kill / wait / redirect mantra, add a helper in net/lib.sh. Convert existing open-code sites. Signed-off-by: Petr Machata Acked-by: Shuah Khan Reviewed-by: Amit Cohen

[PATCH net-next v4 7/7] selftests: net: fdb_notify: Add a test for FDB notifications

2024-11-14 Thread Petr Machata
vlan_create() from forwarding/lib.sh are somewhat opaque and perhaps too kitchen-sinky, so I tried to go in the opposite direction with these ones, and wrapped only the bare minimum to schedule a corresponding cleanup. Signed-off-by: Petr Machata Reviewed-by: Amit Cohen Acked-by: Shuah Khan --- Notes

[PATCH net-next v4 5/7] selftests: net: lib: Move checks from forwarding/lib.sh here

2024-11-14 Thread Petr Machata
names for their functions. However lib.sh is always sourced near the top of the file (checked), and whatever new definitions will simply override the ones provided by lib.sh. Signed-off-by: Petr Machata Reviewed-by: Amit Cohen Acked-by: Shuah Khan --- Notes: CC: Shuah Khan CC: Benjamin Poirier

[PATCH net-next v4 4/7] selftests: net: lib: Move tests_run from forwarding/lib.sh here

2024-11-14 Thread Petr Machata
is always sourced near the top of the file (checked), and whatever new definition will simply override the one provided by lib.sh. Signed-off-by: Petr Machata Reviewed-by: Amit Cohen Acked-by: Shuah Khan --- Notes: CC: Shuah Khan CC: Benjamin Poirier CC: Hangbin Liu CC: linux-kselftest

Re: [PATCH net-next v3 7/7] selftests: net: fdb_notify: Add a test for FDB notifications

2024-11-13 Thread Petr Machata
Jakub Kicinski writes: > On Mon, 11 Nov 2024 18:09:01 +0100 Petr Machata wrote: >> Check that only one notification is produced for various FDB edit >> operations. >> >> Regarding the ip_link_add() and ip_link_master() helpers. This pattern of >> action plu

[PATCH net-next v3 7/7] selftests: net: fdb_notify: Add a test for FDB notifications

2024-11-11 Thread Petr Machata
vlan_create() from forwarding/lib.sh are somewhat opaque and perhaps too kitchen-sinky, so I tried to go in the opposite direction with these ones, and wrapped only the bare minimum to schedule a corresponding cleanup. Signed-off-by: Petr Machata Reviewed-by: Amit Cohen Acked-by: Shuah Khan --- Notes: CC

[PATCH net-next v3 5/7] selftests: net: lib: Move checks from forwarding/lib.sh here

2024-11-11 Thread Petr Machata
names for their functions. However lib.sh is always sourced near the top of the file (checked), and whatever new definitions will simply override the ones provided by lib.sh. Signed-off-by: Petr Machata Reviewed-by: Amit Cohen Acked-by: Shuah Khan --- Notes: CC: Shuah Khan CC: Benjamin Poirier

[PATCH net-next v3 6/7] selftests: net: lib: Add kill_process

2024-11-11 Thread Petr Machata
A number of selftests run processes in the background and need to kill them afterwards. Instead for everyone to open-code the kill / wait / redirect mantra, add a helper in net/lib.sh. Convert existing open-code sites. Signed-off-by: Petr Machata Acked-by: Shuah Khan Reviewed-by: Amit Cohen

[PATCH net-next v3 4/7] selftests: net: lib: Move tests_run from forwarding/lib.sh here

2024-11-11 Thread Petr Machata
is always sourced near the top of the file (checked), and whatever new definition will simply override the one provided by lib.sh. Signed-off-by: Petr Machata Reviewed-by: Amit Cohen Acked-by: Shuah Khan --- Notes: CC: Shuah Khan CC: Benjamin Poirier CC: Hangbin Liu CC: linux-kselftest

[PATCH net-next v3 3/7] selftests: net: lib: Move logging from forwarding/lib.sh here

2024-11-11 Thread Petr Machata
lways sourced near the top of the file (checked), and whatever new definitions will simply override the ones provided by lib.sh. Signed-off-by: Petr Machata Reviewed-by: Amit Cohen Acked-by: Shuah Khan --- Notes: CC: Shuah Khan CC: Benjamin Poirier CC: Hangbin Liu CC: linux-kselftest@vger.kerne

[PATCH net-next v2 5/8] selftests: net: lib: Move tests_run from forwarding/lib.sh here

2024-10-25 Thread Petr Machata
is always sourced near the top of the file (checked), and whatever new definition will simply override the one provided by lib.sh. Signed-off-by: Petr Machata Reviewed-by: Amit Cohen Acked-by: Shuah Khan --- Notes: CC: Shuah Khan CC: Benjamin Poirier CC: Hangbin Liu CC: linux-kselftest

[PATCH net-next v2 7/8] selftests: net: lib: Add kill_process

2024-10-25 Thread Petr Machata
A number of selftests run processes in the background and need to kill them afterwards. Instead for everyone to open-code the kill / wait / redirect mantra, add a helper in net/lib.sh. Convert existing open-code sites. Signed-off-by: Petr Machata Acked-by: Shuah Khan --- Notes: CC: Shuah Khan

[PATCH net-next v2 6/8] selftests: net: lib: Move checks from forwarding/lib.sh here

2024-10-24 Thread Petr Machata
names for their functions. However lib.sh is always sourced near the top of the file (checked), and whatever new definitions will simply override the ones provided by lib.sh. Signed-off-by: Petr Machata Reviewed-by: Amit Cohen Acked-by: Shuah Khan --- Notes: CC: Shuah Khan CC: Benjamin Poirier

[PATCH net-next v2 8/8] selftests: net: fdb_notify: Add a test for FDB notifications

2024-10-24 Thread Petr Machata
vlan_create() from forwarding/lib.sh are somewhat opaque and perhaps too kitchen-sinky, so I tried to go in the opposite direction with these ones, and wrapped only the bare minimum to schedule a corresponding cleanup. Signed-off-by: Petr Machata Reviewed-by: Amit Cohen Acked-by: Shuah Khan --- Notes: CC

[PATCH net-next v2 4/8] selftests: net: lib: Move logging from forwarding/lib.sh here

2024-10-24 Thread Petr Machata
lways sourced near the top of the file (checked), and whatever new definitions will simply override the ones provided by lib.sh. Signed-off-by: Petr Machata Reviewed-by: Amit Cohen Acked-by: Shuah Khan --- Notes: CC: Shuah Khan CC: Benjamin Poirier CC: Hangbin Liu CC: linux-kselftest@vger.kerne

Re: [PATCH net-next 4/8] selftests: net: lib: Move logging from forwarding/lib.sh here

2024-10-24 Thread Petr Machata
Shuah Khan writes: > On 10/22/24 08:50, Petr Machata wrote: >> Many net selftests invent their own logging helpers. These really should be >> in a library sourced by these tests. Currently forwarding/lib.sh has a >> suite of perfectly fine logging helpers, but sourcing

[PATCH net-next 6/8] selftests: net: lib: Move checks from forwarding/lib.sh here

2024-10-22 Thread Petr Machata
names for their functions. However lib.sh is always sourced near the top of the file (checked), and whatever new definitions will simply override the ones provided by lib.sh. Signed-off-by: Petr Machata Reviewed-by: Amit Cohen --- CC: Shuah Khan CC: Benjamin Poirier CC: Hangbin Liu CC: linux

[PATCH net-next 8/8] selftests: net: fdb_notify: Add a test for FDB notifications

2024-10-22 Thread Petr Machata
vlan_create() from forwarding/lib.sh are somewhat opaque and perhaps too kitchen-sinky, so I tried to go in the opposite direction with these ones, and wrapped only the bare minimum to schedule a corresponding cleanup. Signed-off-by: Petr Machata Reviewed-by: Amit Cohen --- CC: Shuah Khan CC: Benjamin

[PATCH net-next 7/8] selftests: net: lib: Add kill_process

2024-10-22 Thread Petr Machata
A number of selftests run processes in the background and need to kill them afterwards. Instead for everyone to open-code the kill / wait / redirect mantra, add a helper in net/lib.sh. Convert existing open-code sites. Signed-off-by: Petr Machata Reviewed-by: Amit Cohen --- CC: Shuah Khan CC

[PATCH net-next 5/8] selftests: net: lib: Move tests_run from forwarding/lib.sh here

2024-10-22 Thread Petr Machata
is always sourced near the top of the file (checked), and whatever new definition will simply override the one provided by lib.sh. Signed-off-by: Petr Machata Reviewed-by: Amit Cohen --- CC: Shuah Khan CC: Benjamin Poirier CC: Hangbin Liu CC: linux-kselftest@vger.kernel.org CC: Jiri Pirko

[PATCH net-next 4/8] selftests: net: lib: Move logging from forwarding/lib.sh here

2024-10-22 Thread Petr Machata
lways sourced near the top of the file (checked), and whatever new definitions will simply override the ones provided by lib.sh. Signed-off-by: Petr Machata Reviewed-by: Amit Cohen --- CC: Shuah Khan CC: Benjamin Poirier CC: Hangbin Liu CC: linux-kselftest@vger.kernel.org CC: Jiri Pirko ---

[PATCH net-next v2 10/10] selftests: mlxsw: devlink_trap_police: Use defer for test cleanup

2024-10-17 Thread Petr Machata
Use the defer framework to schedule cleanups as soon as the command is executed. Note that the start_traffic commands in __burst_test() are each sending a fixed number of packets (note the -c flag) and then ending. They therefore do not need a matching stop_traffic. Signed-off-by: Petr Machata

[PATCH net-next v2 09/10] selftests: mlxsw: qos_max_descriptors: Use defer for test cleanup

2024-10-17 Thread Petr Machata
Use the defer framework to schedule cleanups as soon as the command is executed. Signed-off-by: Petr Machata --- .../drivers/net/mlxsw/qos_max_descriptors.sh | 118 ++ 1 file changed, 41 insertions(+), 77 deletions(-) diff --git a/tools/testing/selftests/drivers/net/mlxsw

[PATCH net-next v2 08/10] selftests: mlxsw: qos_ets_strict: Use defer for test cleanup

2024-10-17 Thread Petr Machata
Use the defer framework to schedule cleanups as soon as the command is executed. Signed-off-by: Petr Machata --- .../drivers/net/mlxsw/qos_ets_strict.sh | 167 +- 1 file changed, 85 insertions(+), 82 deletions(-) diff --git a/tools/testing/selftests/drivers/net/mlxsw

[PATCH net-next v2 07/10] selftests: mlxsw: qos_mc_aware: Use defer for test cleanup

2024-10-17 Thread Petr Machata
Use the defer framework to schedule cleanups as soon as the command is executed. Signed-off-by: Petr Machata --- .../drivers/net/mlxsw/qos_mc_aware.sh | 146 -- 1 file changed, 68 insertions(+), 78 deletions(-) diff --git a/tools/testing/selftests/drivers/net/mlxsw

[PATCH net-next v2 06/10] selftests: ETS: Use defer for test cleanup

2024-10-17 Thread Petr Machata
Use the defer framework to schedule cleanups as soon as the command is executed. Signed-off-by: Petr Machata --- .../selftests/drivers/net/mlxsw/sch_ets.sh| 26 +++--- .../selftests/net/forwarding/sch_ets.sh | 7 +- .../selftests/net/forwarding/sch_ets_core.sh | 81

[PATCH net-next v2 04/10] selftests: RED: Use defer for test cleanup

2024-10-17 Thread Petr Machata
dd a local helper to stop traffic and sleep afterwards. Signed-off-by: Petr Machata --- Notes: v2: - Defer stop_traffic including the sleep. The sleep is actually necessary and v1 was wrong in that it had the sleep prior to the stop_traffic invocation. .../drivers/net/mlxsw/sch_r

[PATCH net-next v2 05/10] selftests: TBF: Use defer for test cleanup

2024-10-17 Thread Petr Machata
Use the defer framework to schedule cleanups as soon as the command is executed. Signed-off-by: Petr Machata --- .../selftests/net/forwarding/sch_tbf_core.sh | 91 ++- .../net/forwarding/sch_tbf_etsprio.sh | 7 +- .../selftests/net/forwarding/sch_tbf_root.sh | 3

[PATCH net-next v2 03/10] selftests: forwarding: lib: Allow passing PID to stop_traffic()

2024-10-17 Thread Petr Machata
after the traffic is started without confusing the cleanup. Signed-off-by: Petr Machata --- tools/testing/selftests/net/forwarding/lib.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/net/forwarding/lib.sh b/tools/testing/selftests/net/forwarding

[PATCH net-next v2 02/10] selftests: forwarding: Add a fallback cleanup()

2024-10-17 Thread Petr Machata
free to override the function. Since pre_cleanup() is too entangled with forwarding-specific minutia, the function cannot currently be in net/lib.sh. Signed-off-by: Petr Machata --- tools/testing/selftests/net/forwarding/lib.sh | 6 ++ 1 file changed, 6 insertions(+) diff --git a/tools

[PATCH net-next v2 01/10] selftests: net: lib: Introduce deferred commands

2024-10-17 Thread Petr Machata
ling their cleanups. Signed-off-by: Petr Machata --- Notes: v2: - In __defer__schedule(), use ndefers in place of ${__DEFER__NJOBS[$ndefers_key]} tools/testing/selftests/net/forwarding/lib.sh | 3 +- tools/testing/selftests/net/lib.sh| 3 + tools/testing/selftes

[PATCH net-next v2 00/10] selftests: net: Introduce deferred commands

2024-10-17 Thread Petr Machata
just stop_traffic - Patches #6, #7, #8, #9, #10: - New patch Petr Machata (10): selftests: net: lib: Introduce deferred commands selftests: forwarding: Add a fallback cleanup() selftests: forwarding: lib: Allow passing PID to stop_traffic() selftests: RED: Use defer for test cleanup self

Re: [PATCH net-next 01/10] selftests: net: lib: Introduce deferred commands

2024-10-15 Thread Petr Machata
Paolo Abeni writes: > Hi, > > On 10/9/24 14:06, Petr Machata wrote: >> diff --git a/tools/testing/selftests/net/lib/sh/defer.sh >> b/tools/testing/selftests/net/lib/sh/defer.sh >> new file mode 100644 >> index ..8d205c3f0445 >> --- /dev/nu

Re: [PATCH net-next 04/10] selftests: RED: Use defer for test cleanup

2024-10-15 Thread Petr Machata
Paolo Abeni writes: > On 10/9/24 14:06, Petr Machata wrote: >> @@ -450,6 +415,7 @@ __do_ecn_test() >> start_tcp_traffic $h1.$vlan $(ipaddr 1 $vlan) $(ipaddr 3 $vlan) \ >>$h3_mac tos=0x01 >> +defer stop_traffic $! >> sleep

[PATCH net-next 09/10] selftests: mlxsw: qos_max_descriptors: Use defer for test cleanup

2024-10-09 Thread Petr Machata
Use the defer framework to schedule cleanups as soon as the command is executed. Signed-off-by: Petr Machata --- .../drivers/net/mlxsw/qos_max_descriptors.sh | 118 ++ 1 file changed, 41 insertions(+), 77 deletions(-) diff --git a/tools/testing/selftests/drivers/net/mlxsw

[PATCH net-next 10/10] selftests: mlxsw: devlink_trap_police: Use defer for test cleanup

2024-10-09 Thread Petr Machata
Use the defer framework to schedule cleanups as soon as the command is executed. Note that the start_traffic commands in __burst_test() are each sending a fixed number of packets (note the -c flag) and then ending. They therefore do not need a matching stop_traffic. Signed-off-by: Petr Machata

[PATCH net-next 08/10] selftests: mlxsw: qos_ets_strict: Use defer for test cleanup

2024-10-09 Thread Petr Machata
Use the defer framework to schedule cleanups as soon as the command is executed. Signed-off-by: Petr Machata --- .../drivers/net/mlxsw/qos_ets_strict.sh | 167 +- 1 file changed, 85 insertions(+), 82 deletions(-) diff --git a/tools/testing/selftests/drivers/net/mlxsw

[PATCH net-next 07/10] selftests: mlxsw: qos_mc_aware: Use defer for test cleanup

2024-10-09 Thread Petr Machata
Use the defer framework to schedule cleanups as soon as the command is executed. Signed-off-by: Petr Machata --- .../drivers/net/mlxsw/qos_mc_aware.sh | 146 -- 1 file changed, 68 insertions(+), 78 deletions(-) diff --git a/tools/testing/selftests/drivers/net/mlxsw

[PATCH net-next 06/10] selftests: ETS: Use defer for test cleanup

2024-10-09 Thread Petr Machata
Use the defer framework to schedule cleanups as soon as the command is executed. Signed-off-by: Petr Machata --- .../selftests/drivers/net/mlxsw/sch_ets.sh| 26 +++--- .../selftests/net/forwarding/sch_ets.sh | 7 +- .../selftests/net/forwarding/sch_ets_core.sh | 81

[PATCH net-next 05/10] selftests: TBF: Use defer for test cleanup

2024-10-09 Thread Petr Machata
Use the defer framework to schedule cleanups as soon as the command is executed. Signed-off-by: Petr Machata --- .../selftests/net/forwarding/sch_tbf_core.sh | 91 ++- .../net/forwarding/sch_tbf_etsprio.sh | 7 +- .../selftests/net/forwarding/sch_tbf_root.sh | 3

[PATCH net-next 04/10] selftests: RED: Use defer for test cleanup

2024-10-09 Thread Petr Machata
Instead of having a suite of dedicated cleanup functions, use the defer framework to schedule cleanups right as their setup functions are run. Signed-off-by: Petr Machata --- .../drivers/net/mlxsw/sch_red_core.sh | 171 +- .../drivers/net/mlxsw/sch_red_ets.sh

[PATCH net-next 03/10] selftests: forwarding: lib: Allow passing PID to stop_traffic()

2024-10-09 Thread Petr Machata
after the traffic is started without confusing the cleanup. Signed-off-by: Petr Machata --- tools/testing/selftests/net/forwarding/lib.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/net/forwarding/lib.sh b/tools/testing/selftests/net/forwarding

[PATCH net-next 02/10] selftests: forwarding: Add a fallback cleanup()

2024-10-09 Thread Petr Machata
free to override the function. Since pre_cleanup() is too entangled with forwarding-specific minutia, the function cannot currently be in net/lib.sh. Signed-off-by: Petr Machata --- tools/testing/selftests/net/forwarding/lib.sh | 6 ++ 1 file changed, 6 insertions(+) diff --git a/tools

[PATCH net-next 00/10] selftests: net: Introduce deferred commands

2024-10-09 Thread Petr Machata
, not just stop_traffic - Patches #6, #7, #8, #9, #10: - New patch Petr Machata (10): selftests: net: lib: Introduce deferred commands selftests: forwarding: Add a fallback cleanup() selftests: forwarding: lib: Allow passing PID to stop_traffic() selftests: RED: Use defer for test cl

[PATCH net-next 01/10] selftests: net: lib: Introduce deferred commands

2024-10-09 Thread Petr Machata
ling their cleanups. Signed-off-by: Petr Machata --- tools/testing/selftests/net/forwarding/lib.sh | 3 +- tools/testing/selftests/net/lib.sh| 3 + tools/testing/selftests/net/lib/Makefile | 2 +- tools/testing/selftests/net/lib/sh/defer.sh | 115 ++ 4 fil

[PATCH net-next 5/5] selftests: mlxsw: sch_red_core: Lower TBF rate

2024-10-07 Thread Petr Machata
-by: Petr Machata --- tools/testing/selftests/drivers/net/mlxsw/sch_red_core.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/drivers/net/mlxsw/sch_red_core.sh b/tools/testing/selftests/drivers/net/mlxsw/sch_red_core.sh index 316444389c4e

[PATCH net-next 4/5] selftests: mlxsw: sch_red_core: Send more packets for drop tests

2024-10-07 Thread Petr Machata
ins, while actually narrowing them relatively. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel --- .../selftests/drivers/net/mlxsw/sch_red_core.sh | 16 +--- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/tools/testing/selftests/drivers/net/mlxsw/sch_red_core.sh

[PATCH net-next 3/5] selftests: mlxsw: sch_red_core: Sleep before querying queue depth

2024-10-07 Thread Petr Machata
ects all in-flight traffic. Signed-off-by: Petr Machata Reviewed-by: Amit Cohen --- tools/testing/selftests/drivers/net/mlxsw/sch_red_core.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/testing/selftests/drivers/net/mlxsw/sch_red_core.sh b/tools/testing/selftests/drivers/net/mlx

[PATCH net-next 2/5] selftests: mlxsw: sch_red_core: Increase backlog size tolerance

2024-10-07 Thread Petr Machata
ing for several seconds hoping to get within the bounds, but that still proved to be too noisy (or the wait time would be impractically long). Unfortunately we have to bump the value tolerance from 10% to 15%, which in this patch do. Signed-off-by: Petr Machata Reviewed-by: Amit Cohen --- to

[PATCH net-next 1/5] selftests: mlxsw: sch_red_ets: Increase required backlog

2024-10-07 Thread Petr Machata
Backlog fluctuates on Spectrum-4 much more than on <4. Increasing the desired backlog seems to help, as the constant fluctuations do not overlap into the territory where packets are marked. Signed-off-by: Petr Machata Reviewed-by: Amit Cohen --- tools/testing/selftests/drivers/net/ml

[PATCH net-next 0/5] selftests: mlxsw: Stabilize RED tests

2024-10-07 Thread Petr Machata
Tweak the mlxsw-specific RED selftests to increase stability on Spectrum-3 and Spectrum-4 machines. Petr Machata (5): selftests: mlxsw: sch_red_ets: Increase required backlog selftests: mlxsw: sch_red_core: Increase backlog size tolerance selftests: mlxsw: sch_red_core: Sleep before

[PATCH net-next] selftests: mlxsw: rtnetlink: Use devlink_reload() API

2024-09-30 Thread Petr Machata
o Schimmel Signed-off-by: Petr Machata --- tools/testing/selftests/drivers/net/mlxsw/rtnetlink.sh | 10 ++ 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/tools/testing/selftests/drivers/net/mlxsw/rtnetlink.sh b/tools/testing/selftests/drivers/net/mlxsw/rtnetlink.sh index 89

Re: [RFC PATCH net-next 1/5] selftests: forwarding: Introduce deferred commands

2024-08-27 Thread Petr Machata
Jakub Kicinski writes: > On Tue, 27 Aug 2024 10:53:53 +0200 Petr Machata wrote: >> >> I can do it, but it's gonna be more pain in setting up those >> >> TEST_INCLUDES. People will forget. It will be a nuisance. >> >> I'm thinking

Re: [RFC PATCH net-next 1/5] selftests: forwarding: Introduce deferred commands

2024-08-27 Thread Petr Machata
Przemek Kitszel writes: > On 8/26/24 17:20, Petr Machata wrote: >> Przemek Kitszel writes: >> >>> On 8/22/24 15:49, Petr Machata wrote: >>>> In commit 8510801a9dbd ("selftests: drv-net: add ability to schedule >>>> cleanup with de

[PATCH net-next] selftests: forwarding: local_termination: Down ports on cleanup

2024-08-26 Thread Petr Machata
This test neglects to put ports down on cleanup. Fix it. Fixes: 90b9566aa5cd ("selftests: forwarding: add a test for local_termination.sh") Signed-off-by: Petr Machata --- tools/testing/selftests/net/forwarding/local_termination.sh | 4 1 file changed, 4 insertions(+) diff --g

Re: [RFC PATCH net-next 1/5] selftests: forwarding: Introduce deferred commands

2024-08-26 Thread Petr Machata
Przemek Kitszel writes: > On 8/22/24 15:49, Petr Machata wrote: >> In commit 8510801a9dbd ("selftests: drv-net: add ability to schedule >> cleanup with defer()"), a defer helper was added to Python selftests. >> The idea is to keep cleanup commands close

Re: [RFC PATCH net-next 5/5] selftests: sch_tbf_core: Use defer for stopping traffic

2024-08-26 Thread Petr Machata
Ido Schimmel writes: > On Thu, Aug 22, 2024 at 03:49:44PM +0200, Petr Machata wrote: >> Tests interrupted part-way through leave behind a running mausezahn. Use >> defer to schedule a traffic stop after traffic is started. > > Any reason not to convert the setup part to t

Re: [RFC PATCH net-next 1/5] selftests: forwarding: Introduce deferred commands

2024-08-26 Thread Petr Machata
Ido Schimmel writes: > On Thu, Aug 22, 2024 at 03:49:40PM +0200, Petr Machata wrote: >> The following patches will convert several selftests to this new framework. > > The intention is to make sure new tests are using these helpers? Well, I sent this as RFC because I'm

[PATCH net-next] selftests: forwarding: no_forwarding: Down ports on cleanup

2024-08-23 Thread Petr Machata
This test neglects to put ports down on cleanup. Fix it. Fixes: 476a4f05d9b8 ("selftests: forwarding: add a no_forwarding.sh test") Signed-off-by: Petr Machata --- tools/testing/selftests/net/forwarding/no_forwarding.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/too

[RFC PATCH net-next 4/5] selftests: mlxsw: sch_red_*: Use defer for qdisc management

2024-08-22 Thread Petr Machata
Use defer scopes to manage qdisc lifetime. Signed-off-by: Petr Machata --- .../drivers/net/mlxsw/sch_red_ets.sh | 32 +-- .../drivers/net/mlxsw/sch_red_root.sh | 24 ++ 2 files changed, 34 insertions(+), 22 deletions(-) diff --git a/tools/testing

[RFC PATCH net-next 5/5] selftests: sch_tbf_core: Use defer for stopping traffic

2024-08-22 Thread Petr Machata
Tests interrupted part-way through leave behind a running mausezahn. Use defer to schedule a traffic stop after traffic is started. Signed-off-by: Petr Machata --- tools/testing/selftests/net/forwarding/sch_tbf_core.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools

[RFC PATCH net-next 3/5] selftests: mlxsw: sch_red_core: Use defer for stopping traffic

2024-08-22 Thread Petr Machata
Tests interrupted part-way through leave behind a running mausezahn. Use defer to schedule a traffic stop after traffic is started. Mark the functions that run traffic as defer-scoped, such that the traffic is stopped right after the function returns. Signed-off-by: Petr Machata --- .../drivers

[RFC PATCH net-next 2/5] selftests: mlxsw: sch_red_core: Use defer for test cleanup

2024-08-22 Thread Petr Machata
: Petr Machata --- .../drivers/net/mlxsw/sch_red_core.sh | 109 ++ 1 file changed, 37 insertions(+), 72 deletions(-) diff --git a/tools/testing/selftests/drivers/net/mlxsw/sch_red_core.sh b/tools/testing/selftests/drivers/net/mlxsw/sch_red_core.sh index 7151b0c7bf8d

[RFC PATCH net-next 1/5] selftests: forwarding: Introduce deferred commands

2024-08-22 Thread Petr Machata
efer scope before the function is called, and pops it after it returns. The following patches will convert several selftests to this new framework. Signed-off-by: Petr Machata --- tools/testing/selftests/net/forwarding/lib.sh | 83 +++ 1 file changed, 83 insertions(+) diff --g

[RFC PATCH net-next 0/5] selftests: forwarding: Introduce deferred commands

2024-08-22 Thread Petr Machata
remove it again, _why is it still broken_?") This is an attempt at squashing this whole class of problems. Patch #1 has more details about the primitives being introduced. Patches #2 to #5 the convert several selftests to give an idea of how it looks in practice. Petr Machata (5): selfte

Re: [PATCH net-next v5] net: netconsole: selftests: Create a new netconsole selftest

2024-08-21 Thread Petr Machata
Jakub Kicinski writes: > On Mon, 19 Aug 2024 02:03:53 -0700 Breno Leitao wrote: >> +function check_for_dependencies() { >> +if [ "$(id -u)" -ne 0 ]; then >> +echo "This test must be run as root" >&2 >> +exit "${ksft_skip}" >> +fi >> + >> +if ! which socat > /

[PATCH net] selftests: mlxsw: ethtool_lanes: Source ethtool lib from correct path

2024-08-20 Thread Petr Machata
o Schimmel Signed-off-by: Petr Machata --- tools/testing/selftests/drivers/net/mlxsw/ethtool_lanes.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/drivers/net/mlxsw/ethtool_lanes.sh b/tools/testing/selftests/drivers/net/mlxsw/ethtool_lane

Re: [PATCH net-next v2] net: netconsole: selftests: Create a new netconsole selftest

2024-08-14 Thread Petr Machata
Breno Leitao writes: > Adds a selftest that creates two virtual interfaces, assigns one to a > new namespace, and assigns IP addresses to both. > > It listens on the destination interface using socat and configures a > dynamic target on netconsole, pointing to the destination IP address. > > Th

Re: [PATCH net-next v2] selftests: net: py: support verbose printing, display executed commands

2024-08-12 Thread Petr Machata
Jakub Kicinski writes: > On Fri, 9 Aug 2024 14:36:17 +0200 Petr Machata wrote: >> > +env_level = env.get('VERBOSE') >> > +set_verbosity(env_level) >> > + >> >> Actually, the ksft_setup() here was merged last week, and I think t

Re: [PATCH net-next v2] selftests: net: py: support verbose printing, display executed commands

2024-08-09 Thread Petr Machata
Mohsin Bashir writes: > Add verbosity support to show the commands executed while > running tests. Enable verbosity if either an environment > variable 'VERBOSE' is set to a non-zero number or it is defined > in a config file under driver tests as discussed here: > https://github.com/linux-netd

Re: [PATCH net-next] selftests: net: py: support verbose printing, display executed commands

2024-08-05 Thread Petr Machata
Mohsin Bashir writes: > Add verbosity support to show the commands executed while > running tests. Enable verbosity if either an environment > variable 'VERBOSE' is set to a non-zero number or it is defined > in a config file under driver tests as discussed here: > https://github.com/linux-netd

Re: [PATCH net-next v2 1/2] selftests: net-drv: exercise queue stats when the device is down

2024-08-01 Thread Petr Machata
Stanislav Fomichev writes: > On 08/01, Petr Machata wrote: >> >> Stanislav Fomichev writes: >> >> > On 07/31, Jakub Kicinski wrote: >> >> On Wed, 31 Jul 2024 13:34:58 +0200 Petr Machata wrote: >> >> > > +qstat = netf

Re: [PATCH net-next v2 2/2] selftests: net: ksft: support marking tests as disruptive

2024-08-01 Thread Petr Machata
Jakub Kicinski writes: > On Thu, 1 Aug 2024 10:36:18 +0200 Petr Machata wrote: >> You seem to be right about the exit code. This was discussed some time >> ago, that SKIP is considered a sort of a failure. As the person running >> the test you would want to go in and fix w

[PATCH net-next 6/6] selftests: fib_nexthops: Test 16-bit next hop weights

2024-08-01 Thread Petr Machata
Add tests that attempt to create NH groups that use full 16 bits of NH weight. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel --- tools/testing/selftests/net/fib_nexthops.sh | 55 - 1 file changed, 54 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests

[PATCH net-next 5/6] selftests: router_mpath_nh_res: Test 16-bit next hop weights

2024-08-01 Thread Petr Machata
Add tests that exercise full 16 bits of NH weight. Like in the previous patch, omit the 255:65535 test when KSFT_MACHINE_SLOW. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel --- .../net/forwarding/router_mpath_nh_res.sh | 56 --- 1 file changed, 48 insertions(+), 8

[PATCH net-next 4/6] selftests: router_mpath_nh: Test 16-bit next hop weights

2024-08-01 Thread Petr Machata
Add tests that exercise full 16 bits of NH weight. To test the 255:65535, it is necessary to run more packets than for the other tests. On a debug kernel, the test can take up to a minute, therefore avoid the test when KSFT_MACHINE_SLOW. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel

[PATCH net-next 3/6] selftests: router_mpath: Sleep after MZ

2024-08-01 Thread Petr Machata
In the context of an offloaded datapath, it may take a while for the ip link stats to be updated. This causes the test to fail when MZ_DELAY is too low. Sleep after the packets are sent for the link stats to get up to date. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel --- tools

Re: [PATCH net-next v2 2/2] selftests: net: ksft: support marking tests as disruptive

2024-08-01 Thread Petr Machata
Stanislav Fomichev writes: > On 07/31, Petr Machata wrote: >> >> Stanislav Fomichev writes: >> >> > Add new @ksft_disruptive decorator to mark the tests that might >> > be disruptive to the system. Depending on how well the previous >> &g

Re: [PATCH net-next v2 1/2] selftests: net-drv: exercise queue stats when the device is down

2024-08-01 Thread Petr Machata
Stanislav Fomichev writes: > On 07/31, Jakub Kicinski wrote: >> On Wed, 31 Jul 2024 13:34:58 +0200 Petr Machata wrote: >> > > +qstat = netfam.qstats_get({"ifindex": cfg.ifindex}, dump=True) >> > > +except NlError as e: >> > &g

  1   2   3   >