History log of /linux-master/tools/testing/selftests/drivers/net/mlxsw/tc_restrictions.sh
Revision Date Author Comments
# b8bfafe4 24-Oct-2021 Petr Machata <petrm@nvidia.com>

selftests: mlxsw: Add helpers for skipping selftests

A number of mlxsw-specific selftests currently detect whether they are run
on a compatible machine, and bail out silently when not. These tests are
however done in a somewhat impenetrable manner by directly comparing PCI
IDs against a blacklist or a whitelist, and bailing out silently if the
machine is not compatible.

Instead, add a helper, mlxsw_only_on_spectrum(), which allows specifying
the supported machines in a human-readable manner. If the current machine
is incompatible, the helper emits a SKIP message and returns an error code,
based on which the caller can gracefully bail out in a suitable way. This
allows a more readable conditions such as:

mlxsw_only_on_spectrum 2+ || return

Convert all existing open-coded guards to the new helper. Also add two new
guards to do_mark_test() and do_drop_test(), which are supported only on
Spectrum-2+, but the corresponding check was not there.

Signed-off-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# c3572a0b 29-Mar-2021 Ido Schimmel <idosch@nvidia.com>

selftests: mlxsw: Test matchall failure with protocol match

The driver can only offload matchall rules that do not match on a
protocol. Test that matchall rules that match on a protocol are vetoed.

Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 0f967d9e 16-Mar-2021 Ido Schimmel <idosch@nvidia.com>

selftests: mlxsw: Test egress sampling limitation on Spectrum-1 only

Make sure egress sampling configuration only fails on Spectrum-1, given
that mlxsw now supports it on Spectrum-{2,3}.

Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# cb12d176 15-Jul-2020 Ido Schimmel <idosch@mellanox.com>

selftests: mlxsw: tc_restrictions: Test tc-police restrictions

Test that upper and lower limits on rate and burst size imposed by the
device are rejected by the kernel.

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Reviewed-by: Petr Machata <petrm@mellanox.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>


# aa743112 09-May-2020 Jiri Pirko <jiri@mellanox.com>

selftests: mlxsw: tc_restrictions: add couple of test for the correct matchall-flower ordering

Make sure that the drive restricts incorrect order of inserted matchall
vs. flower rules.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>


# 240fe734 09-May-2020 Jiri Pirko <jiri@mellanox.com>

selftests: mlxsw: tc_restrictions: add test to check sample action restrictions

Check that matchall rules with sample actions are not possible to be
inserted to egress.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>


# b886dea3 09-May-2020 Jiri Pirko <jiri@mellanox.com>

selftests: mlxsw: rename tc_flower_restrictions.sh to tc_restrictions.sh

The file is about to contain matchall restrictions too, so change the
name to make it more generic.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>