summaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding/bond_main.c
diff options
context:
space:
mode:
authorNikolay Aleksandrov2014-01-22 14:53:33 +0100
committerDavid S. Miller2014-01-23 00:38:43 +0100
commit388d3a6d4aa356b885bcd023c185060df9ea2484 (patch)
tree4d48b059fc62aac5d47907eca55cc1f10379636c /drivers/net/bonding/bond_main.c
parentbonding: convert primary to use the new option API (diff)
downloadkernel-qcow2-linux-388d3a6d4aa356b885bcd023c185060df9ea2484.tar.gz
kernel-qcow2-linux-388d3a6d4aa356b885bcd023c185060df9ea2484.tar.xz
kernel-qcow2-linux-388d3a6d4aa356b885bcd023c185060df9ea2484.zip
bonding: convert primary_reselect to use the new option API
This patch adds the necessary changes so primary_reselect would use the new bonding option API. Signed-off-by: Nikolay Aleksandrov <nikolay@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding/bond_main.c')
-rw-r--r--drivers/net/bonding/bond_main.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index f606e2c3724c..59edf18602d9 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -206,13 +206,6 @@ static int bond_mode = BOND_MODE_ROUNDROBIN;
static int xmit_hashtype = BOND_XMIT_POLICY_LAYER2;
static int lacp_fast;
-const struct bond_parm_tbl pri_reselect_tbl[] = {
-{ "always", BOND_PRI_RESELECT_ALWAYS},
-{ "better", BOND_PRI_RESELECT_BETTER},
-{ "failure", BOND_PRI_RESELECT_FAILURE},
-{ NULL, -1},
-};
-
/*-------------------------- Forward declarations ---------------------------*/
static int bond_init(struct net_device *bond_dev);
@@ -4248,14 +4241,15 @@ static int bond_check_params(struct bond_params *params)
}
if (primary && primary_reselect) {
- primary_reselect_value = bond_parse_parm(primary_reselect,
- pri_reselect_tbl);
- if (primary_reselect_value == -1) {
+ bond_opt_initstr(&newval, primary_reselect);
+ valptr = bond_opt_parse(bond_opt_get(BOND_OPT_PRIMARY_RESELECT),
+ &newval);
+ if (!valptr) {
pr_err("Error: Invalid primary_reselect \"%s\"\n",
- primary_reselect ==
- NULL ? "NULL" : primary_reselect);
+ primary_reselect);
return -EINVAL;
}
+ primary_reselect_value = valptr->value;
} else {
primary_reselect_value = BOND_PRI_RESELECT_ALWAYS;
}