summaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding
diff options
context:
space:
mode:
authorJiri Pirko <jiri@mellanox.com>2015-12-03 12:12:20 +0100
committerDavid S. Miller <davem@davemloft.net>2015-12-03 17:49:27 +0100
commitf7c7eb7f7af7f87e0fc150994785fd139576e43a (patch)
tree464148ddaf47901a954506fc0f1706036286aecd /drivers/net/bonding
parentbonding: allow notifications for bond_set_slave_link_state (diff)
downloadlinux-f7c7eb7f7af7f87e0fc150994785fd139576e43a.tar.xz
linux-f7c7eb7f7af7f87e0fc150994785fd139576e43a.zip
bonding: implement lower state change propagation
Let netdev notifier listeners know about link and slave state change. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding')
-rw-r--r--drivers/net/bonding/bond_main.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 7695490061ec..2f1145063c60 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1317,6 +1317,16 @@ void bond_queue_slave_event(struct slave *slave)
queue_delayed_work(slave->bond->wq, &nnw->work, 0);
}
+void bond_lower_state_changed(struct slave *slave)
+{
+ struct netdev_lag_lower_state_info info;
+
+ info.link_up = slave->link == BOND_LINK_UP ||
+ slave->link == BOND_LINK_FAIL;
+ info.tx_enabled = bond_is_active_slave(slave);
+ netdev_lower_state_changed(slave->dev, &info);
+}
+
/* enslave device <slave> to bond device <master> */
int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
{