[PATCH net-next v2 4/5] selftests: forwarding: lib: Split sysctl_save() out of sysctl_set()

2024-06-07 Thread Petr Machata
In order to be able to save the current value of a sysctl without changing it, split the relevant bit out of sysctl_set() into a new helper. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel --- Cc: Shuah Khan Cc: linux-kselftest@vger.kernel.org Notes: v2: - New patch. tools

[PATCH net-next v2 5/5] selftests: forwarding: router_mpath_hash: Add a new selftest

2024-06-07 Thread Petr Machata
-by: Petr Machata Reviewed-by: Ido Schimmel --- Cc: Shuah Khan Cc: linux-kselftest@vger.kernel.org Notes: v2: - Do not set seed on test init and run the stability tests first to catch the cases of a missed pernet seed init. .../testing/selftests/net/forwarding/Makefile | 1 + .../net

Re: [PATCH net 2/3] selftests: net: lib: avoid error removing empty netns name

2024-06-05 Thread Petr Machata
Matthieu Baerts writes: > Hi Petr, > > Thank you for the review! > > On 05/06/2024 12:38, Petr Machata wrote: >> >> "Matthieu Baerts (NGI0)" writes: >> >>> If there is an error to create the first netns with 'setup_ns()', >>>

Re: [PATCH net 2/3] selftests: net: lib: avoid error removing empty netns name

2024-06-05 Thread Petr Machata
"Matthieu Baerts (NGI0)" writes: > If there is an error to create the first netns with 'setup_ns()', > 'cleanup_ns()' will be called with an empty string as first parameter. > > The consequences is that 'cleanup_ns()' will try to delete an invalid > netns, and wait 20 seconds if the netns list

[PATCH net-next 4/4] selftests: forwarding: router_mpath_hash: Add a new selftest

2024-05-29 Thread Petr Machata
-by: Petr Machata Reviewed-by: Ido Schimmel --- Cc: Shuah Khan Cc: linux-kselftest@vger.kernel.org .../testing/selftests/net/forwarding/Makefile | 1 + .../net/forwarding/router_mpath_seed.sh | 322 ++ 2 files changed, 323 insertions(+) create mode 100755 tools/testing

Re: [PATCH net v3] selftests: net: local_termination: annotate the expected failures

2024-05-17 Thread Petr Machata
AIL. >> >> Signed-off-by: Jakub Kicinski I'm still confused that the failure was shown for $rcv_if_name==bridge, yet we are testing $h1==veth. But mechanically the code is correct. Reviewed-by: Petr Machata

Re: [PATCH net-next] selftests: net: local_termination: annotate the expected failures

2024-05-16 Thread Petr Machata
Jakub Kicinski writes: > On Wed, 15 May 2024 11:02:28 +0200 Petr Machata wrote: >> >> And then either replace the existing xfail_on_veth's (there are just a >> >> handful) or convert xfail_on_veth to a wrapper around xfail_on_kind. >> > >> > I thi

Re: [PATCH net-next] selftests: net: local_termination: annotate the expected failures

2024-05-15 Thread Petr Machata
Jakub Kicinski writes: > On Mon, 13 May 2024 15:25:38 +0200 Petr Machata wrote: >> For veth specifically there is xfail_on_veth: >> >> xfail_on_veth $rcv_if_name \ >> check_rcv $rcv_if_name "Unicast IPv4 to unknown MAC address" \ >>

Re: [PATCH net-next] selftests: net: local_termination: annotate the expected failures

2024-05-13 Thread Petr Machata
Jakub Kicinski writes: > @@ -157,7 +168,7 @@ run_test() > > check_rcv $rcv_if_name "Unicast IPv4 to unknown MAC address" \ > "$smac > $UNKNOWN_UC_ADDR1, ethertype IPv4 (0x0800)" \ > - false > + false true > > check_rcv $rcv_if_name "Unicast

Re: [PATCH net-next 1/5] selftests: drv-net: define endpoint structures

2024-04-15 Thread Petr Machata
Willem de Bruijn writes: > 1. Cleaning up remote state in all conditions, including timeout/kill. > >Some tests require a setup phase before the test, and a matching >cleanup phase. If any of the configured state is variable (even >just a randomized filepath) this needs to be

[PATCH net-next 10/10] selftests: forwarding: router_nh: Add a diagram

