diff options
author | Brian Haley <brian.haley@hp.com> | 2008-11-04 20:51:14 -0500 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-11-06 00:49:37 -0500 |
commit | 305d552accae6afb859c493ebc7d98ca3371dae2 (patch) | |
tree | aa1230b1a6cf85ceb36d3e8a8a155ef4348523b6 /drivers/net/bonding/bond_sysfs.c | |
parent | 61c9eaf90081cbe6dc4f389e0056bff76eca19ec (diff) |
bonding: send IPv6 neighbor advertisement on failover
This patch adds better IPv6 failover support for bonding devices,
especially when in active-backup mode and there are only IPv6 addresses
configured, as reported by Alex Sidorenko.
- Creates a new file, net/drivers/bonding/bond_ipv6.c, for the
IPv6-specific routines. Both regular bonds and VLANs over bonds
are supported.
- Adds a new tunable, num_unsol_na, to limit the number of unsolicited
IPv6 Neighbor Advertisements that are sent on a failover event.
Default is 1.
- Creates two new IPv6 neighbor discovery functions:
ndisc_build_skb()
ndisc_send_skb()
These were required to support VLANs since we have to be able to
add the VLAN id to the skb since ndisc_send_na() and friends
shouldn't be asked to do this. These two routines are basically
__ndisc_send() split into two pieces, in a slightly different order.
- Updates Documentation/networking/bonding.txt and bumps the rev of bond
support to 3.4.0.
On failover, this new code will generate one packet:
- An unsolicited IPv6 Neighbor Advertisement, which helps the switch
learn that the address has moved to the new slave.
Testing has shown that sending just the NA results in pretty good
behavior when in active-back mode, I saw no lost ping packets for example.
Signed-off-by: Brian Haley <brian.haley@hp.com>
Signed-off-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.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c index e400d7dfdfc8..8788e3e33852 100644 --- a/drivers/net/bonding/bond_sysfs.c +++ b/drivers/net/bonding/bond_sysfs.c | |||
@@ -983,6 +983,47 @@ out: | |||
983 | return ret; | 983 | return ret; |
984 | } | 984 | } |
985 | static DEVICE_ATTR(num_grat_arp, S_IRUGO | S_IWUSR, bonding_show_n_grat_arp, bonding_store_n_grat_arp); | 985 | static DEVICE_ATTR(num_grat_arp, S_IRUGO | S_IWUSR, bonding_show_n_grat_arp, bonding_store_n_grat_arp); |
986 | |||
987 | /* | ||
988 | * Show and set the number of unsolicted NA's to send after a failover event. | ||
989 | */ | ||
990 | static ssize_t bonding_show_n_unsol_na(struct device *d, | ||
991 | struct device_attribute *attr, | ||
992 | char *buf) | ||
993 | { | ||
994 | struct bonding *bond = to_bond(d); | ||
995 | |||
996 | return sprintf(buf, "%d\n", bond->params.num_unsol_na); | ||
997 | } | ||
998 | |||
999 | static ssize_t bonding_store_n_unsol_na(struct device *d, | ||
1000 | struct device_attribute *attr, | ||
1001 | const char *buf, size_t count) | ||
1002 | { | ||
1003 | int new_value, ret = count; | ||
1004 | struct bonding *bond = to_bond(d); | ||
1005 | |||
1006 | if (sscanf(buf, "%d", &new_value) != 1) { | ||
1007 | printk(KERN_ERR DRV_NAME | ||
1008 | ": %s: no num_unsol_na value specified.\n", | ||
1009 | bond->dev->name); | ||
1010 | ret = -EINVAL; | ||
1011 | goto out; | ||
1012 | } | ||
1013 | if (new_value < 0 || new_value > 255) { | ||
1014 | printk(KERN_ERR DRV_NAME | ||
1015 | ": %s: Invalid num_unsol_na value %d not in range 0-255; rejected.\n", | ||
1016 | bond->dev->name, new_value); | ||
1017 | ret = -EINVAL; | ||
1018 | goto out; | ||
1019 | } else { | ||
1020 | bond->params.num_unsol_na = new_value; | ||
1021 | } | ||
1022 | out: | ||
1023 | return ret; | ||
1024 | } | ||
1025 | static DEVICE_ATTR(num_unsol_na, S_IRUGO | S_IWUSR, bonding_show_n_unsol_na, bonding_store_n_unsol_na); | ||
1026 | |||
986 | /* | 1027 | /* |
987 | * Show and set the MII monitor interval. There are two tricky bits | 1028 | * Show and set the MII monitor interval. There are two tricky bits |
988 | * here. First, if MII monitoring is activated, then we must disable | 1029 | * here. First, if MII monitoring is activated, then we must disable |
@@ -1420,6 +1461,7 @@ static struct attribute *per_bond_attrs[] = { | |||
1420 | &dev_attr_lacp_rate.attr, | 1461 | &dev_attr_lacp_rate.attr, |
1421 | &dev_attr_xmit_hash_policy.attr, | 1462 | &dev_attr_xmit_hash_policy.attr, |
1422 | &dev_attr_num_grat_arp.attr, | 1463 | &dev_attr_num_grat_arp.attr, |
1464 | &dev_attr_num_unsol_na.attr, | ||
1423 | &dev_attr_miimon.attr, | 1465 | &dev_attr_miimon.attr, |
1424 | &dev_attr_primary.attr, | 1466 | &dev_attr_primary.attr, |
1425 | &dev_attr_use_carrier.attr, | 1467 | &dev_attr_use_carrier.attr, |