diff options
author | Jay Vosburgh <fubar@us.ibm.com> | 2008-11-04 20:51:16 -0500 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-11-06 00:49:47 -0500 |
commit | fd989c83325cb34795bc4d4aa6b13c06f90eac99 (patch) | |
tree | ba6a0589847a45cd558cf2273dae423a4ab78dcc /drivers/net/bonding/bond_main.c | |
parent | 6146b1a4da98377e4abddc91ba5856bef8f23f1e (diff) |
bonding: alternate agg selection policies for 802.3ad
This patch implements alternative aggregator selection policies
for 802.3ad. The existing policy, now termed "stable," selects the active
aggregator by greatest bandwidth, and only reselects a new aggregator
if the active aggregator is entirely disabled (no more ports or all ports
down).
This patch adds two new policies: bandwidth and count, selecting
the active aggregator by total bandwidth (like the stable policy) or by
the number of ports in the aggregator, respectively. These two policies
also differ from the stable policy in that they will reselect the active
aggregator when availability-related changes occur in the bond (e.g.,
link state change).
This permits "gang failover" within 802.3ad, allowing redundant
aggregators along parallel paths to always maintain the "best" aggregator
as the active aggregator (rather than having to wait for the active to
entirely fail).
This patch also updates the driver version to 3.5.0.
Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/net/bonding/bond_main.c')
-rw-r--r-- | drivers/net/bonding/bond_main.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 798d98ce2d97..02de3e031237 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -97,6 +97,7 @@ static int use_carrier = 1; | |||
97 | static char *mode = NULL; | 97 | static char *mode = NULL; |
98 | static char *primary = NULL; | 98 | static char *primary = NULL; |
99 | static char *lacp_rate = NULL; | 99 | static char *lacp_rate = NULL; |
100 | static char *ad_select = NULL; | ||
100 | static char *xmit_hash_policy = NULL; | 101 | static char *xmit_hash_policy = NULL; |
101 | static int arp_interval = BOND_LINK_ARP_INTERV; | 102 | static int arp_interval = BOND_LINK_ARP_INTERV; |
102 | static char *arp_ip_target[BOND_MAX_ARP_TARGETS] = { NULL, }; | 103 | static char *arp_ip_target[BOND_MAX_ARP_TARGETS] = { NULL, }; |
@@ -130,6 +131,8 @@ MODULE_PARM_DESC(primary, "Primary network device to use"); | |||
130 | module_param(lacp_rate, charp, 0); | 131 | module_param(lacp_rate, charp, 0); |
131 | MODULE_PARM_DESC(lacp_rate, "LACPDU tx rate to request from 802.3ad partner " | 132 | MODULE_PARM_DESC(lacp_rate, "LACPDU tx rate to request from 802.3ad partner " |
132 | "(slow/fast)"); | 133 | "(slow/fast)"); |
134 | module_param(ad_select, charp, 0); | ||
135 | MODULE_PARM_DESC(ad_select, "803.ad aggregation selection logic: stable (0, default), bandwidth (1), count (2)"); | ||
133 | module_param(xmit_hash_policy, charp, 0); | 136 | module_param(xmit_hash_policy, charp, 0); |
134 | MODULE_PARM_DESC(xmit_hash_policy, "XOR hashing method: 0 for layer 2 (default)" | 137 | MODULE_PARM_DESC(xmit_hash_policy, "XOR hashing method: 0 for layer 2 (default)" |
135 | ", 1 for layer 3+4"); | 138 | ", 1 for layer 3+4"); |
@@ -200,6 +203,13 @@ struct bond_parm_tbl fail_over_mac_tbl[] = { | |||
200 | { NULL, -1}, | 203 | { NULL, -1}, |
201 | }; | 204 | }; |
202 | 205 | ||
206 | struct bond_parm_tbl ad_select_tbl[] = { | ||
207 | { "stable", BOND_AD_STABLE}, | ||
208 | { "bandwidth", BOND_AD_BANDWIDTH}, | ||
209 | { "count", BOND_AD_COUNT}, | ||
210 | { NULL, -1}, | ||
211 | }; | ||
212 | |||
203 | /*-------------------------- Forward declarations ---------------------------*/ | 213 | /*-------------------------- Forward declarations ---------------------------*/ |
204 | 214 | ||
205 | static void bond_send_gratuitous_arp(struct bonding *bond); | 215 | static void bond_send_gratuitous_arp(struct bonding *bond); |
@@ -3318,6 +3328,8 @@ static void bond_info_show_master(struct seq_file *seq) | |||
3318 | seq_puts(seq, "\n802.3ad info\n"); | 3328 | seq_puts(seq, "\n802.3ad info\n"); |
3319 | seq_printf(seq, "LACP rate: %s\n", | 3329 | seq_printf(seq, "LACP rate: %s\n", |
3320 | (bond->params.lacp_fast) ? "fast" : "slow"); | 3330 | (bond->params.lacp_fast) ? "fast" : "slow"); |
3331 | seq_printf(seq, "Aggregator selection policy (ad_select): %s\n", | ||
3332 | ad_select_tbl[bond->params.ad_select].modename); | ||
3321 | 3333 | ||
3322 | if (bond_3ad_get_active_agg_info(bond, &ad_info)) { | 3334 | if (bond_3ad_get_active_agg_info(bond, &ad_info)) { |
3323 | seq_printf(seq, "bond %s has no active aggregator\n", | 3335 | seq_printf(seq, "bond %s has no active aggregator\n", |
@@ -3824,6 +3836,7 @@ static int bond_open(struct net_device *bond_dev) | |||
3824 | queue_delayed_work(bond->wq, &bond->ad_work, 0); | 3836 | queue_delayed_work(bond->wq, &bond->ad_work, 0); |
3825 | /* register to receive LACPDUs */ | 3837 | /* register to receive LACPDUs */ |
3826 | bond_register_lacpdu(bond); | 3838 | bond_register_lacpdu(bond); |
3839 | bond_3ad_initiate_agg_selection(bond, 1); | ||
3827 | } | 3840 | } |
3828 | 3841 | ||
3829 | return 0; | 3842 | return 0; |
@@ -4763,6 +4776,23 @@ static int bond_check_params(struct bond_params *params) | |||
4763 | } | 4776 | } |
4764 | } | 4777 | } |
4765 | 4778 | ||
4779 | if (ad_select) { | ||
4780 | params->ad_select = bond_parse_parm(ad_select, ad_select_tbl); | ||
4781 | if (params->ad_select == -1) { | ||
4782 | printk(KERN_ERR DRV_NAME | ||
4783 | ": Error: Invalid ad_select \"%s\"\n", | ||
4784 | ad_select == NULL ? "NULL" : ad_select); | ||
4785 | return -EINVAL; | ||
4786 | } | ||
4787 | |||
4788 | if (bond_mode != BOND_MODE_8023AD) { | ||
4789 | printk(KERN_WARNING DRV_NAME | ||
4790 | ": ad_select param only affects 802.3ad mode\n"); | ||
4791 | } | ||
4792 | } else { | ||
4793 | params->ad_select = BOND_AD_STABLE; | ||
4794 | } | ||
4795 | |||
4766 | if (max_bonds < 0 || max_bonds > INT_MAX) { | 4796 | if (max_bonds < 0 || max_bonds > INT_MAX) { |
4767 | printk(KERN_WARNING DRV_NAME | 4797 | printk(KERN_WARNING DRV_NAME |
4768 | ": Warning: max_bonds (%d) not in range %d-%d, so it " | 4798 | ": Warning: max_bonds (%d) not in range %d-%d, so it " |