2024-04-12 Thread Petr Machata
This test lacks a topology diagram, making the setup not obvious. Add one. Signed-off-by: Petr Machata --- .../testing/selftests/net/forwarding/router_nh.sh | 14 ++ 1 file changed, 14 insertions(+) diff --git a/tools/testing/selftests/net/forwarding/router_nh.sh b/tools/testing

[PATCH net-next 09/10] selftests: forwarding: router_mpath_nh_res: Add a diagram

2024-04-12 Thread Petr Machata
This test lacks a topology diagram, making the setup not obvious. Add one. Signed-off-by: Petr Machata --- .../net/forwarding/router_mpath_nh_res.sh | 35 +++ 1 file changed, 35 insertions(+) diff --git a/tools/testing/selftests/net/forwarding/router_mpath_nh_res.sh b

[PATCH net-next 08/10] selftests: forwarding: router_mpath_nh: Add a diagram

2024-04-12 Thread Petr Machata
This test lacks a topology diagram, making the setup not obvious. Add one. Cc: David Ahern Signed-off-by: Petr Machata --- .../net/forwarding/router_mpath_nh.sh | 35 +++ 1 file changed, 35 insertions(+) diff --git a/tools/testing/selftests/net/forwarding

[PATCH net-next 07/10] selftests: mlxsw: ethtool_lanes: Wait for lanes parameter dump explicitly

2024-04-12 Thread Petr Machata
assumed to be, resulting in ethtool_lanes.sh test failure. To avoid that, ensure that the lanes parameter is indeed dumped by waiting for it explicitly, before preforming the test cases. Signed-off-by: Danielle Ratson Reviewed-by: Petr Machata Signed-off-by: Petr Machata --- .../selftests/drivers

[PATCH net-next 06/10] selftests: drivers: hw: Include tc_common.sh in hw_stats_l3

2024-04-12 Thread Petr Machata
iteration. Nevertheless it's not correct. Include tc_common.sh as appropriate. Signed-off-by: Petr Machata --- tools/testing/selftests/drivers/net/hw/hw_stats_l3.sh | 1 + tools/testing/selftests/drivers/net/hw/hw_stats_l3_gre.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/tools

[PATCH net-next 05/10] selftests: drivers: hw: ethtool.sh: Adjust output

2024-04-12 Thread Petr Machata
rewording the messages so that they are not excessively long. Some check_err messages do not indicate what the issue actually is, so reword them to say it's a "ping with", like is the case in some other instances in this test. Signed-off-by: Petr Machata --- tools/testing/selftests/driv

[PATCH net-next 04/10] selftests: drivers: hw: Fix ethtool_rmon

2024-04-12 Thread Petr Machata
. Instead, cap the value at 0. mausezahn will use an appropriate minimum packet length. Cc: Vladimir Oltean Cc: Tobias Waldekranz Signed-off-by: Petr Machata --- tools/testing/selftests/drivers/net/hw/ethtool_rmon.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/testing/selftests

[PATCH net-next 03/10] selftests: forwarding: bail_on_lldpad() should SKIP

2024-04-12 Thread Petr Machata
$ksft_skip is used to mark selftests that have tooling issues. The fact that LLDPad is running, but shouldn't, is one such issue. Therefore have bail_on_lldpad() bail with $ksft_skip. Signed-off-by: Petr Machata Reviewed-by: Benjamin Poirier --- tools/testing/selftests/net/forwarding/lib.sh

[PATCH net-next 02/10] selftests: forwarding: lib.sh: Validate NETIFS

2024-04-12 Thread Petr Machata
The variable should contain at least NUM_NETIFS interfaces, stored as keys named "p$i", for i in `seq $NUM_NETIFS`. Signed-off-by: Petr Machata Reviewed-by: Benjamin Poirier --- tools/testing/selftests/net/forwarding/lib.sh | 22 ++- 1 file changed, 17 insert

[PATCH net-next 01/10] selftests: net: Unify code of busywait() and slowwait()

2024-04-12 Thread Petr Machata
. Instead make the unit part of the name of the argument to further clarify what units are expected. Cc: Hangbin Liu Signed-off-by: Petr Machata Reviewed-by: Benjamin Poirier --- tools/testing/selftests/net/forwarding/lib.sh | 22 ++- tools/testing/selftests/net/lib.sh

[PATCH net-next 00/10] selftests: Assortment of fixes

