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.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 2a0039f19377..fa3c2101fe75 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -88,6 +88,7 @@
88#define BOND_LINK_ARP_INTERV 0 88#define BOND_LINK_ARP_INTERV 0
89 89
90static int max_bonds = BOND_DEFAULT_MAX_BONDS; 90static int max_bonds = BOND_DEFAULT_MAX_BONDS;
91static int num_grat_arp = 1;
91static int miimon = BOND_LINK_MON_INTERV; 92static int miimon = BOND_LINK_MON_INTERV;
92static int updelay = 0; 93static int updelay = 0;
93static int downdelay = 0; 94static int downdelay = 0;
@@ -104,6 +105,8 @@ struct bond_params bonding_defaults;
104 105
105module_param(max_bonds, int, 0); 106module_param(max_bonds, int, 0);
106MODULE_PARM_DESC(max_bonds, "Max number of bonded devices"); 107MODULE_PARM_DESC(max_bonds, "Max number of bonded devices");
108module_param(num_grat_arp, int, 0644);
109MODULE_PARM_DESC(num_grat_arp, "Number of gratuitous ARP packets to send on failover event");
107module_param(miimon, int, 0); 110module_param(miimon, int, 0);
108MODULE_PARM_DESC(miimon, "Link check interval in milliseconds"); 111MODULE_PARM_DESC(miimon, "Link check interval in milliseconds");
109module_param(updelay, int, 0); 112module_param(updelay, int, 0);
@@ -1109,14 +1112,18 @@ void bond_change_active_slave(struct bonding *bond, struct slave *new_active)
1109 if (new_active && bond->params.fail_over_mac) 1112 if (new_active && bond->params.fail_over_mac)
1110 memcpy(bond->dev->dev_addr, new_active->dev->dev_addr, 1113 memcpy(bond->dev->dev_addr, new_active->dev->dev_addr,
1111 new_active->dev->addr_len); 1114 new_active->dev->addr_len);
1115 bond->send_grat_arp = bond->params.num_grat_arp;
1112 if (bond->curr_active_slave && 1116 if (bond->curr_active_slave &&
1113 test_bit(__LINK_STATE_LINKWATCH_PENDING, 1117 test_bit(__LINK_STATE_LINKWATCH_PENDING,
1114 &bond->curr_active_slave->dev->state)) { 1118 &bond->curr_active_slave->dev->state)) {
1115 dprintk("delaying gratuitous arp on %s\n", 1119 dprintk("delaying gratuitous arp on %s\n",
1116 bond->curr_active_slave->dev->name); 1120 bond->curr_active_slave->dev->name);
1117 bond->send_grat_arp = 1; 1121 } else {
1118 } else 1122 if (bond->send_grat_arp > 0) {
1119 bond_send_gratuitous_arp(bond); 1123 bond_send_gratuitous_arp(bond);
1124 bond->send_grat_arp--;
1125 }
1126 }
1120 } 1127 }
1121} 1128}
1122 1129
@@ -2144,7 +2151,7 @@ static int __bond_mii_monitor(struct bonding *bond, int have_locks)
2144 dprintk("sending delayed gratuitous arp on on %s\n", 2151 dprintk("sending delayed gratuitous arp on on %s\n",
2145 bond->curr_active_slave->dev->name); 2152 bond->curr_active_slave->dev->name);
2146 bond_send_gratuitous_arp(bond); 2153 bond_send_gratuitous_arp(bond);
2147 bond->send_grat_arp = 0; 2154 bond->send_grat_arp--;
2148 } 2155 }
2149 } 2156 }
2150 read_lock(&bond->curr_slave_lock); 2157 read_lock(&bond->curr_slave_lock);
@@ -4626,6 +4633,13 @@ static int bond_check_params(struct bond_params *params)
4626 use_carrier = 1; 4633 use_carrier = 1;
4627 } 4634 }
4628 4635
4636 if (num_grat_arp < 0 || num_grat_arp > 255) {
4637 printk(KERN_WARNING DRV_NAME
4638 ": Warning: num_grat_arp (%d) not in range 0-255 so it "
4639 "was reset to 1 \n", num_grat_arp);
4640 num_grat_arp = 1;
4641 }
4642
4629 /* reset values for 802.3ad */ 4643 /* reset values for 802.3ad */
4630 if (bond_mode == BOND_MODE_8023AD) { 4644 if (bond_mode == BOND_MODE_8023AD) {
4631 if (!miimon) { 4645 if (!miimon) {
@@ -4813,6 +4827,7 @@ static int bond_check_params(struct bond_params *params)
4813 params->mode = bond_mode; 4827 params->mode = bond_mode;
4814 params->xmit_policy = xmit_hashtype; 4828 params->xmit_policy = xmit_hashtype;
4815 params->miimon = miimon; 4829 params->miimon = miimon;
4830 params->num_grat_arp = num_grat_arp;
4816 params->arp_interval = arp_interval; 4831 params->arp_interval = arp_interval;
4817 params->arp_validate = arp_validate_value; 4832 params->arp_validate = arp_validate_value;
4818 params->updelay = updelay; 4833 params->updelay = updelay;