aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding/bond_sysfs.c
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2011-04-26 11:25:52 -0400
committerDavid S. Miller <davem@davemloft.net>2011-04-29 15:44:11 -0400
commitad246c992bea6d33c6421ba1f03e2b405792adf9 (patch)
tree28afc1b370d856a63a3cd792fc292996c0315c13 /drivers/net/bonding/bond_sysfs.c
parent7d36a991e8d36b8ae87e2aa1158d3735e656253b (diff)
ipv4, ipv6, bonding: Restore control over number of peer notifications
For backward compatibility, we should retain the module parameters and sysfs attributes to control the number of peer notifications (gratuitous ARPs and unsolicited NAs) sent after bonding failover. Also, it is possible for failover to take place even though the new active slave does not have link up, and in that case the peer notification should be deferred until it does. Change ipv4 and ipv6 so they do not automatically send peer notifications on bonding failover. Change the bonding driver to send separate NETDEV_NOTIFY_PEERS notifications when the link is up, as many times as requested. Since it does not directly control which protocols send notifications, make num_grat_arp and num_unsol_na aliases for a single parameter. Bump the bonding version number and update its documentation. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: Jay Vosburgh <fubar@us.ibm.com> Acked-by: Brian Haley <brian.haley@hp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding/bond_sysfs.c')
-rw-r--r--drivers/net/bonding/bond_sysfs.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c
index 935406aa5f0c..4059bfc73dbf 100644
--- a/drivers/net/bonding/bond_sysfs.c
+++ b/drivers/net/bonding/bond_sysfs.c
@@ -869,6 +869,30 @@ static DEVICE_ATTR(ad_select, S_IRUGO | S_IWUSR,
869 bonding_show_ad_select, bonding_store_ad_select); 869 bonding_show_ad_select, bonding_store_ad_select);
870 870
871/* 871/*
872 * Show and set the number of peer notifications to send after a failover event.
873 */
874static ssize_t bonding_show_num_peer_notif(struct device *d,
875 struct device_attribute *attr,
876 char *buf)
877{
878 struct bonding *bond = to_bond(d);
879 return sprintf(buf, "%d\n", bond->params.num_peer_notif);
880}
881
882static ssize_t bonding_store_num_peer_notif(struct device *d,
883 struct device_attribute *attr,
884 const char *buf, size_t count)
885{
886 struct bonding *bond = to_bond(d);
887 int err = kstrtou8(buf, 10, &bond->params.num_peer_notif);
888 return err ? err : count;
889}
890static DEVICE_ATTR(num_grat_arp, S_IRUGO | S_IWUSR,
891 bonding_show_num_peer_notif, bonding_store_num_peer_notif);
892static DEVICE_ATTR(num_unsol_na, S_IRUGO | S_IWUSR,
893 bonding_show_num_peer_notif, bonding_store_num_peer_notif);
894
895/*
872 * Show and set the MII monitor interval. There are two tricky bits 896 * Show and set the MII monitor interval. There are two tricky bits
873 * here. First, if MII monitoring is activated, then we must disable 897 * here. First, if MII monitoring is activated, then we must disable
874 * ARP monitoring. Second, if the timer isn't running, we must 898 * ARP monitoring. Second, if the timer isn't running, we must
@@ -1566,6 +1590,8 @@ static struct attribute *per_bond_attrs[] = {
1566 &dev_attr_lacp_rate.attr, 1590 &dev_attr_lacp_rate.attr,
1567 &dev_attr_ad_select.attr, 1591 &dev_attr_ad_select.attr,
1568 &dev_attr_xmit_hash_policy.attr, 1592 &dev_attr_xmit_hash_policy.attr,
1593 &dev_attr_num_grat_arp.attr,
1594 &dev_attr_num_unsol_na.attr,
1569 &dev_attr_miimon.attr, 1595 &dev_attr_miimon.attr,
1570 &dev_attr_primary.attr, 1596 &dev_attr_primary.attr,
1571 &dev_attr_primary_reselect.attr, 1597 &dev_attr_primary_reselect.attr,