OSDN Git Service

selftests: mlxsw: Use shapers in QOS tests instead of forcing speed
authorAmit Cohen <amcohen@nvidia.com>
Wed, 14 Sep 2022 11:21:48 +0000 (13:21 +0200)
committerJakub Kicinski <kuba@kernel.org>
Tue, 20 Sep 2022 01:07:59 +0000 (18:07 -0700)
commit9e7aaa7c65f170039501c4d4b24d99640e2d519a
treef09a3a7a6a164e27dddecd899d12d868ad812993
parent2dc81a0e7658d986c4d7acce6ac2d1060ff424b7
selftests: mlxsw: Use shapers in QOS 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 QOS 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.

In tests that already use shapers, set the existing shaper to be a child of
a new TBF shaper which is added as a root qdisc and acts as a port shaper.

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/qos_ets_strict.sh
tools/testing/selftests/drivers/net/mlxsw/qos_mc_aware.sh
tools/testing/selftests/drivers/net/mlxsw/sch_ets.sh