mlxsw: spectrum: Rename IPIP-related netdevice handlers

To distinguish between events related to tunnel device itself and its
bound device, rename a number of functions related to handling tunneling
netdevice events to include _ol_ (for "overlay") in the name. That
leaves room in the namespace for underlay-related functions, which would
have _ul_ in the name.

Signed-off-by: Petr Machata <petrm@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Petr Machata 2017-11-03 10:03:29 +01:00 committed by David S. Miller
parent 6ee79b6ebf
commit 796ec7769d
3 changed files with 32 additions and 30 deletions

View File

@ -4542,8 +4542,9 @@ static int mlxsw_sp_netdevice_event(struct notifier_block *nb,
int err = 0; int err = 0;
mlxsw_sp = container_of(nb, struct mlxsw_sp, netdevice_nb); mlxsw_sp = container_of(nb, struct mlxsw_sp, netdevice_nb);
if (mlxsw_sp_netdev_is_ipip(mlxsw_sp, dev)) if (mlxsw_sp_netdev_is_ipip_ol(mlxsw_sp, dev))
err = mlxsw_sp_netdevice_ipip_event(mlxsw_sp, dev, event, ptr); err = mlxsw_sp_netdevice_ipip_ol_event(mlxsw_sp, dev,
event, ptr);
else if (event == NETDEV_CHANGEADDR || event == NETDEV_CHANGEMTU) else if (event == NETDEV_CHANGEADDR || event == NETDEV_CHANGEMTU)
err = mlxsw_sp_netdevice_router_port_event(dev); err = mlxsw_sp_netdevice_router_port_event(dev);
else if (mlxsw_sp_is_vrf_event(event, ptr)) else if (mlxsw_sp_is_vrf_event(event, ptr))

View File

@ -396,13 +396,13 @@ int mlxsw_sp_inet6addr_valid_event(struct notifier_block *unused,
unsigned long event, void *ptr); unsigned long event, void *ptr);
int mlxsw_sp_netdevice_vrf_event(struct net_device *l3_dev, unsigned long event, int mlxsw_sp_netdevice_vrf_event(struct net_device *l3_dev, unsigned long event,
struct netdev_notifier_changeupper_info *info); struct netdev_notifier_changeupper_info *info);
bool mlxsw_sp_netdev_is_ipip(const struct mlxsw_sp *mlxsw_sp, bool mlxsw_sp_netdev_is_ipip_ol(const struct mlxsw_sp *mlxsw_sp,
const struct net_device *dev); const struct net_device *dev);
int int
mlxsw_sp_netdevice_ipip_event(struct mlxsw_sp *mlxsw_sp, mlxsw_sp_netdevice_ipip_ol_event(struct mlxsw_sp *mlxsw_sp,
struct net_device *l3_dev, struct net_device *l3_dev,
unsigned long event, unsigned long event,
struct netdev_notifier_changeupper_info *info); struct netdev_notifier_changeupper_info *info);
void void
mlxsw_sp_port_vlan_router_leave(struct mlxsw_sp_port_vlan *mlxsw_sp_port_vlan); mlxsw_sp_port_vlan_router_leave(struct mlxsw_sp_port_vlan *mlxsw_sp_port_vlan);
void mlxsw_sp_rif_destroy(struct mlxsw_sp_rif *rif); void mlxsw_sp_rif_destroy(struct mlxsw_sp_rif *rif);

View File

