diff options
author | Ido Schimmel <idosch@mellanox.com> | 2018-12-19 09:08:48 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-12-19 23:28:07 +0300 |
commit | 965fa8e600d28d98e7e0c7340517a9c139843ee3 (patch) | |
tree | 93761e57cf0247eac0a78a93f945e0f02958543e /drivers/net/ethernet/mellanox/mlxsw/spectrum.h | |
parent | 21ffedb6db5ac80b2081f425be358a976f5c14b7 (diff) | |
download | linux-965fa8e600d28d98e7e0c7340517a9c139843ee3.tar.xz |
mlxsw: spectrum_router: Make RIF deletion more robust
In the past we had multiple instances where RIFs were not properly
deleted.
One of the reasons for leaking a RIF was that at the time when IP
addresses were flushed from the respective netdev (prompting the
destruction of the RIF), the netdev was no longer a mlxsw upper. This
caused the inet{,6}addr notification blocks to ignore the NETDEV_DOWN
event and leak the RIF.
Instead of checking whether the netdev is our upper when an IP address
is removed, we can instead check if the netdev has a RIF configured.
To look up a RIF we need to access mlxsw private data, so the patch
stores the notification blocks inside a mlxsw struct. This then allows
us to use container_of() and extract the required private data.
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Reviewed-by: Petr Machata <petrm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlxsw/spectrum.h')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlxsw/spectrum.h | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.h b/drivers/net/ethernet/mellanox/mlxsw/spectrum.h index cb1d37df87ea..f022e9e24085 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.h +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.h @@ -458,12 +458,8 @@ int mlxsw_sp_netdevice_router_port_event(struct net_device *dev, unsigned long event, void *ptr); void mlxsw_sp_rif_macvlan_del(struct mlxsw_sp *mlxsw_sp, const struct net_device *macvlan_dev); -int mlxsw_sp_inetaddr_event(struct notifier_block *unused, - unsigned long event, void *ptr); int mlxsw_sp_inetaddr_valid_event(struct notifier_block *unused, unsigned long event, void *ptr); -int mlxsw_sp_inet6addr_event(struct notifier_block *unused, - unsigned long event, void *ptr); int mlxsw_sp_inet6addr_valid_event(struct notifier_block *unused, unsigned long event, void *ptr); int mlxsw_sp_netdevice_vrf_event(struct net_device *l3_dev, unsigned long event, |