linux/tools
Petr Machata b8bfafe434 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>
2021-10-25 14:10:11 +01:00
..
accounting
arch A set of fixes for X86: 2021-09-26 10:09:20 -07:00
bootconfig tools/bootconfig: Define memblock_free_ptr() to fix build error 2021-09-15 09:49:48 -07:00
bpf bpftool: Avoid using "?: " in generated code 2021-09-28 15:19:22 -07:00
build perf cs-etm: Update OpenCSD decoder for ETE 2021-09-03 08:16:00 -03:00
cgroup
debugging
edid
firewire
firmware
gpio
hv
iio
include Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-10-07 15:24:06 -07:00
io_uring
kvm/kvm_stat KVM: kvm_stat: do not show halt_wait_ns 2021-10-18 14:07:18 -04:00
laptop
leds
lib Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-10-22 11:41:16 +01:00
memory-model
objtool objtool: Update section header before relocations 2021-10-06 20:11:57 -07:00
pci
pcmcia
perf perf report: Output non-zero offset for decompressed records 2021-10-14 15:41:35 -03:00
power
rcu
scripts
spi
testing selftests: mlxsw: Add helpers for skipping selftests 2021-10-25 14:10:11 +01:00
thermal/tmon
time
tracing
usb usb: testusb: Fix for showing the connection speed 2021-09-14 10:31:41 +02:00
virtio
vm tools/vm/page-types: remove dependency on opt_file for idle page tracking 2021-09-24 16:13:35 -07:00
wmi
Makefile