summaryrefslogtreecommitdiff
path: root/drivers/net/bonding/bond_3ad.c
diff options
context:
space:
mode:
authorMahesh Bandewar <maheshb@google.com>2015-10-31 22:45:11 +0300
committerDavid S. Miller <davem@davemloft.net>2015-11-03 06:52:24 +0300
commit52bc67168109ade61014a36feedf09f4bc53d8f1 (patch)
tree48a4bb01acaecc60bd9d87c2dd4c4959e926b59e /drivers/net/bonding/bond_3ad.c
parent7bb11dc9f59ddcb33ee317da77b235235aaa582a (diff)
downloadlinux-52bc67168109ade61014a36feedf09f4bc53d8f1.tar.xz
bonding: simplify / unify event handling code for 3ad mode.
Old logic of updating state-machine is not required since ad_update_actor_keys() does it implicitly. The only loss is the notification differentiation between speed vs. duplex change. Now only one unified notification is printed. Signed-off-by: Mahesh Bandewar <maheshb@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding/bond_3ad.c')
-rw-r--r--drivers/net/bonding/bond_3ad.c38
1 files changed, 6 insertions, 32 deletions
diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
index b9816b7f319f..940e2ebbdea8 100644
--- a/drivers/net/bonding/bond_3ad.c
+++ b/drivers/net/bonding/bond_3ad.c
@@ -2348,39 +2348,14 @@ static void ad_update_actor_keys(struct port *port, bool reset)
}
/**
- * bond_3ad_adapter_speed_changed - handle a slave's speed change indication
- * @slave: slave struct to work on
+ * bond_3ad_adapter_speed_duplex_changed - handle a slave's speed / duplex
+ * change indication
*
- * Handle reselection of aggregator (if needed) for this port.
- */
-void bond_3ad_adapter_speed_changed(struct slave *slave)
-{
- struct port *port;
-
- port = &(SLAVE_AD_INFO(slave)->port);
-
- /* if slave is null, the whole port is not initialized */
- if (!port->slave) {
- netdev_warn(slave->bond->dev, "speed changed for uninitialized port on %s\n",
- slave->dev->name);
- return;
- }
-
- spin_lock_bh(&slave->bond->mode_lock);
-
- ad_update_actor_keys(port, false);
- netdev_dbg(slave->bond->dev, "Port %d changed speed\n", port->actor_port_number);
-
- spin_unlock_bh(&slave->bond->mode_lock);
-}
-
-/**
- * bond_3ad_adapter_duplex_changed - handle a slave's duplex change indication
* @slave: slave struct to work on
*
* Handle reselection of aggregator (if needed) for this port.
*/
-void bond_3ad_adapter_duplex_changed(struct slave *slave)
+void bond_3ad_adapter_speed_duplex_changed(struct slave *slave)
{
struct port *port;
@@ -2388,17 +2363,16 @@ void bond_3ad_adapter_duplex_changed(struct slave *slave)
/* if slave is null, the whole port is not initialized */
if (!port->slave) {
- netdev_warn(slave->bond->dev, "duplex changed for uninitialized port on %s\n",
+ netdev_warn(slave->bond->dev,
+ "speed/duplex changed for uninitialized port %s\n",
slave->dev->name);
return;
}
spin_lock_bh(&slave->bond->mode_lock);
-
ad_update_actor_keys(port, false);
- netdev_dbg(slave->bond->dev, "Port %d slave %s changed duplex\n",
+ netdev_dbg(slave->bond->dev, "Port %d slave %s changed speed/duplex\n",
port->actor_port_number, slave->dev->name);
-
spin_unlock_bh(&slave->bond->mode_lock);
}