summaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding/bond_sysfs.c
diff options
context:
space:
mode:
authorsfeldma@cumulusnetworks.com <sfeldma@cumulusnetworks.com>2013-12-17 21:30:30 -0800
committerDavid S. Miller <davem@davemloft.net>2013-12-19 18:32:09 -0500
commit8d836d092ed7b77d13ac1108399165ee7de7463f (patch)
tree9e770f00a9bd16ad7b092977928890e6ed7586c2 /drivers/net/bonding/bond_sysfs.c
parent7d1010082785b2020b1e2e1211b76209976a33df (diff)
downloadblackbird-op-linux-8d836d092ed7b77d13ac1108399165ee7de7463f.tar.gz
blackbird-op-linux-8d836d092ed7b77d13ac1108399165ee7de7463f.zip
bonding: add lp_interval attribute netlink support
Add IFLA_BOND_LP_INTERVAL to allow get/set of bonding parameter lp_interval via netlink. Signed-off-by: Scott Feldman <sfeldma@cumulusnetworks.com> Signed-off-by: Jiri Pirko <jiri@resnulli.us> 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.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c
index 359adda17dba..c4cdbf6469ae 100644
--- a/drivers/net/bonding/bond_sysfs.c
+++ b/drivers/net/bonding/bond_sysfs.c
@@ -1369,24 +1369,22 @@ static ssize_t bonding_store_lp_interval(struct device *d,
const char *buf, size_t count)
{
struct bonding *bond = to_bond(d);
- int new_value, ret = count;
+ int new_value, ret;
if (sscanf(buf, "%d", &new_value) != 1) {
pr_err("%s: no lp interval value specified.\n",
bond->dev->name);
- ret = -EINVAL;
- goto out;
+ return -EINVAL;
}
- if (new_value <= 0) {
- pr_err ("%s: lp_interval must be between 1 and %d\n",
- bond->dev->name, INT_MAX);
- ret = -EINVAL;
- goto out;
- }
+ if (!rtnl_trylock())
+ return restart_syscall();
- bond->params.lp_interval = new_value;
-out:
+ ret = bond_option_lp_interval_set(bond, new_value);
+ if (!ret)
+ ret = count;
+
+ rtnl_unlock();
return ret;
}
OpenPOWER on IntegriCloud