selftests: mlxsw: Add a RIF counter scale test
authorPetr Machata <petrm@nvidia.com>
Thu, 16 Jun 2022 10:42:44 +0000 (13:42 +0300)
committerDavid S. Miller <davem@davemloft.net>
Fri, 17 Jun 2022 09:31:33 +0000 (10:31 +0100)
commitbe00853bfd2e704893916bc349e7ab1d50615cb4
tree3b0796c444bbb80b06a1e1610511e4aa4623dcf6
parentdd5d20e17c960dc5c8b8c585dfae79cf39660867
selftests: mlxsw: Add a RIF counter scale test

This tests creates as many RIFs as possible, ideally more than there can be
RIF counters (though that is currently only possible on Spectrum-1). It
then tries to enable L3 HW stats on each of the RIFs. It also contains the
traffic test, which tries to run traffic through a log2 of those counters
and checks that the traffic is shown in the counter values.

Like with tc_flower traffic test, take a log2 subset of rules. The logic
behind picking log2 rules is that then every bit of the instantiated item's
number is exercised. This should catch issues whether they happen at the
high end, low end, or somewhere in between.

Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Amit Cohen <amcohen@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
tools/testing/selftests/drivers/net/mlxsw/rif_counter_scale.sh [new file with mode: 0644]
tools/testing/selftests/drivers/net/mlxsw/spectrum-2/resource_scale.sh
tools/testing/selftests/drivers/net/mlxsw/spectrum-2/rif_counter_scale.sh [new symlink]
tools/testing/selftests/drivers/net/mlxsw/spectrum/resource_scale.sh
tools/testing/selftests/drivers/net/mlxsw/spectrum/rif_counter_scale.sh [new file with mode: 0644]