mlxsw: spectrum_cnt: Reorder counter pools
authorPetr Machata <petrm@nvidia.com>
Mon, 13 Jun 2022 12:50:17 +0000 (15:50 +0300)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 14 Jun 2022 14:00:37 +0000 (16:00 +0200)
commita2dddc154bcadd9c93a97a79136cefe2822fb6eb
tree3ff07d8016d694d4017b0640e1942b8525acdc35
parent354b060cb53ea3b5793c08393a79c8de323581cc
mlxsw: spectrum_cnt: Reorder counter pools

Both RIF and ACL flow counters use a 24-bit SW-managed counter address to
communicate which counter they want to bind.

In a number of Spectrum FW releases, binding a RIF counter is broken and
slices the counter index to 16 bits. As a result, on Spectrum-2 and above,
no more than about 410 RIF counters can be effectively used. This
translates to 205 netdevices for which L3 HW stats can be enabled. (This
does not happen on Spectrum-1, because there are fewer counters available
overall and the counter index never exceeds 16 bits.)

Binding counters to ACLs does not have this issue. Therefore reorder the
counter allocation scheme so that RIF counters come first and therefore get
lower indices that are below the 16-bit barrier.

Fixes: ab2080ba6ef0 ("Merge branch 'mlxsw-Introduce-initial-Spectrum-2-support'")
Reported-by: Maksym Yaremchuk <maksymy@nvidia.com>
Signed-off-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Link: https://lore.kernel.org/r/20220613125017.2018162-1-idosch@nvidia.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/mellanox/mlxsw/spectrum_cnt.h