summaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding/bond_netlink.c
diff options
context:
space:
mode:
authorsfeldma@cumulusnetworks.com2013-12-18 06:30:30 +0100
committerDavid S. Miller2013-12-20 00:32:09 +0100
commit8d836d092ed7b77d13ac1108399165ee7de7463f (patch)
tree9e770f00a9bd16ad7b092977928890e6ed7586c2 /drivers/net/bonding/bond_netlink.c
parentbonding: add min_links attribute netlink support (diff)
downloadkernel-qcow2-linux-8d836d092ed7b77d13ac1108399165ee7de7463f.tar.gz
kernel-qcow2-linux-8d836d092ed7b77d13ac1108399165ee7de7463f.tar.xz
kernel-qcow2-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_netlink.c')
-rw-r--r--drivers/net/bonding/bond_netlink.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/net/bonding/bond_netlink.c b/drivers/net/bonding/bond_netlink.c
index ac9a10c90a50..6c8339bec1bf 100644
--- a/drivers/net/bonding/bond_netlink.c
+++ b/drivers/net/bonding/bond_netlink.c
@@ -40,6 +40,7 @@ static const struct nla_policy bond_policy[IFLA_BOND_MAX + 1] = {
[IFLA_BOND_NUM_PEER_NOTIF] = { .type = NLA_U8 },
[IFLA_BOND_ALL_SLAVES_ACTIVE] = { .type = NLA_U8 },
[IFLA_BOND_MIN_LINKS] = { .type = NLA_U32 },
+ [IFLA_BOND_LP_INTERVAL] = { .type = NLA_U32 },
};
static int bond_validate(struct nlattr *tb[], struct nlattr *data[])
@@ -232,6 +233,14 @@ static int bond_changelink(struct net_device *bond_dev,
if (err)
return err;
}
+ if (data[IFLA_BOND_LP_INTERVAL]) {
+ int lp_interval =
+ nla_get_u32(data[IFLA_BOND_LP_INTERVAL]);
+
+ err = bond_option_lp_interval_set(bond, lp_interval);
+ if (err)
+ return err;
+ }
return 0;
}
@@ -268,6 +277,7 @@ static size_t bond_get_size(const struct net_device *bond_dev)
nla_total_size(sizeof(u8)) + /* IFLA_BOND_NUM_PEER_NOTIF */
nla_total_size(sizeof(u8)) + /* IFLA_BOND_ALL_SLAVES_ACTIVE */
nla_total_size(sizeof(u32)) + /* IFLA_BOND_MIN_LINKS */
+ nla_total_size(sizeof(u32)) + /* IFLA_BOND_LP_INTERVAL */
0;
}
@@ -360,6 +370,10 @@ static int bond_fill_info(struct sk_buff *skb,
bond->params.min_links))
goto nla_put_failure;
+ if (nla_put_u32(skb, IFLA_BOND_LP_INTERVAL,
+ bond->params.lp_interval))
+ goto nla_put_failure;
+
return 0;
nla_put_failure: