mlxsw: spectrum_router: Avoid allocating NH counters twice
authorPetr Machata <petrm@nvidia.com>
Fri, 8 Mar 2024 12:59:50 +0000 (13:59 +0100)
committerJakub Kicinski <kuba@kernel.org>
Mon, 11 Mar 2024 21:14:08 +0000 (14:14 -0700)
commit79fa52145e19803ed47bd5f2136c19c5e16f512d
tree050f534219fc0637a916cc60eaf36dcc4dd03bbc
parent6fb88aaf272a6aa58fd90a308cb0ef34f78aace4
mlxsw: spectrum_router: Avoid allocating NH counters twice

mlxsw_sp_nexthop_counter_disable() decays to a nop when called on a
disabled counter, but mlxsw_sp_nexthop_counter_enable() can't similarly
be called on an enabled counter. This would be useful in the following
patches. Add the missing condition.

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