Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mlxsw: spectrum_router: Publish mlxsw_sp_rif_find_by_dev()

In order to guard against removal of a PVID for which a FID was
allocated, spectrum_switchdev needs to first determine whether there is
a RIF associated with a given bridge. To that end, publish a preexisting
function mlxsw_sp_rif_find_by_dev().

Signed-off-by: Petr Machata <petrm@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Petr Machata and committed by
David S. Miller
0c41292b e6f1960a

+3 -5
+1 -5
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
··· 343 343 mlxsw_sp_rif_counter_free(mlxsw_sp, rif, MLXSW_SP_RIF_COUNTER_EGRESS); 344 344 } 345 345 346 - static struct mlxsw_sp_rif * 347 - mlxsw_sp_rif_find_by_dev(const struct mlxsw_sp *mlxsw_sp, 348 - const struct net_device *dev); 349 - 350 346 #define MLXSW_SP_PREFIX_COUNT (sizeof(struct in6_addr) * BITS_PER_BYTE + 1) 351 347 352 348 struct mlxsw_sp_prefix_usage { ··· 5964 5968 return NOTIFY_DONE; 5965 5969 } 5966 5970 5967 - static struct mlxsw_sp_rif * 5971 + struct mlxsw_sp_rif * 5968 5972 mlxsw_sp_rif_find_by_dev(const struct mlxsw_sp *mlxsw_sp, 5969 5973 const struct net_device *dev) 5970 5974 {
+2
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h
··· 66 66 struct mlxsw_sp_nexthop; 67 67 struct mlxsw_sp_ipip_entry; 68 68 69 + struct mlxsw_sp_rif *mlxsw_sp_rif_find_by_dev(const struct mlxsw_sp *mlxsw_sp, 70 + const struct net_device *dev); 69 71 struct mlxsw_sp_rif *mlxsw_sp_rif_by_index(const struct mlxsw_sp *mlxsw_sp, 70 72 u16 rif_index); 71 73 u16 mlxsw_sp_rif_index(const struct mlxsw_sp_rif *rif);