]> git.baikalelectronics.ru Git - kernel.git/commit
selftests: mlxsw: Use shapers in QOS RED tests instead of forcing speed
authorAmit Cohen <amcohen@nvidia.com>
Wed, 14 Sep 2022 11:21:49 +0000 (13:21 +0200)
committerJakub Kicinski <kuba@kernel.org>
Tue, 20 Sep 2022 01:07:59 +0000 (18:07 -0700)
commit30bb87213ef60a5fb98740a7860ea7b1e2870708
tree9fe1112d9e1bf7a6e6096780347e5bd88a97555b
parent75e6b1de5dfd8d00d54b0db8fc67b50841043490
selftests: mlxsw: Use shapers in QOS RED tests instead of forcing speed

QOS tests create congestion and verify the switch behavior. To create
congestion, they need to have more traffic than the port can handle, so
some of them force 1Gbps speed.

The tests assume that 1Gbps speed is supported, otherwise, they will fail.
Spectrum-4 ASIC will not support this speed in all ports, so to be able
to run the tests there, some adjustments are required. Use shapers to limit
the traffic instead of forcing speed. Note that for several ports, the
speed configuration is just for autoneg issues, so shaper is not needed
instead.

The tests already use ETS qdisc as a root and RED qdiscs as children. Add
a new TBF shaper to limit the rate of traffic, and use it as a root qdisc,
then save the previous hierarchy of qdiscs under the new TBF root.

In some ASICs, the shapers do not limit the traffic as accurately as
forcing speed. To make the tests stable, allow the backlog size to be up to
+-10% of the threshold. The aim of the tests is to make sure that with
backlog << threshold, there are no drops, and that packets are dropped
somewhere in vicinity of the configured threshold.

Signed-off-by: Amit Cohen <amcohen@nvidia.com>
Reviewed-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/drivers/net/mlxsw/sch_red_core.sh
tools/testing/selftests/drivers/net/mlxsw/sch_red_ets.sh
tools/testing/selftests/drivers/net/mlxsw/sch_red_root.sh