summaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding/bond_options.c
diff options
context:
space:
mode:
authorsfeldma@cumulusnetworks.com2014-01-03 23:18:49 +0100
committerDavid S. Miller2014-01-04 03:03:21 +0100
commitec029fac3e96980fa8f6f81b8327787a9600dfaa (patch)
tree81313ab42dfee3f1795dd250aa94217f73543939 /drivers/net/bonding/bond_options.c
parentbonding: add lacp_rate attribute netlink support (diff)
downloadkernel-qcow2-linux-ec029fac3e96980fa8f6f81b8327787a9600dfaa.tar.gz
kernel-qcow2-linux-ec029fac3e96980fa8f6f81b8327787a9600dfaa.tar.xz
kernel-qcow2-linux-ec029fac3e96980fa8f6f81b8327787a9600dfaa.zip
bonding: add ad_select attribute netlink support
Add IFLA_BOND_AD_SELECT to allow get/set of bonding parameter ad_select via netlink. Signed-off-by: Scott Feldman <sfeldma@cumulusnetworks.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding/bond_options.c')
-rw-r--r--drivers/net/bonding/bond_options.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/net/bonding/bond_options.c b/drivers/net/bonding/bond_options.c
index ad67fbf1ba61..c9691bf0586c 100644
--- a/drivers/net/bonding/bond_options.c
+++ b/drivers/net/bonding/bond_options.c
@@ -685,3 +685,25 @@ int bond_option_lacp_rate_set(struct bonding *bond, int lacp_rate)
return 0;
}
+
+int bond_option_ad_select_set(struct bonding *bond, int ad_select)
+{
+ if (bond->dev->flags & IFF_UP) {
+ pr_err("%s: Unable to update ad_select because interface is up.\n",
+ bond->dev->name);
+ return -EPERM;
+ }
+
+ if (bond_parm_tbl_lookup(ad_select, ad_select_tbl) < 0) {
+ pr_err("%s: Ignoring invalid ad_select value %d.\n",
+ bond->dev->name, ad_select);
+ return -EINVAL;
+ }
+
+ bond->params.ad_select = ad_select;
+ pr_info("%s: Setting ad_select to %s (%d).\n",
+ bond->dev->name, ad_select_tbl[ad_select].modename,
+ ad_select);
+
+ return 0;
+}