aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding/bond_3ad.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/bonding/bond_3ad.c')
-rw-r--r--drivers/net/bonding/bond_3ad.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
index cce1f1bf90b4..dcde56057fe1 100644
--- a/drivers/net/bonding/bond_3ad.c
+++ b/drivers/net/bonding/bond_3ad.c
@@ -181,7 +181,7 @@ static inline int __agg_has_partner(struct aggregator *agg)
181 */ 181 */
182static inline void __disable_port(struct port *port) 182static inline void __disable_port(struct port *port)
183{ 183{
184 bond_set_slave_inactive_flags(port->slave); 184 bond_set_slave_inactive_flags(port->slave, BOND_SLAVE_NOTIFY_LATER);
185} 185}
186 186
187/** 187/**
@@ -193,7 +193,7 @@ static inline void __enable_port(struct port *port)
193 struct slave *slave = port->slave; 193 struct slave *slave = port->slave;
194 194
195 if ((slave->link == BOND_LINK_UP) && IS_UP(slave->dev)) 195 if ((slave->link == BOND_LINK_UP) && IS_UP(slave->dev))
196 bond_set_slave_active_flags(slave); 196 bond_set_slave_active_flags(slave, BOND_SLAVE_NOTIFY_LATER);
197} 197}
198 198
199/** 199/**
@@ -1796,8 +1796,6 @@ void bond_3ad_initiate_agg_selection(struct bonding *bond, int timeout)
1796 BOND_AD_INFO(bond).agg_select_timer = timeout; 1796 BOND_AD_INFO(bond).agg_select_timer = timeout;
1797} 1797}
1798 1798
1799static u16 aggregator_identifier;
1800
1801/** 1799/**
1802 * bond_3ad_initialize - initialize a bond's 802.3ad parameters and structures 1800 * bond_3ad_initialize - initialize a bond's 802.3ad parameters and structures
1803 * @bond: bonding struct to work on 1801 * @bond: bonding struct to work on
@@ -1811,7 +1809,7 @@ void bond_3ad_initialize(struct bonding *bond, u16 tick_resolution)
1811 if (!MAC_ADDRESS_EQUAL(&(BOND_AD_INFO(bond).system.sys_mac_addr), 1809 if (!MAC_ADDRESS_EQUAL(&(BOND_AD_INFO(bond).system.sys_mac_addr),
1812 bond->dev->dev_addr)) { 1810 bond->dev->dev_addr)) {
1813 1811
1814 aggregator_identifier = 0; 1812 BOND_AD_INFO(bond).aggregator_identifier = 0;
1815 1813
1816 BOND_AD_INFO(bond).system.sys_priority = 0xFFFF; 1814 BOND_AD_INFO(bond).system.sys_priority = 0xFFFF;
1817 BOND_AD_INFO(bond).system.sys_mac_addr = *((struct mac_addr *)bond->dev->dev_addr); 1815 BOND_AD_INFO(bond).system.sys_mac_addr = *((struct mac_addr *)bond->dev->dev_addr);
@@ -1880,7 +1878,7 @@ void bond_3ad_bind_slave(struct slave *slave)
1880 ad_initialize_agg(aggregator); 1878 ad_initialize_agg(aggregator);
1881 1879
1882 aggregator->aggregator_mac_address = *((struct mac_addr *)bond->dev->dev_addr); 1880 aggregator->aggregator_mac_address = *((struct mac_addr *)bond->dev->dev_addr);
1883 aggregator->aggregator_identifier = (++aggregator_identifier); 1881 aggregator->aggregator_identifier = ++BOND_AD_INFO(bond).aggregator_identifier;
1884 aggregator->slave = slave; 1882 aggregator->slave = slave;
1885 aggregator->is_active = 0; 1883 aggregator->is_active = 0;
1886 aggregator->num_of_ports = 0; 1884 aggregator->num_of_ports = 0;
@@ -2064,6 +2062,7 @@ void bond_3ad_state_machine_handler(struct work_struct *work)
2064 struct list_head *iter; 2062 struct list_head *iter;
2065 struct slave *slave; 2063 struct slave *slave;
2066 struct port *port; 2064 struct port *port;
2065 bool should_notify_rtnl = BOND_SLAVE_NOTIFY_LATER;
2067 2066
2068 read_lock(&bond->lock); 2067 read_lock(&bond->lock);
2069 rcu_read_lock(); 2068 rcu_read_lock();
@@ -2121,8 +2120,19 @@ void bond_3ad_state_machine_handler(struct work_struct *work)
2121 } 2120 }
2122 2121
2123re_arm: 2122re_arm:
2123 bond_for_each_slave_rcu(bond, slave, iter) {
2124 if (slave->should_notify) {
2125 should_notify_rtnl = BOND_SLAVE_NOTIFY_NOW;
2126 break;
2127 }
2128 }
2124 rcu_read_unlock(); 2129 rcu_read_unlock();
2125 read_unlock(&bond->lock); 2130 read_unlock(&bond->lock);
2131
2132 if (should_notify_rtnl && rtnl_trylock()) {
2133 bond_slave_state_notify(bond);
2134 rtnl_unlock();
2135 }
2126 queue_delayed_work(bond->wq, &bond->ad_work, ad_delta_in_ticks); 2136 queue_delayed_work(bond->wq, &bond->ad_work, ad_delta_in_ticks);
2127} 2137}
2128 2138