diff options
author | Nikolay Aleksandrov <nikolay@redhat.com> | 2014-01-22 14:53:27 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-01-22 15:38:42 -0800 |
commit | d3131de76b1b1a4d95f145846bd61f96e72f0411 (patch) | |
tree | e78a441b8ece24edd7fb049d67a70a6836b282ca /drivers/net/bonding/bond_main.c | |
parent | e499461275023e20c4aecb6a546e7e213631b99f (diff) |
bonding: convert lacp_rate to use the new option API
This patch adds the necessary changes so lacp_rate would use
the new bonding option API. Also some trivial/style error fixes.
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.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 6d1515db6ca..f3bfcafc96a 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -207,12 +207,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 bond_lacp_tbl[] = { -{ "slow", AD_LACP_SLOW}, -{ "fast", AD_LACP_FAST}, -{ NULL, -1}, -}; - const struct bond_parm_tbl pri_reselect_tbl[] = { { "always", BOND_PRI_RESELECT_ALWAYS}, { "better", BOND_PRI_RESELECT_BETTER}, @@ -4025,12 +4019,15 @@ static int bond_check_params(struct bond_params *params) pr_info("lacp_rate param is irrelevant in mode %s\n", bond_mode_name(bond_mode)); } else { - lacp_fast = bond_parse_parm(lacp_rate, bond_lacp_tbl); - if (lacp_fast == -1) { + bond_opt_initstr(&newval, lacp_rate); + valptr = bond_opt_parse(bond_opt_get(BOND_OPT_LACP_RATE), + &newval); + if (!valptr) { pr_err("Error: Invalid lacp rate \"%s\"\n", - lacp_rate == NULL ? "NULL" : lacp_rate); + lacp_rate); return -EINVAL; } + lacp_fast = valptr->value; } } |