aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding/bond_3ad.c
diff options
context:
space:
mode:
authorstephen hemminger <shemminger@vyatta.com>2011-06-22 05:54:39 -0400
committerDavid S. Miller <davem@davemloft.net>2011-06-23 05:12:55 -0400
commit655f8919d549ad1872e24d826b6ce42530516d2e (patch)
tree00ecb9724df0f4d162ea7de10fbf74d659e35cfd /drivers/net/bonding/bond_3ad.c
parent56f8a75c17abb854b5907f4a815dc4c3f186ba11 (diff)
bonding: add min links parameter to 802.3ad
This adds support for a configuring the minimum number of links that must be active before asserting carrier. It is similar to the Cisco EtherChannel min-links feature. This allows setting the minimum number of member ports that must be up (link-up state) before marking the bond device as up (carrier on). This is useful for situations where higher level services such as clustering want to ensure a minimum number of low bandwidth links are active before switchover. See: http://bugzilla.vyatta.com/show_bug.cgi?id=7196 Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: Flavio Leitner <fbl@redhat.com> Signed-off-by: Andy Gospodarek <andy@greyhouse.net> 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.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
index 77da2e849623..a047eb973e3b 100644
--- a/drivers/net/bonding/bond_3ad.c
+++ b/drivers/net/bonding/bond_3ad.c
@@ -2342,8 +2342,17 @@ void bond_3ad_handle_link_change(struct slave *slave, char link)
2342 */ 2342 */
2343int bond_3ad_set_carrier(struct bonding *bond) 2343int bond_3ad_set_carrier(struct bonding *bond)
2344{ 2344{
2345 if (__get_active_agg(&(SLAVE_AD_INFO(bond->first_slave).aggregator))) { 2345 struct aggregator *active;
2346 if (!netif_carrier_ok(bond->dev)) { 2346
2347 active = __get_active_agg(&(SLAVE_AD_INFO(bond->first_slave).aggregator));
2348 if (active) {
2349 /* are enough slaves available to consider link up? */
2350 if (active->num_of_ports < bond->params.min_links) {
2351 if (netif_carrier_ok(bond->dev)) {
2352 netif_carrier_off(bond->dev);
2353 return 1;
2354 }
2355 } else if (!netif_carrier_ok(bond->dev)) {
2347 netif_carrier_on(bond->dev); 2356 netif_carrier_on(bond->dev);
2348 return 1; 2357 return 1;
2349 } 2358 }