OSDN Git Service

mlxsw: spectrum_router: Use mlxsw_sp_ul_rif_get() to get main VRF LB RIF
authorPetr Machata <petrm@nvidia.com>
Thu, 22 Jun 2023 13:33:03 +0000 (15:33 +0200)
committerJakub Kicinski <kuba@kernel.org>
Sat, 24 Jun 2023 02:01:56 +0000 (19:01 -0700)
commitf3c85eed1ac364ae2cb2729959c6150813cc9c20
tree3a45c79ca03c9a5ece9cf45ba7b00fcbda089b19
parentebbd17ce297a3f367ca20058272063eaeeced63a
mlxsw: spectrum_router: Use mlxsw_sp_ul_rif_get() to get main VRF LB RIF

The current function, mlxsw_sp_router_ul_rif_get(), is a wrapper around the
function mentioned in the subject. As such it forms an external interface
of the router code.

In future patches we will want to maintain connection between RIFs and the
CRIFs (introduced in the next patch) that back them. That will not hold
for the VRF-based loopback netdevices, so the whole CRIF business can be
kept hidden from the rest of mlxsw.

But for the main VRF loopback RIF we do want to keep the RIF-CRIF
connection, because that RIF is used for blackhole next hops, and the next
hop code can be kept simpler for assuming rif->crif is valid.

Hence, instead, call mlxsw_sp_ul_rif_get() to create the main VRF loopback
RIF. This being an internal function will take the CRIF argument anyway.
Furthermore, the function does not lock, which is not necessary at this
point in code yet.

Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Danielle Ratson <danieller@nvidia.com>
Link: https://lore.kernel.org/r/7a39a011a02a84164cd7f5da7985ec5b2ae01ba5.1687438411.git.petrm@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c