mlxsw: spectrum_router: Do not query MAX_VRS on each iteration
authorPetr Machata <petrm@nvidia.com>
Fri, 2 Jun 2023 16:20:08 +0000 (18:20 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 5 Jun 2023 10:29:49 +0000 (11:29 +0100)
commit75426cc0b31616b11d635076bd1692f2ff2f4a5f
treea6188b1a451d98fa45506a8d95c0bb783ef7a013
parent3903249ee1afb9aa06d77e2c39c4be2d3df25e0e
mlxsw: spectrum_router: Do not query MAX_VRS on each iteration

MLXSW_CORE_RES_GET involves a call to spectrum_core, a separate module.
Instead of making the call on every iteration, cache it up front, and use
the value.

Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Amit Cohen <amcohen@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c