summaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding/bond_options.c
diff options
context:
space:
mode:
authorsfeldma@cumulusnetworks.com <sfeldma@cumulusnetworks.com>2013-12-15 16:41:58 -0800
committerDavid S. Miller <davem@davemloft.net>2013-12-17 16:08:45 -0500
commit8a41ae4496e534a8b68d9bc3c79113e16d1fcd4c (patch)
tree35d4639e01bd1dc9ba1bbbcc7b4e4720bc651595 /drivers/net/bonding/bond_options.c
parent0a98a0d12c40f9354b942325045cae123d594341 (diff)
downloadtalos-op-linux-8a41ae4496e534a8b68d9bc3c79113e16d1fcd4c.tar.gz
talos-op-linux-8a41ae4496e534a8b68d9bc3c79113e16d1fcd4c.zip
bonding: add primary_select attribute netlink support
Add IFLA_BOND_PRIMARY_SELECT to allow get/set of bonding parameter primary_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.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/net/bonding/bond_options.c b/drivers/net/bonding/bond_options.c
index c410d2d0dc33..80a9df4e4bf7 100644
--- a/drivers/net/bonding/bond_options.c
+++ b/drivers/net/bonding/bond_options.c
@@ -519,3 +519,19 @@ out:
return err;
}
+
+int bond_option_primary_reselect_set(struct bonding *bond, int primary_reselect)
+{
+ bond->params.primary_reselect = primary_reselect;
+ pr_info("%s: setting primary_reselect to %s (%d).\n",
+ bond->dev->name, pri_reselect_tbl[primary_reselect].modename,
+ primary_reselect);
+
+ block_netpoll_tx();
+ write_lock_bh(&bond->curr_slave_lock);
+ bond_select_active_slave(bond);
+ write_unlock_bh(&bond->curr_slave_lock);
+ unblock_netpoll_tx();
+
+ return 0;
+}
OpenPOWER on IntegriCloud