2024-04-12 Thread Petr Machata
in selftests. - Patches #8 to #10 add topology diagrams to several selftests. This should have been part of the mlxsw leg of NH group stats patches, but again, it did not fit in due to size. Danielle Ratson (1): selftests: mlxsw: ethtool_lanes: Wait for lanes parameter dump explicitly Petr Machata

Re: [PATCH net-next v2 6/6] selftests: net: exercise page pool reporting via netlink

2024-04-12 Thread Petr Machata
:0 > > Signed-off-by: Jakub Kicinski LGTM Reviewed-by: Petr Machata

Re: [PATCH net-next 6/6] selftests: net: exercise page pool reporting via netlink

2024-04-12 Thread Petr Machata
Jakub Kicinski writes: > Add a Python test for the basic ops. > > # ./net/nl_netdev.py > KTAP version 1 > 1..3 > ok 1 nl_netdev.empty_check > ok 2 nl_netdev.lo_check > ok 3 nl_netdev.page_pool_check > # Totals: pass:3 fail:0 xfail:0 xpass:0 skip:0 error:0 > > Signed-off-by: Jakub

Re: [PATCH net-next 5/6] selftests: net: support use of NetdevSimDev under "with" in python

2024-04-12 Thread Petr Machata
Jakub Kicinski writes: > Using "with" on an entire driver test env is supported already, > but it's also useful to use "with" on an individual nsim. > > Signed-off-by: Jakub Kicinski Reviewed-by: Petr Machata

Re: [PATCH net-next 4/6] selftests: net: print full exception on failure

2024-04-12 Thread Petr Machata
Jakub Kicinski writes: > Instead of a summary line print the full exception. > This makes debugging Python tests much easier. > > Signed-off-by: Jakub Kicinski Reviewed-by: Petr Machata > @@ -85,7 +86,8 @@ KSFT_RESULT = None > totals['xfail'] += 1 >

Re: [PATCH net-next 3/6] selftests: net: print report check location in python tests

2024-04-12 Thread Petr Machata
tdev.py line 38: > # Check failed 0 != 10 > not ok 3 nl_netdev.page_pool_check > > Signed-off-by: Jakub Kicinski Reviewed-by: Petr Machata > +def _fail(*args): > +global KSFT_RESULT > +KSFT_RESULT = False > + > +frame = inspect.stack()[2] > +ks

Re: [PATCH net-next v2 6/7] selftests: drivers: add scaffolding for Netlink tests in Python

2024-04-04 Thread Petr Machata
he test against netdevsim. > > Signed-off-by: Jakub Kicinski Reviewed-by: Petr Machata However: > diff --git a/tools/testing/selftests/net/lib/py/nsim.py > b/tools/testing/selftests/net/lib/py/nsim.py > new file mode 100644 > index ..25ae0d081788 > --- /dev/

Re: [PATCH net-next v2 5/7] netdevsim: report stats by default, like a real device

2024-04-04 Thread Petr Machata
; Note that the tests which used pause always initialize the setting > so they shouldn't be affected by the different starting value. > > Signed-off-by: Jakub Kicinski Reviewed-by: Petr Machata Just: > @@ -330,6 +331,49 @@ static const struct net_device_ops nsim_vf_netdev_

Re: [PATCH net-next v2 4/7] selftests: nl_netdev: add a trivial Netlink netdev test

2024-04-04 Thread Petr Machata
f. > > Signed-off-by: Jakub Kicinski Reviewed-by: Petr Machata

Re: [PATCH net-next v2 3/7] selftests: net: add scaffolding for Netlink tests in Python

