summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2015-02-10 01:03:59 +0300
committerDavid S. Miller <davem@davemloft.net>2015-02-10 01:03:59 +0300
commit46857b57710f7b2088186d4fdd378083799ba6a7 (patch)
treea39bb7c432f4e36467e61b316050e41ecd408b1f /drivers/net
parent9dce285b70c157754d753203112cfef22770b1f9 (diff)
parent35f05dabf95ac3ebc4c15bafd6833f7a3046e66f (diff)
downloadlinux-46857b57710f7b2088186d4fdd378083799ba6a7.tar.xz
Merge branch 'mlx4_bond_notify'
Or Gerlitz says: ==================== bonding and mlx4 fixes for the HA/LAG support and mlx4 reset flow There are two fixes to the boding + mlx4 HA/LAG support from Moni and a patch from Yishai which does further hardening of the mlx4 reset support for IB kernel ULPs. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/bonding/bond_main.c28
1 files changed, 11 insertions, 17 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 679ef00d6b16..b979c265fc51 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1196,18 +1196,11 @@ static void bond_fill_ifslave(struct slave *slave, struct ifslave *info)
info->link_failure_count = slave->link_failure_count;
}
-static void bond_netdev_notify(struct slave *slave, struct net_device *dev)
+static void bond_netdev_notify(struct net_device *dev,
+ struct netdev_bonding_info *info)
{
- struct bonding *bond = slave->bond;
- struct netdev_bonding_info bonding_info;
-
rtnl_lock();
- /* make sure that slave is still valid */
- if (dev->priv_flags & IFF_BONDING) {
- bond_fill_ifslave(slave, &bonding_info.slave);
- bond_fill_ifbond(bond, &bonding_info.master);
- netdev_bonding_info_change(slave->dev, &bonding_info);
- }
+ netdev_bonding_info_change(dev, info);
rtnl_unlock();
}
@@ -1216,25 +1209,26 @@ static void bond_netdev_notify_work(struct work_struct *_work)
struct netdev_notify_work *w =
container_of(_work, struct netdev_notify_work, work.work);
- bond_netdev_notify(w->slave, w->dev);
+ bond_netdev_notify(w->dev, &w->bonding_info);
dev_put(w->dev);
+ kfree(w);
}
void bond_queue_slave_event(struct slave *slave)
{
+ struct bonding *bond = slave->bond;
struct netdev_notify_work *nnw = kzalloc(sizeof(*nnw), GFP_ATOMIC);
if (!nnw)
return;
- INIT_DELAYED_WORK(&nnw->work, bond_netdev_notify_work);
- nnw->slave = slave;
+ dev_hold(slave->dev);
nnw->dev = slave->dev;
+ bond_fill_ifslave(slave, &nnw->bonding_info.slave);
+ bond_fill_ifbond(bond, &nnw->bonding_info.master);
+ INIT_DELAYED_WORK(&nnw->work, bond_netdev_notify_work);
- if (queue_delayed_work(slave->bond->wq, &nnw->work, 0))
- dev_hold(slave->dev);
- else
- kfree(nnw);
+ queue_delayed_work(slave->bond->wq, &nnw->work, 0);
}
/* enslave device <slave> to bond device <master> */