diff options
author | Flavio Leitner <fleitner@redhat.com> | 2010-10-05 10:23:59 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-10-05 23:26:58 -0400 |
commit | c2952c314b4fe61820ba8fd6c949eed636140d52 (patch) | |
tree | dd7ab927c7d344279e128f38d90387214cd06e13 /drivers/net/bonding/bond_sysfs.c | |
parent | e12b453904c54bbdc515778ff664d87a7f9473af (diff) |
bonding: add retransmit membership reports tunable
Allow sysadmins to configure the number of multicast
membership report sent on a link failure event.
Signed-off-by: Flavio Leitner <fleitner@redhat.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.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c index c311aed9bd02..01b4c3f5d9e7 100644 --- a/drivers/net/bonding/bond_sysfs.c +++ b/drivers/net/bonding/bond_sysfs.c | |||
@@ -1592,6 +1592,49 @@ out: | |||
1592 | static DEVICE_ATTR(all_slaves_active, S_IRUGO | S_IWUSR, | 1592 | static DEVICE_ATTR(all_slaves_active, S_IRUGO | S_IWUSR, |
1593 | bonding_show_slaves_active, bonding_store_slaves_active); | 1593 | bonding_show_slaves_active, bonding_store_slaves_active); |
1594 | 1594 | ||
1595 | /* | ||
1596 | * Show and set the number of IGMP membership reports to send on link failure | ||
1597 | */ | ||
1598 | static ssize_t bonding_show_resend_igmp(struct device *d, | ||
1599 | struct device_attribute *attr, | ||
1600 | char *buf) | ||
1601 | { | ||
1602 | struct bonding *bond = to_bond(d); | ||
1603 | |||
1604 | return sprintf(buf, "%d\n", bond->params.resend_igmp); | ||
1605 | } | ||
1606 | |||
1607 | static ssize_t bonding_store_resend_igmp(struct device *d, | ||
1608 | struct device_attribute *attr, | ||
1609 | const char *buf, size_t count) | ||
1610 | { | ||
1611 | int new_value, ret = count; | ||
1612 | struct bonding *bond = to_bond(d); | ||
1613 | |||
1614 | if (sscanf(buf, "%d", &new_value) != 1) { | ||
1615 | pr_err("%s: no resend_igmp value specified.\n", | ||
1616 | bond->dev->name); | ||
1617 | ret = -EINVAL; | ||
1618 | goto out; | ||
1619 | } | ||
1620 | |||
1621 | if (new_value < 0) { | ||
1622 | pr_err("%s: Invalid resend_igmp value %d not in range 0-255; rejected.\n", | ||
1623 | bond->dev->name, new_value); | ||
1624 | ret = -EINVAL; | ||
1625 | goto out; | ||
1626 | } | ||
1627 | |||
1628 | pr_info("%s: Setting resend_igmp to %d.\n", | ||
1629 | bond->dev->name, new_value); | ||
1630 | bond->params.resend_igmp = new_value; | ||
1631 | out: | ||
1632 | return ret; | ||
1633 | } | ||
1634 | |||
1635 | static DEVICE_ATTR(resend_igmp, S_IRUGO | S_IWUSR, | ||
1636 | bonding_show_resend_igmp, bonding_store_resend_igmp); | ||
1637 | |||
1595 | static struct attribute *per_bond_attrs[] = { | 1638 | static struct attribute *per_bond_attrs[] = { |
1596 | &dev_attr_slaves.attr, | 1639 | &dev_attr_slaves.attr, |
1597 | &dev_attr_mode.attr, | 1640 | &dev_attr_mode.attr, |
@@ -1619,6 +1662,7 @@ static struct attribute *per_bond_attrs[] = { | |||
1619 | &dev_attr_ad_partner_mac.attr, | 1662 | &dev_attr_ad_partner_mac.attr, |
1620 | &dev_attr_queue_id.attr, | 1663 | &dev_attr_queue_id.attr, |
1621 | &dev_attr_all_slaves_active.attr, | 1664 | &dev_attr_all_slaves_active.attr, |
1665 | &dev_attr_resend_igmp.attr, | ||
1622 | NULL, | 1666 | NULL, |
1623 | }; | 1667 | }; |
1624 | 1668 | ||