Commit b9f09866 authored by Parav Pandit's avatar Parav Pandit Committed by Jason Gunthorpe

IB/core: Avoid confusing del_netdev_default_ips

Currently bond_delete_netdev_default_gids() is called by two callers.
(a) del_netdev_default_ips_join()
(b) del_netdev_default_ips()

Both above functions changes the argument order while calling
bond_delete_netdev_default_gids().  This required silly
del_netdev_default_ips() wrapper.

Additionally, del_netdev_default_ips() deletes default GIDs not IP based
GIDs.  del_netdev_default_ips() having _ips suffix is confusing.

Therefore, get rid of confusing del_netdev_default_ips() and simplify
bond_delete_netdev_default_gids() to follow same argument order as its
caller.
Signed-off-by: default avatarParav Pandit <parav@mellanox.com>
Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
parent 666e7099
...@@ -249,8 +249,8 @@ static void enum_netdev_default_gids(struct ib_device *ib_dev, ...@@ -249,8 +249,8 @@ static void enum_netdev_default_gids(struct ib_device *ib_dev,
static void bond_delete_netdev_default_gids(struct ib_device *ib_dev, static void bond_delete_netdev_default_gids(struct ib_device *ib_dev,
u8 port, u8 port,
struct net_device *event_ndev, struct net_device *rdma_ndev,
struct net_device *rdma_ndev) void *event_ndev)
{ {
struct net_device *real_dev = rdma_vlan_dev_real_dev(event_ndev); struct net_device *real_dev = rdma_vlan_dev_real_dev(event_ndev);
unsigned long gid_type_mask; unsigned long gid_type_mask;
...@@ -513,18 +513,12 @@ static void del_netdev_default_ips_join(struct ib_device *ib_dev, u8 port, ...@@ -513,18 +513,12 @@ static void del_netdev_default_ips_join(struct ib_device *ib_dev, u8 port,
rcu_read_unlock(); rcu_read_unlock();
if (master_ndev) { if (master_ndev) {
bond_delete_netdev_default_gids(ib_dev, port, master_ndev, bond_delete_netdev_default_gids(ib_dev, port, rdma_ndev,
rdma_ndev); master_ndev);
dev_put(master_ndev); dev_put(master_ndev);
} }
} }
static void del_netdev_default_ips(struct ib_device *ib_dev, u8 port,
struct net_device *rdma_ndev, void *cookie)
{
bond_delete_netdev_default_gids(ib_dev, port, cookie, rdma_ndev);
}
/* The following functions operate on all IB devices. netdevice_event and /* The following functions operate on all IB devices. netdevice_event and
* addr_event execute ib_enum_all_roce_netdevs through a work. * addr_event execute ib_enum_all_roce_netdevs through a work.
* ib_enum_all_roce_netdevs iterates through all IB devices. * ib_enum_all_roce_netdevs iterates through all IB devices.
...@@ -600,7 +594,7 @@ ndev_event_link(struct netdev_notifier_changeupper_info *changeupper_info, ...@@ -600,7 +594,7 @@ ndev_event_link(struct netdev_notifier_changeupper_info *changeupper_info,
{ {
static const struct netdev_event_work_cmd static const struct netdev_event_work_cmd
bonding_default_del_cmd = { bonding_default_del_cmd = {
.cb = del_netdev_default_ips, .cb = bond_delete_netdev_default_gids,
.filter = is_eth_port_inactive_slave .filter = is_eth_port_inactive_slave
}; };
/* /*
...@@ -630,8 +624,11 @@ static int netdevice_event(struct notifier_block *this, unsigned long event, ...@@ -630,8 +624,11 @@ static int netdevice_event(struct notifier_block *this, unsigned long event,
.cb = del_netdev_ips, .filter = pass_all_filter}; .cb = del_netdev_ips, .filter = pass_all_filter};
static const struct netdev_event_work_cmd bonding_default_del_cmd_join = { static const struct netdev_event_work_cmd bonding_default_del_cmd_join = {
.cb = del_netdev_default_ips_join, .filter = is_eth_port_inactive_slave}; .cb = del_netdev_default_ips_join, .filter = is_eth_port_inactive_slave};
static const struct netdev_event_work_cmd default_del_cmd = { static const struct netdev_event_work_cmd
.cb = del_netdev_default_ips, .filter = pass_all_filter}; default_del_cmd = {
.cb = bond_delete_netdev_default_gids,
.filter = pass_all_filter
};
static const struct netdev_event_work_cmd bonding_event_ips_del_cmd = { static const struct netdev_event_work_cmd bonding_event_ips_del_cmd = {
.cb = del_netdev_upper_ips, .filter = upper_device_filter}; .cb = del_netdev_upper_ips, .filter = upper_device_filter};
struct net_device *ndev = netdev_notifier_info_to_dev(ptr); struct net_device *ndev = netdev_notifier_info_to_dev(ptr);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment