mlxsw: spectrum_router: Share nexthop counters in resilient groups
authorPetr Machata <petrm@nvidia.com>
Fri, 8 Mar 2024 12:59:54 +0000 (13:59 +0100)
committerJakub Kicinski <kuba@kernel.org>
Mon, 11 Mar 2024 21:14:09 +0000 (14:14 -0700)
commit44c2fbebe18aa2452cf8a3dbef4f38850d42b564
tree70c78025659e3c3f2a1f654ab7b9f56db2c1d0de
parent5a5a98e5176e4a4d38c98bc40890e0ab0102fd2c
mlxsw: spectrum_router: Share nexthop counters in resilient groups

For resilient groups, we can reuse the same counter for all the buckets
that share the same nexthop. Keep a reference count per counter, and keep
all these counters in a per-next hop group xarray, which serves as a
NHID->counter cache. If a counter is already present for a given NHID, just
take a reference and use the same counter.

Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Link: https://lore.kernel.org/r/cdd00084533fc83ac5917562f54642f008205bf3.1709901020.git.petrm@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c