aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding/bond_sysfs.c
diff options
context:
space:
mode:
authorMoni Shoua <monis@voltaire.com>2008-05-18 00:10:12 -0400
committerJeff Garzik <jgarzik@redhat.com>2008-05-22 06:34:26 -0400
commit7893b2491a2d5f716540ac5643d78d37a7f6628b (patch)
tree2558b83e5a19b7d4a6b3c10c5bb90919bb1f3889 /drivers/net/bonding/bond_sysfs.c
parent8047637c70e4451e2ac1c17ed9a91a2f753daae7 (diff)
bonding: Send more than one gratuitous ARP when slave takes over
With IPoIB, reception of gratuitous ARP by neighboring hosts is essential for a successful change of slaves in case of failure. Otherwise, they won't learn about the HW address change and need to wait a long time until the neighboring system gives up and sends an ARP request to learn the new HW address. This patch decreases the chance for a lost of a gratuitous ARP packet by sending it more than once. The number retries is configurable and can be set with a module param. Signed-off-by: Moni Shoua <monis@voltaire.com> Acked-by: Jay Vosburgh <fubar@us.ibm.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/net/bonding/bond_sysfs.c')
-rw-r--r--drivers/net/bonding/bond_sysfs.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c
index 1f028579e53b..7a61e9a14386 100644
--- a/drivers/net/bonding/bond_sysfs.c
+++ b/drivers/net/bonding/bond_sysfs.c
@@ -951,6 +951,45 @@ out:
951static DEVICE_ATTR(lacp_rate, S_IRUGO | S_IWUSR, bonding_show_lacp, bonding_store_lacp); 951static DEVICE_ATTR(lacp_rate, S_IRUGO | S_IWUSR, bonding_show_lacp, bonding_store_lacp);
952 952
953/* 953/*
954 * Show and set the number of grat ARP to send after a failover event.
955 */
956static ssize_t bonding_show_n_grat_arp(struct device *d,
957 struct device_attribute *attr,
958 char *buf)
959{
960 struct bonding *bond = to_bond(d);
961
962 return sprintf(buf, "%d\n", bond->params.num_grat_arp);
963}
964
965static ssize_t bonding_store_n_grat_arp(struct device *d,
966 struct device_attribute *attr,
967 const char *buf, size_t count)
968{
969 int new_value, ret = count;
970 struct bonding *bond = to_bond(d);
971
972 if (sscanf(buf, "%d", &new_value) != 1) {
973 printk(KERN_ERR DRV_NAME
974 ": %s: no num_grat_arp value specified.\n",
975 bond->dev->name);
976 ret = -EINVAL;
977 goto out;
978 }
979 if (new_value < 0 || new_value > 255) {
980 printk(KERN_ERR DRV_NAME
981 ": %s: Invalid num_grat_arp value %d not in range 0-255; rejected.\n",
982 bond->dev->name, new_value);
983 ret = -EINVAL;
984 goto out;
985 } else {
986 bond->params.num_grat_arp = new_value;
987 }
988out:
989 return ret;
990}
991static DEVICE_ATTR(num_grat_arp, S_IRUGO | S_IWUSR, bonding_show_n_grat_arp, bonding_store_n_grat_arp);
992/*
954 * Show and set the MII monitor interval. There are two tricky bits 993 * Show and set the MII monitor interval. There are two tricky bits
955 * here. First, if MII monitoring is activated, then we must disable 994 * here. First, if MII monitoring is activated, then we must disable
956 * ARP monitoring. Second, if the timer isn't running, we must 995 * ARP monitoring. Second, if the timer isn't running, we must
@@ -1387,6 +1426,7 @@ static struct attribute *per_bond_attrs[] = {
1387 &dev_attr_updelay.attr, 1426 &dev_attr_updelay.attr,
1388 &dev_attr_lacp_rate.attr, 1427 &dev_attr_lacp_rate.attr,
1389 &dev_attr_xmit_hash_policy.attr, 1428 &dev_attr_xmit_hash_policy.attr,
1429 &dev_attr_num_grat_arp.attr,
1390 &dev_attr_miimon.attr, 1430 &dev_attr_miimon.attr,
1391 &dev_attr_primary.attr, 1431 &dev_attr_primary.attr,
1392 &dev_attr_use_carrier.attr, 1432 &dev_attr_use_carrier.attr,