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 > --- >

Re: [Bridge] [PATCH iproute2-next v5] iplink: bridge: Add support for bridge FDB learning limits

2023-10-19 Thread Petr Machata via Bridge
; } > }, > ... > } ] > # ip link set br0 type bridge fdb_max_learned 1024 > # ip -d -j -p link show br0 > [ { > ... > "linkinfo": { > "info_kind": "bridge", > "info_data": { > ... > "fdb_n_learned": 2, > "fdb_max_learned": 1024, > ... > } > }, > ... > } ] > > Signed-off-by: Johannes Nixdorf Reviewed-by: Petr Machata

Re: [Bridge] [PATCH iproute2-next v3] iplink: bridge: Add support for bridge FDB learning limits

2023-09-06 Thread Petr Machata via Bridge
(I pruned the CC list, hopefully I didn't leave out anybody who cares.) Johannes Nixdorf via Bridge writes: > Support setting the FDB limit through ip link. The arguments is: > - fdb_max_learned_entries: A 32-bit unsigned integer specifying the > maximum number of

[Bridge] [PATCH net-next 02/17] net: switchdev: Add a helper to replay objects on a bridge port

2023-07-19 Thread Petr Machata via Bridge
, switchdev_bridge_port_replay(), which does only the replay part of the _offload() function in exactly the same way as that function. Cc: Jiri Pirko Cc: Ivan Vecera Cc: Roopa Prabhu Cc: Nikolay Aleksandrov Cc: bridge@lists.linux-foundation.org Signed-off-by: Petr Machata Reviewed-by: Danielle

[Bridge] [PATCH net-next 01/17] net: bridge: br_switchdev: Tolerate -EOPNOTSUPP when replaying MDB

2023-07-19 Thread Petr Machata via Bridge
Aleksandrov Cc: bridge@lists.linux-foundation.org Signed-off-by: Petr Machata Reviewed-by: Danielle Ratson --- net/bridge/br_switchdev.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/net/bridge/br_switchdev.c b/net/bridge/br_switchdev.c index ba95c4d74a60..e92e0338afee

Re: [Bridge] llc needs namespace awareness asap, was Re: Patch fixing STP if bridge in non-default namespace.

2023-07-12 Thread Petr Machata via Bridge
(CC'ing bridge maintainers.) Kuniyuki Iwashima writes: > From: Harry Coin > Date: Tue, 11 Jul 2023 16:40:03 -0500 >> On 7/11/23 15:44, Andrew Lunn wrote: >> >> The current llc_rcv.c around line 166 in net/llc/llc_input.c has >> >> >> >>if (!net_eq(dev_net(dev), _net))

[Bridge] [PATCH net-next v3 15/16] selftests: forwarding: lib: Add helpers to build IGMP/MLD leave packets

2023-02-02 Thread Petr Machata via Bridge
The testsuite that checks for mcast_max_groups functionality will need to wipe the added groups as well. Add helpers to build an IGMP or MLD packets announcing that host is leaving a given group. Signed-off-by: Petr Machata Acked-by: Nikolay Aleksandrov --- tools/testing/selftests/net

[Bridge] [PATCH net-next v3 16/16] selftests: forwarding: bridge_mdb_max: Add a new selftest

2023-02-02 Thread Petr Machata via Bridge
Add a suite covering mcast_n_groups and mcast_max_groups bridge features. Signed-off-by: Petr Machata --- Notes: v2: - Adjust the tests that check setting max below n and reset of max on VLAN snooping enablement - Make test naming uniform - Enable testing of control path

[Bridge] [PATCH net-next v3 13/16] selftests: forwarding: lib: Parameterize IGMPv3/MLDv2 generation

2023-02-02 Thread Petr Machata
the necessary parameters, and generate the payload accordingly by dispatching to helpers added in the previous patches. Adjust the sole client, bridge_mdb.sh, as well. Signed-off-by: Petr Machata Acked-by: Nikolay Aleksandrov --- .../selftests/net/forwarding/bridge_mdb.sh| 9 ++--- tools

[Bridge] [PATCH net-next v3 10/16] selftests: forwarding: bridge_mdb: Fix a typo

2023-02-02 Thread Petr Machata via Bridge
Add the letter missing from the word "INCLUDE". Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel Acked-by: Nikolay Aleksandrov --- tools/testing/selftests/net/forwarding/bridge_mdb.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/sel

[Bridge] [PATCH net-next v3 14/16] selftests: forwarding: lib: Allow list of IPs for IGMPv3/MLDv2

2023-02-02 Thread Petr Machata via Bridge
The testsuite that checks for mcast_max_groups functionality will need to generate IGMP and MLD packets with configurable number of (S,G) addresses. To that end, further extend igmpv3_is_in_get() and mldv2_is_in_get() to allow a list of IP addresses instead of one address. Signed-off-by: Petr

[Bridge] [PATCH net-next v3 09/16] selftests: forwarding: Move IGMP- and MLD-related functions to lib

2023-02-02 Thread Petr Machata
These functions will be helpful for other testsuites as well. Extract them to a common place. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel Acked-by: Nikolay Aleksandrov --- .../selftests/net/forwarding/bridge_mdb.sh| 49 --- tools/testing/selftests/net/forwarding

[Bridge] [PATCH net-next v3 12/16] selftests: forwarding: lib: Add helpers for checksum handling

2023-02-02 Thread Petr Machata
the checksum, this needs to be expanded in mausezahn format. And likewise for number of addresses for (S,G) entries. Thus we have several places where a computed quantity needs to be presented in the payload format. Add a helper u16_to_bytes(), which will be used in all these cases. Signed-off-by: Petr

[Bridge] [PATCH net-next v3 11/16] selftests: forwarding: lib: Add helpers for IP address handling

2023-02-02 Thread Petr Machata
In order to generate IGMPv3 and MLDv2 packets on the fly, we will need helpers to expand IPv4 and IPv6 addresses given as parameters in mausezahn payload notation. Add helpers that do it. Signed-off-by: Petr Machata Acked-by: Nikolay Aleksandrov --- tools/testing/selftests/net/forwarding

[Bridge] [PATCH net-next v3 08/16] net: bridge: Add netlink knobs for number / maximum MDB entries

2023-02-02 Thread Petr Machata via Bridge
mcast_max_groups 1 2 [...] mcast_n_groups 0 mcast_max_groups 0 Signed-off-by: Petr Machata --- Notes: v3: - Move the br_multicast_port_ctx_vlan_disabled() check out to the _vlan_ helpers callers. Thus these helpers cannot fail, which makes them very

[Bridge] [PATCH net-next v3 06/16] net: bridge: Add a tracepoint for MDB overflows

2023-02-02 Thread Petr Machata via Bridge
f 10 src 2001:db8:1::1 grp ff0e::1/00:00:00:00:00:00 vid 10 dev v2 af 2 src :::192.0.2.1 grp :::239.1.1.1/00:00:00:00:00:00 vid 10 CC: Steven Rostedt CC: linux-trace-ker...@vger.kernel.org Signed-off-by: Petr Machata Reviewed-by: Steven Rostedt (Google) --- Notes:

[Bridge] [PATCH net-next v3 07/16] net: bridge: Maintain number of MDB entries in net_bridge_mcast_port

2023-02-02 Thread Petr Machata
. The next patch introduces the netlink APIs to toggle and read the values. Signed-off-by: Petr Machata --- Notes: v3: - Access mdb_max_/_n_entries through READ_/WRITE_ONCE - Move extack setting to br_multicast_port_ngroups_inc_one(). Since we use NL_SET_ERR_MSG_FMT_MOD, the correct

[Bridge] [PATCH net-next v3 04/16] net: bridge: Add br_multicast_del_port_group()

2023-02-02 Thread Petr Machata via Bridge
, and that counter will have to be updated. Because that logic is going to be hidden in the br_multicast module, introduce a new hook intended to again remove a newly-created group. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel Acked-by: Nikolay Aleksandrov --- net/bridge/br_mdb.c | 3

[Bridge] [PATCH net-next v3 02/16] net: bridge: Add extack to br_multicast_new_port_group()

2023-02-02 Thread Petr Machata via Bridge
Make it possible to set an extack in br_multicast_new_port_group(). Eventually, this function will check for per-port and per-port-vlan MDB maximums, and will use the extack to communicate the reason for the bounce. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel Acked-by: Nikolay

[Bridge] [PATCH net-next v3 05/16] net: bridge: Change a cleanup in br_multicast_new_port_group() to goto

2023-02-02 Thread Petr Machata
This function is getting more to clean up in the following patches. Structuring the cleanups in one labeled block will allow reusing the same cleanup from several places. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel Acked-by: Nikolay Aleksandrov --- net/bridge/br_multicast.c | 7

[Bridge] [PATCH net-next v3 03/16] net: bridge: Move extack-setting to br_multicast_new_port_group()

2023-02-02 Thread Petr Machata via Bridge
set the extack, and if it didn't, set it. But that is only done when the callee is not exactly known. (E.g. in case of a notifier invocation.) Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel Acked-by: Nikolay Aleksandrov --- net/bridge/br_mdb.c | 9 +++-- net/bridge

[Bridge] [PATCH net-next v3 01/16] net: bridge: Set strict_start_type at two policies

2023-02-02 Thread Petr Machata via Bridge
-NULL policies. Suggested-by: Ido Schimmel Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel Acked-by: Nikolay Aleksandrov --- net/bridge/br_netlink.c| 2 ++ net/bridge/br_netlink_tunnel.c | 3 +++ 2 files changed, 5 insertions(+) diff --git a/net/bridge/br_netlink.c b/net/bridge

[Bridge] [PATCH net-next v3 00/16] bridge: Limit number of MDB entries per port, port-vlan

2023-02-02 Thread Petr Machata via Bridge
The MDB maintained by the bridge is limited. When the bridge is configured for IGMP / MLD snooping, a buggy or malicious client can easily exhaust its capacity. In SW datapath, the capacity is configurable through the IFLA_BR_MCAST_HASH_MAX parameter, but ultimately is finite. Obviously a similar

Re: [Bridge] [PATCH net-next mlxsw v2 08/16] net: bridge: Add netlink knobs for number / maximum MDB entries

2023-02-02 Thread Petr Machata via Bridge
Nikolay Aleksandrov writes: > On 02/02/2023 10:52, Nikolay Aleksandrov wrote: >> On 01/02/2023 19:28, Petr Machata wrote: >>> +int br_multicast_vlan_ngroups_set_max(struct net_bridge *br, >>> + struct

Re: [Bridge] [PATCH net-next mlxsw v2 07/16] net: bridge: Maintain number of MDB entries in net_bridge_mcast_port

2023-02-02 Thread Petr Machata via Bridge
Nikolay Aleksandrov writes: > On 01/02/2023 19:28, Petr Machata wrote: >> @@ -668,6 +692,82 @@ void br_multicast_del_group_src(struct >> net_bridge_group_src *src, >> __br_multicast_del_group_src(src); >> } >> >> +static int >&

Re: [Bridge] [PATCH net-next mlxsw v2 00/16] bridge: Limit number of MDB entries per port, port-vlan

2023-02-02 Thread Petr Machata via Bridge
Jakub Kicinski writes: > On Wed, 1 Feb 2023 18:28:33 +0100 Petr Machata wrote: >> Subject: [PATCH net-next mlxsw v2 00/16] bridge: Limit number of MDB entries >> per port, port-vlan > > What do you mean by "net-next mlxsw"? > Is there a tree called "

  1   2   3   4   5   6   7   8   9   10   >