@ -1306,8 +1306,8 @@ static bool mlxsw_sp_netdev_ipip_type(const struct mlxsw_sp *mlxsw_sp,
return false; return false;
} }
bool mlxsw_sp_netdev_is_ipip(const struct mlxsw_sp *mlxsw_sp, bool mlxsw_sp_netdev_is_ipip_ol(const struct mlxsw_sp *mlxsw_sp,
const struct net_device *dev) const struct net_device *dev)
{ {
return mlxsw_sp_netdev_ipip_type(mlxsw_sp, dev, NULL); return mlxsw_sp_netdev_ipip_type(mlxsw_sp, dev, NULL);
} }
@ -1326,8 +1326,8 @@ mlxsw_sp_ipip_entry_find_by_ol_dev(struct mlxsw_sp *mlxsw_sp,
return NULL; return NULL;
} }
static int mlxsw_sp_netdevice_ipip_reg_event(struct mlxsw_sp *mlxsw_sp, static int mlxsw_sp_netdevice_ipip_ol_reg_event(struct mlxsw_sp *mlxsw_sp,
struct net_device *ol_dev) struct net_device *ol_dev)
{ {
struct mlxsw_sp_router *router = mlxsw_sp->router; struct mlxsw_sp_router *router = mlxsw_sp->router;
struct mlxsw_sp_ipip_entry *ipip_entry; struct mlxsw_sp_ipip_entry *ipip_entry;
@ -1347,8 +1347,8 @@ static int mlxsw_sp_netdevice_ipip_reg_event(struct mlxsw_sp *mlxsw_sp,
return 0; return 0;
} }
static void mlxsw_sp_netdevice_ipip_unreg_event(struct mlxsw_sp *mlxsw_sp, static void mlxsw_sp_netdevice_ipip_ol_unreg_event(struct mlxsw_sp *mlxsw_sp,
struct net_device *ol_dev) struct net_device *ol_dev)
{ {
struct mlxsw_sp_ipip_entry *ipip_entry; struct mlxsw_sp_ipip_entry *ipip_entry;
@ -1357,8 +1357,8 @@ static void mlxsw_sp_netdevice_ipip_unreg_event(struct mlxsw_sp *mlxsw_sp,
mlxsw_sp_ipip_entry_destroy(mlxsw_sp, ipip_entry); mlxsw_sp_ipip_entry_destroy(mlxsw_sp, ipip_entry);
} }
static int mlxsw_sp_netdevice_ipip_up_event(struct mlxsw_sp *mlxsw_sp, static int mlxsw_sp_netdevice_ipip_ol_up_event(struct mlxsw_sp *mlxsw_sp,
struct net_device *ol_dev) struct net_device *ol_dev)
{ {
struct mlxsw_sp_fib_entry *decap_fib_entry; struct mlxsw_sp_fib_entry *decap_fib_entry;
struct mlxsw_sp_ipip_entry *ipip_entry; struct mlxsw_sp_ipip_entry *ipip_entry;
@ -1375,8 +1375,8 @@ static int mlxsw_sp_netdevice_ipip_up_event(struct mlxsw_sp *mlxsw_sp,
return 0; return 0;
} }
static void mlxsw_sp_netdevice_ipip_down_event(struct mlxsw_sp *mlxsw_sp, static void mlxsw_sp_netdevice_ipip_ol_down_event(struct mlxsw_sp *mlxsw_sp,
struct net_device *ol_dev) struct net_device *ol_dev)
{ {
struct mlxsw_sp_ipip_entry *ipip_entry; struct mlxsw_sp_ipip_entry *ipip_entry;
@ -1385,8 +1385,8 @@ static void mlxsw_sp_netdevice_ipip_down_event(struct mlxsw_sp *mlxsw_sp,
mlxsw_sp_ipip_entry_demote_decap(mlxsw_sp, ipip_entry); mlxsw_sp_ipip_entry_demote_decap(mlxsw_sp, ipip_entry);
} }
static int mlxsw_sp_netdevice_ipip_vrf_event(struct mlxsw_sp *mlxsw_sp, static int mlxsw_sp_netdevice_ipip_ol_vrf_event(struct mlxsw_sp *mlxsw_sp,
struct net_device *ol_dev) struct net_device *ol_dev)
{ {
struct mlxsw_sp_fib_entry *decap_fib_entry; struct mlxsw_sp_fib_entry *decap_fib_entry;
struct mlxsw_sp_ipip_entry *ipip_entry; struct mlxsw_sp_ipip_entry *ipip_entry;
@ -1424,26 +1424,27 @@ static int mlxsw_sp_netdevice_ipip_vrf_event(struct mlxsw_sp *mlxsw_sp,
return 0; return 0;
} }
int mlxsw_sp_netdevice_ipip_event(struct mlxsw_sp *mlxsw_sp, int
struct net_device *ol_dev, mlxsw_sp_netdevice_ipip_ol_event(struct mlxsw_sp *mlxsw_sp,
unsigned long event, struct net_device *ol_dev,
struct netdev_notifier_changeupper_info *info) unsigned long event,
struct netdev_notifier_changeupper_info *info)
{ {
switch (event) { switch (event) {
case NETDEV_REGISTER: case NETDEV_REGISTER:
return mlxsw_sp_netdevice_ipip_reg_event(mlxsw_sp, ol_dev); return mlxsw_sp_netdevice_ipip_ol_reg_event(mlxsw_sp, ol_dev);
case NETDEV_UNREGISTER: case NETDEV_UNREGISTER:
mlxsw_sp_netdevice_ipip_unreg_event(mlxsw_sp, ol_dev); mlxsw_sp_netdevice_ipip_ol_unreg_event(mlxsw_sp, ol_dev);
return 0; return 0;
case NETDEV_UP: case NETDEV_UP:
return mlxsw_sp_netdevice_ipip_up_event(mlxsw_sp, ol_dev); return mlxsw_sp_netdevice_ipip_ol_up_event(mlxsw_sp, ol_dev);
case NETDEV_DOWN: case NETDEV_DOWN:
mlxsw_sp_netdevice_ipip_down_event(mlxsw_sp, ol_dev); mlxsw_sp_netdevice_ipip_ol_down_event(mlxsw_sp, ol_dev);
return 0; return 0;
case NETDEV_CHANGEUPPER: case NETDEV_CHANGEUPPER:
if (netif_is_l3_master(info->upper_dev)) if (netif_is_l3_master(info->upper_dev))
return mlxsw_sp_netdevice_ipip_vrf_event(mlxsw_sp, return mlxsw_sp_netdevice_ipip_ol_vrf_event(mlxsw_sp,
ol_dev); ol_dev);
return 0; return 0;
} }
return 0; return 0;