aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding/bond_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/bonding/bond_main.c')
-rw-r--r--drivers/net/bonding/bond_main.c30
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;
97static char *mode = NULL; 97static char *mode = NULL;
98static char *primary = NULL; 98static char *primary = NULL;
99static char *lacp_rate = NULL; 99static char *lacp_rate = NULL;
100static char *ad_select = NULL;
100static char *xmit_hash_policy = NULL; 101static char *xmit_hash_policy = NULL;
101static int arp_interval = BOND_LINK_ARP_INTERV; 102static int arp_interval = BOND_LINK_ARP_INTERV;
102static char *arp_ip_target[BOND_MAX_ARP_TARGETS] = { NULL, }; 103static char *arp_ip_target[BOND_MAX_ARP_TARGETS] = { NULL, };
@@ -130,6 +131,8 @@ MODULE_PARM_DESC(primary, "Primary network device to use");
130module_param(lacp_rate, charp, 0); 131module_param(lacp_rate, charp, 0);
131MODULE_PARM_DESC(lacp_rate, "LACPDU tx rate to request from 802.3ad partner " 132MODULE_PARM_DESC(lacp_rate, "LACPDU tx rate to request from 802.3ad partner "
132 "(slow/fast)"); 133 "(slow/fast)");
134module_param(ad_select, charp, 0);
135MODULE_PARM_DESC(ad_select, "803.ad aggregation selection logic: stable (0, default), bandwidth (1), count (2)");
133module_param(xmit_hash_policy, charp, 0); 136module_param(xmit_hash_policy, charp, 0);
134MODULE_PARM_DESC(xmit_hash_policy, "XOR hashing method: 0 for layer 2 (default)" 137MODULE_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
206struct 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
205static void bond_send_gratuitous_arp(struct bonding *bond); 215static 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 "