2024-04-04 Thread Petr Machata
specs. Do you expect everything that starts with s to be a testfile? > +TEST_FILES += ../../../../net/* Likewise this -- it's just tools/net/ynl? Will everything that's there be a testfile? > +TEST_INCLUDES := $(wildcard py/*.py) > + > +include ../../lib.mk Other than that it looks OK. Reviewed-by: Petr Machata

Re: [PATCH net-next v2 2/7] tools: ynl: copy netlink error to NlError

2024-04-04 Thread Petr Machata
Jakub Kicinski writes: > Typing e.nl_msg.error when processing exception is a bit tedious > and counter-intuitive. Set a local .error member to the positive > value of the netlink level error. > > Signed-off-by: Jakub Kicinski Reviewed-by: Petr Machata

Re: [PATCH net-next v2 1/7] netlink: specs: define ethtool header flags

2024-04-04 Thread Petr Machata
}}) > > Note that not all commands accept all the flags, > but the meaning of the bits does not change command > to command. > > Signed-off-by: Jakub Kicinski Reviewed-by: Petr Machata

Re: [PATCH net-next 7/7] testing: net-drv: add a driver test for stats reporting

2024-04-03 Thread Petr Machata
Jakub Kicinski writes: > On Wed, 3 Apr 2024 10:58:19 +0200 Petr Machata wrote: >> Also, it's not clear what "del thing" should do in that context, because >> if cfg also keeps a reference, __del__ won't get called. There could be >> a direct method, like thing.e

Re: [PATCH net-next 7/7] testing: net-drv: add a driver test for stats reporting

2024-04-03 Thread Petr Machata
Jakub Kicinski writes: > On Wed, 3 Apr 2024 00:04:14 +0200 Petr Machata wrote: >> > Yes, I was wondering about that. It must be doable, IIRC >> > the multi-threading API "injects" args from a tuple. >> > I was thinking something along the lines o

Re: [PATCH net-next 7/7] testing: net-drv: add a driver test for stats reporting

2024-04-02 Thread Petr Machata
Jakub Kicinski writes: > On Tue, 2 Apr 2024 18:37:44 +0200 Petr Machata wrote: >> Yeah, this would be usually done through context managers, as I mention >> in the other e-mail. But then cfg would be lexically scoped, which IMHO >> is a good thing, but then it need

Re: [PATCH net-next 7/7] testing: net-drv: add a driver test for stats reporting

2024-04-02 Thread Petr Machata
Jakub Kicinski writes: > On Tue, 2 Apr 2024 10:31:11 -0700 Jakub Kicinski wrote: >> Yes, I was wondering about that. It must be doable, IIRC >> the multi-threading API "injects" args from a tuple. >> I was thinking something along the lines of: >> >> with NetDrvEnv(__file__) as cfg: >>

Re: [PATCH net-next 3/7] selftests: net: add scaffolding for Netlink tests in Python

2024-04-02 Thread Petr Machata
Jakub Kicinski writes: > 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

Re: [PATCH net-next 7/7] testing: net-drv: add a driver test for stats reporting

2024-04-02 Thread Petr Machata
Jakub Kicinski writes: > Add a very simple test to make sure drivers report expected > stats. Drivers which implement FEC or pause configuration > should report relevant stats. Qstats must be reported, > at least packet and byte counts, and they must match > total device stats. > > Tested with

Re: [RFC PATCH net-next mlxsw 03/14] selftests: forwarding: README: Document customization

2024-03-26 Thread Petr Machata
Jakub Kicinski writes: > On Tue, 26 Mar 2024 11:31:31 +0100 Petr Machata wrote: >> Jakub Kicinski writes: >> >> > a standard feature of kselftest. If "env" file exists in the test >> > directory kselftest would load its contents before running eve

[PATCH net-next 14/14] selftests: forwarding: Add a test for testing lib.sh functionality

2024-03-26 Thread Petr Machata
that invalidates result of the selftest. Since the metatest only uses the bare basics (just pass/fail), hopefully such fundamental breakages would be noticed. Signed-off-by: Petr Machata --- .../testing/selftests/net/forwarding/Makefile | 1 + .../selftests/net/forwarding/lib_sh_test.sh | 208

[PATCH net-next 13/14] selftests: forwarding: router_mpath_nh_lib: Don't skip, xfail on veth

2024-03-26 Thread Petr Machata
-veth topology, they don't do anything. Use the helper in the HW-stats part of router_mpath_nh_lib selftest. Signed-off-by: Petr Machata --- tools/testing/selftests/net/forwarding/lib.sh | 14 ++ .../net/forwarding/router_mpath_nh_lib.sh | 12 +--- 2 files

[PATCH net-next 10/14] selftests: forwarding: Convert log_test() to recognize RET values

2024-03-26 Thread Petr Machata
() and log_test_xfail() can be reexpressed as thin wrappers around log_test. Signed-off-by: Petr Machata --- tools/testing/selftests/net/forwarding/lib.sh | 92 ++- tools/testing/selftests/net/lib.sh| 9 ++ 2 files changed, 77 insertions(+), 24 deletions(-) diff --git a/tools

[PATCH net-next 12/14] selftests: forwarding: Mark performance-sensitive tests

2024-03-26 Thread Petr Machata
When run on a slow machine, the scheduler traffic tests can be expected to fail, and should be reported as XFAIL in that case. Therefore run these tests through the perf_sensitive wrapper. Signed-off-by: Petr Machata --- .../selftests/net/forwarding/sch_ets_tests.sh | 19

[PATCH net-next 11/14] selftests: forwarding: Support for performance sensitive tests

2024-03-26 Thread Petr Machata
: xfail_on_slow tests_run ... or, on the other side of the granularity spectrum, to override individual checks: xfail_on_slow check_err $? "Expected much, got little." Signed-off-by: Petr Machata --- tools/testing/selftests/net/forwarding/lib.sh | 23 ++- 1 fi

[PATCH net-next 08/14] selftests: lib: Define more kselftest exit codes

2024-03-26 Thread Petr Machata
cases where devlink_lib is, the inclusion is not visible in the file itself, and relying on it would be confusing. Cc: Davide Caratti Signed-off-by: Petr Machata --- tools/testing/selftests/net/forwarding/tc_tunnel_key.sh | 2 -- tools/testing/selftests/net/lib.sh | 6 +- 2

[PATCH net-next 09/14] selftests: forwarding: Have RET track kselftest framework constants

2024-03-26 Thread Petr Machata
different, and we want to reuse the same logic. Use the new helper when setting RET in check_err(). Re-express check_fail() in terms of check_err() to avoid duplication. Signed-off-by: Petr Machata --- Notes: v1: - Clarify intended usage by s/set_ret/ret_set_ksft_status/, s/nret

[PATCH net-next 07/14] selftests: forwarding: Change inappropriate log_test_skip() calls

2024-03-26 Thread Petr Machata
. Note that it will be fixed using a more reusable way in a following patch. For the two resource_scale selftests, the log should simply not be written, because there is no problem. Cc: Tobias Waldekranz Signed-off-by: Petr Machata --- tools/testing/selftests/drivers/net/hw/ethtool_rmon.sh

[PATCH net-next 06/14] selftests: forwarding: Ditch skip_on_veth()

2024-03-26 Thread Petr Machata
Since the selftests that are not supposed to run on veth pairs are now in their own dedicated directory, the skip_on_veth logic can go away. Drop it from the selftests, and from lib.sh. Cc: Danielle Ratson Signed-off-by: Petr Machata --- .../testing/selftests/drivers/net/hw/ethtool.sh | 2

[PATCH net-next 05/14] selftests: forwarding: Move several selftests

2024-03-26 Thread Petr Machata
Waldekranz Cc: Danielle Ratson Cc: Davide Caratti Cc: Johannes Nixdorf Suggested-by: Jakub Kicinski Signed-off-by: Petr Machata --- .../testing/selftests/drivers/net/hw/Makefile | 25 +++ .../net/hw}/devlink_port_split.py | 0 .../forwarding => drivers/net

[PATCH net-next 04/14] selftests: forwarding: ipip_lib: Do not import lib.sh

2024-03-26 Thread Petr Machata
This library is always sourced in the context where lib.sh has already been sourced as well. Therefore drop the explicit sourcing and expect the client to already have done it. This will simplify moving some of the clients to a different directory. Signed-off-by: Petr Machata --- tools/testing

[PATCH net-next 03/14] selftests: forwarding: README: Document customization

2024-03-26 Thread Petr Machata
That any sort of customization is possible at all, let alone how it should be done, is currently not at all clear. Document the whats and hows in README. Signed-off-by: Petr Machata Reviewed-by: Benjamin Poirier --- tools/testing/selftests/net/forwarding/README | 33 +++ 1 file

[PATCH net-next 02/14] selftests: forwarding.config.sample: Move overrides to lib.sh

2024-03-26 Thread Petr Machata
-by: Petr Machata Reviewed-by: Benjamin Poirier --- .../net/forwarding/forwarding.config.sample | 53 -- tools/testing/selftests/net/forwarding/lib.sh | 69 --- 2 files changed, 74 insertions(+), 48 deletions(-) diff --git a/tools/testing/selftests/net/forwarding

[PATCH net-next 01/14] selftests: net: libs: Change variable fallback syntax

2024-03-26 Thread Petr Machata
once more is meaningless. So avoid the outer X=... bit, and instead express the same idea though the do-nothing ":" built-in as : "${X:=Y}". This also cleans up the block nicely and makes it more readable. Signed-off-by: Petr Machata Reviewed-by: Benjamin Poirier --- tools/te

[PATCH net-next 00/14] selftests: Fixes for kernel CI

2024-03-26 Thread Petr Machata
selftest that checks this functionality in lib.sh. v1 (vs. an RFC circulated through linux-kselftest): - Patch #9: - Clarify intended usage by s/set_ret/ret_set_ksft_status/, s/nret/ksft_status/ Petr Machata (14): selftests: net: libs: Change variable fallback syntax selftests: forw

Re: [RFC PATCH net-next mlxsw 03/14] selftests: forwarding: README: Document customization

2024-03-26 Thread Petr Machata
Jakub Kicinski writes: > On Mon, 25 Mar 2024 18:29:10 +0100 Petr Machata wrote: >> +The forwarding selftests framework uses a number of variables that >> +influence its behavior and tools it invokes, and how it invokes them, in >> +various ways. A number of these variab

Re: [RFC PATCH net-next mlxsw 09/14] selftests: forwarding: Have RET track kselftest framework constants

2024-03-26 Thread Petr Machata
Jakub Kicinski writes: > On Mon, 25 Mar 2024 18:29:16 +0100 Petr Machata wrote: >> +set_ret() >> +{ >> +local nret=$1; shift > > May be worth throwing in a comment that $1 must be a legal ksft ret > code, not any exit code from random com

Re: [RFC PATCH net-next mlxsw 00/14] selftests: Fixes for kernel CI

2024-03-26 Thread Petr Machata
Jakub Kicinski writes: > On Mon, 25 Mar 2024 18:29:07 +0100 Petr Machata wrote: >> As discussed on the bi-weekly call on Jan 30, and in mailing around >> kernel CI effort, some changes are desirable in the suite of forwarding >> selftests the better to work with the CI to

[RFC PATCH net-next mlxsw 10/14] selftests: forwarding: Convert log_test() to recognize RET values

2024-03-25 Thread Petr Machata
() and log_test_xfail() can be reexpressed as thin wrappers around log_test. Signed-off-by: Petr Machata --- tools/testing/selftests/net/forwarding/lib.sh | 92 ++- tools/testing/selftests/net/lib.sh| 9 ++ 2 files changed, 77 insertions(+), 24 deletions(-) diff --git a/tools

[RFC PATCH net-next mlxsw 14/14] selftests: forwarding: Add a test for testing lib.sh functionality

2024-03-25 Thread Petr Machata
that invalidates result of the selftest. Since the metatest only uses the bare basics (just pass/fail), hopefully such fundamental breakages would be noticed. Signed-off-by: Petr Machata --- .../testing/selftests/net/forwarding/Makefile | 1 + .../selftests/net/forwarding/lib_sh_test.sh | 208

[RFC PATCH net-next mlxsw 11/14] selftests: forwarding: Support for performance sensitive tests

2024-03-25 Thread Petr Machata
: xfail_on_slow tests_run ... or, on the other side of the granularity spectrum, to override individual checks: xfail_on_slow check_err $? "Expected much, got little." Signed-off-by: Petr Machata --- tools/testing/selftests/net/forwarding/lib.sh | 23 ++- 1 fi

[RFC PATCH net-next mlxsw 13/14] selftests: forwarding: router_mpath_nh_lib: Don't skip, xfail on veth

2024-03-25 Thread Petr Machata
-veth topology, they don't do anything. Use the helper in the HW-stats part of router_mpath_nh_lib selftest. Signed-off-by: Petr Machata --- tools/testing/selftests/net/forwarding/lib.sh | 14 ++ .../net/forwarding/router_mpath_nh_lib.sh | 12 +--- 2 files

[RFC PATCH net-next mlxsw 12/14] selftests: forwarding: Mark performance-sensitive tests

2024-03-25 Thread Petr Machata
When run on a slow machine, the scheduler traffic tests can be expected to fail, and should be reported as XFAIL in that case. Therefore run these tests through the perf_sensitive wrapper. Signed-off-by: Petr Machata --- .../selftests/net/forwarding/sch_ets_tests.sh | 19

[RFC PATCH net-next mlxsw 05/14] selftests: forwarding: Move several selftests

2024-03-25 Thread Petr Machata
Waldekranz Cc: Danielle Ratson Cc: Davide Caratti Cc: Johannes Nixdorf Suggested-by: Jakub Kicinski Signed-off-by: Petr Machata --- .../testing/selftests/drivers/net/hw/Makefile | 25 +++ .../net/hw}/devlink_port_split.py | 0 .../forwarding => drivers/net

[RFC PATCH net-next mlxsw 06/14] selftests: forwarding: Ditch skip_on_veth()

2024-03-25 Thread Petr Machata
Since the selftests that are not supposed to run on veth pairs are now in their own dedicated directory, the skip_on_veth logic can go away. Drop it from the selftests, and from lib.sh. Cc: Danielle Ratson Signed-off-by: Petr Machata --- .../testing/selftests/drivers/net/hw/ethtool.sh | 2

[RFC PATCH net-next mlxsw 07/14] selftests: forwarding: Change inappropriate log_test_skip() calls

2024-03-25 Thread Petr Machata
. Note that it will be fixed using a more reusable way in a following patch. For the two resource_scale selftests, the log should simply not be written, because there is no problem. Cc: Tobias Waldekranz Signed-off-by: Petr Machata --- tools/testing/selftests/drivers/net/hw/ethtool_rmon.sh

[RFC PATCH net-next mlxsw 09/14] selftests: forwarding: Have RET track kselftest framework constants

2024-03-25 Thread Petr Machata
different, and we want to reuse the same logic. Use the new helper when setting RET in check_err(). Re-express check_fail() in terms of check_err() to avoid duplication. Signed-off-by: Petr Machata --- tools/testing/selftests/net/forwarding/lib.sh | 21 - tools/testing/selftests/net/lib.sh

[RFC PATCH net-next mlxsw 08/14] selftests: lib: Define more kselftest exit codes

2024-03-25 Thread Petr Machata
cases where devlink_lib is, the inclusion is not visible in the file itself, and relying on it would be confusing. Cc: Davide Caratti Signed-off-by: Petr Machata --- tools/testing/selftests/net/forwarding/tc_tunnel_key.sh | 2 -- tools/testing/selftests/net/lib.sh | 6 +- 2

[RFC PATCH net-next mlxsw 04/14] selftests: forwarding: ipip_lib: Do not import lib.sh

2024-03-25 Thread Petr Machata
This library is always sourced in the context where lib.sh has already been sourced as well. Therefore drop the explicit sourcing and expect the client to already have done it. This will simplify moving some of the clients to a different directory. Signed-off-by: Petr Machata --- tools/testing

[RFC PATCH net-next mlxsw 03/14] selftests: forwarding: README: Document customization

2024-03-25 Thread Petr Machata
That any sort of customization is possible at all, let alone how it should be done, is currently not at all clear. Document the whats and hows in README. Signed-off-by: Petr Machata Reviewed-by: Benjamin Poirier --- tools/testing/selftests/net/forwarding/README | 33 +++ 1 file

[RFC PATCH net-next mlxsw 00/14] selftests: Fixes for kernel CI

2024-03-25 Thread Petr Machata
selftest that checks this functionality in lib.sh. Petr Machata (14): selftests: net: libs: Change variable fallback syntax selftests: forwarding.config.sample: Move overrides to lib.sh selftests: forwarding: README: Document customization selftests: forwarding: ipip_lib: Do not impor

[RFC PATCH net-next mlxsw 01/14] selftests: net: libs: Change variable fallback syntax

2024-03-25 Thread Petr Machata
once more is meaningless. So avoid the outer X=... bit, and instead express the same idea though the do-nothing ":" built-in as : "${X:=Y}". This also cleans up the block nicely and makes it more readable. Signed-off-by: Petr Machata Reviewed-by: Benjamin Poirier --- tools/te

[RFC PATCH net-next mlxsw 02/14] selftests: forwarding.config.sample: Move overrides to lib.sh

2024-03-25 Thread Petr Machata
-by: Petr Machata Reviewed-by: Benjamin Poirier --- .../net/forwarding/forwarding.config.sample | 53 -- tools/testing/selftests/net/forwarding/lib.sh | 69 --- 2 files changed, 74 insertions(+), 48 deletions(-) diff --git a/tools/testing/selftests/net/forwarding

Re: [ANN] net-next is OPEN

2024-01-25 Thread Petr Machata
Jakub Kicinski writes: > On Tue, 23 Jan 2024 18:04:19 +0100 Petr Machata wrote: >> > Unless I'm doing it wrong and the sub-directories are supposed to >> > inherit the parent directory's config? So net/forwarding/ should >> > be built with net/'s config? I c

Re: [ANN] net-next is OPEN

2024-01-23 Thread Petr Machata
Jakub Kicinski writes: > On Tue, 23 Jan 2024 10:55:09 +0100 Petr Machata wrote: >> > If you authored any net or drivers/net selftests, please look around >> > and see if they are passing. If not - send patches or LMK what I need >> > to do to make them pass on th

[PATCH net 6/6] selftests: mlxsw: qos_pfc: Adjust the test to support 8 lanes

2024-01-17 Thread Petr Machata
a PFC test") Signed-off-by: Amit Cohen Reviewed-by: Ido Schimmel Signed-off-by: Petr Machata --- .../selftests/drivers/net/mlxsw/qos_pfc.sh | 18 +- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/drivers/net/mlxsw/qos_pfc.sh b/too

[PATCH net 5/6] selftests: mlxsw: qos_pfc: Remove wrong description

2024-01-17 Thread Petr Machata
f-by: Amit Cohen Reviewed-by: Ido Schimmel Signed-off-by: Petr Machata --- tools/testing/selftests/drivers/net/mlxsw/qos_pfc.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/testing/selftests/drivers/net/mlxsw/qos_pfc.sh b/tools/testing/selftests/drivers/net/mlxsw/qos_pfc.sh index 42

Re: [PATCHv3 net-next 01/14] selftests/net: add lib.sh

2023-12-07 Thread Petr Machata
Paolo Abeni writes: > On Wed, 2023-12-06 at 13:32 +0100, Petr Machata wrote: >> Paolo Abeni writes: >> >> > Side note for a possible follow-up: if you maintain $ns_list as global >> > variable, and remove from such list the ns deleted by cleanup_ns, you &

Re: [PATCHv3 net-next 01/14] selftests/net: add lib.sh

2023-12-06 Thread Petr Machata
Paolo Abeni writes: > Side note for a possible follow-up: if you maintain $ns_list as global > variable, and remove from such list the ns deleted by cleanup_ns, you > could remove the cleanup trap from the individual test with something > alike: > > final_cleanup_ns() > { > cleanup_ns

Re: [PATCHv2 net-next 01/14] selftests/net: add lib.sh

2023-11-30 Thread Petr Machata
ique namespaces with given > prefix name. > > Signed-off-by: Hangbin Liu LGTM. I took it for a spin with a couple tests that we use for mlxsw, mainly to make sure the "source ../lib.sh" bit works when invoking tests from other directories. All seems fine. Reviewed-by: Petr Machata

Re: [PATCH net-next 01/38] selftests/net: add lib.sh

2023-11-27 Thread Petr Machata
Hangbin Liu writes: > On Fri, Nov 24, 2023 at 03:35:51PM +0100, Petr Machata wrote: >> >> Hangbin Liu writes: >> >> > + fi >> > + done >> > + >> > + [ $errexit -eq 1 ] && set -e >> > + return 0 >> &g

Re: [PATCH net-next 01/38] selftests/net: add lib.sh

2023-11-27 Thread Petr Machata
Hangbin Liu writes: > On Fri, Nov 24, 2023 at 03:05:18PM +0100, Petr Machata wrote: >> >> Hangbin Liu writes: >> >> > +# Helpers >> > +busywait() >> > +{ >> > + local timeout=$1; shift >> > + >> > + local start_t

Re: [PATCH net-next 01/38] selftests/net: add lib.sh

2023-11-24 Thread Petr Machata
Petr Machata writes: > Hangbin Liu writes: > >> +# By default, remove all netns before EXIT. >> +cleanup_all_ns() >> +{ >> +cleanup_ns $NS_LIST >> +} >> +trap cleanup_all_ns EXIT > > Hmm, OK, this is a showstopper for inclusion from

Re: [PATCH net-next 01/38] selftests/net: add lib.sh

2023-11-24 Thread Petr Machata
Hangbin Liu writes: > +cleanup_ns() > +{ > + local ns="" > + local errexit=0 > + > + # disable errexit temporary > + if [[ $- =~ "e" ]]; then > + errexit=1 > + set +e > + fi > + > + for ns in "$@"; do > + ip netns delete "${ns}" &>

Re: [PATCH net-next 01/38] selftests/net: add lib.sh

2023-11-24 Thread Petr Machata
Hangbin Liu writes: > Add a lib.sh for net selftests. This file can be used to define commonly > used variables and functions. > > Add function setup_ns() for user to create unique namespaces with given > prefix name. > > Signed-off-by: Hangbin Liu > --- >