mlxsw: spectrum_switchdev: Add an internal API for VXLAN leave
authorAmit Cohen <amcohen@nvidia.com>
Mon, 17 Mar 2025 17:37:28 +0000 (18:37 +0100)
committerJakub Kicinski <kuba@kernel.org>
Mon, 24 Mar 2025 22:09:31 +0000 (15:09 -0700)
commit413e2c069969bd311a4043f062a686eff9e7b0a0
treebfe4ddf75577139607c97334c917e6a2a8497f26
parenta13fc7ebd9946974d4898187938c4f92b28dccbe
mlxsw: spectrum_switchdev: Add an internal API for VXLAN leave

There is asymmetry in how the VXLAN join and leave functions are used.
The join function (mlxsw_sp_bridge_vxlan_join()) is only called in
response to netdev events (e.g., VXLAN device joining a bridge), but the
leave function is also called in response to switchdev events (e.g.,
VLAN configuration on top of the VXLAN device) in order to invalidate
VNI to FID mappings.

This asymmetry will cause problems when the functions will be later
extended to mark VXLAN bridge ports as offloaded or not.

Therefore, create an internal function (__mlxsw_sp_bridge_vxlan_leave())
that is used to invalidate VNI to FID mappings and call it from
mlxsw_sp_bridge_vxlan_leave() which will only be invoked in response to
netdev events, like mlxsw_sp_bridge_vxlan_join().

No functional changes intended.

Signed-off-by: Amit Cohen <amcohen@nvidia.com>
Reviewed-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/f3a32bd2d87a0b7ac4d2bb98a427dc6d95a01cd0.1742224300.git.petrm@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c