mlxsw: spectrum_router: Add a helper specifically for joining a LAG
authorPetr Machata <petrm@nvidia.com>
Mon, 12 Jun 2023 15:31:01 +0000 (17:31 +0200)
committerPaolo Abeni <pabeni@redhat.com>
Wed, 14 Jun 2023 11:12:20 +0000 (13:12 +0200)
commit76962b802efe27a32425d2abe818e53167c71dbe
treeb390239a49a7eeb7d0cca6e5761995f9f267e1ea
parente0db883b6949bd0b5b221893e30afd5f838783b1
mlxsw: spectrum_router: Add a helper specifically for joining a LAG

Currently, joining a LAG very simply means that the LAG RIF should be
joined by the subport representing untagged traffic. If the RIF does not
exist, it does not have to be created: if the user wants there to be RIF
for the LAG device, they are supposed to add an IP address, and they are
supposed to do it after tha LAG becomes mlxsw upper.

We can also assume that the LAG has no uppers, otherwise the enslavement is
not allowed.

In the future, these ordering dependencies should be removed. That means
that joining LAG will be more complex operation, possibly involving a lazy
RIF creation, and possibly joining / lazily creating RIFs for VLAN uppers
of the LAG. It will be handy to have a dedicated function that handles all
this. The new function mlxsw_sp_router_port_join_lag() is that.

Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Amit Cohen <amcohen@nvidia.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/mellanox/mlxsw/spectrum.c
drivers/net/ethernet/mellanox/mlxsw/spectrum.h
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h