diff options
author | Nikolay Aleksandrov <nikolay@redhat.com> | 2014-01-22 08:53:27 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-01-22 18:38:42 -0500 |
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 6d1515db6ca8..f3bfcafc96a4 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; | |||
207 | static int xmit_hashtype = BOND_XMIT_POLICY_LAYER2; | 207 | static int xmit_hashtype = BOND_XMIT_POLICY_LAYER2; |
208 | static int lacp_fast; | 208 | static int lacp_fast; |
209 | 209 | ||
210 | const struct bond_parm_tbl bond_lacp_tbl[] = { | ||
211 | { "slow", AD_LACP_SLOW}, | ||
212 | { "fast", AD_LACP_FAST}, | ||
213 | { NULL, -1}, | ||
214 | }; | ||
215 | |||
216 | const struct bond_parm_tbl pri_reselect_tbl[] = { | 210 | const struct bond_parm_tbl pri_reselect_tbl[] = { |
217 | { "always", BOND_PRI_RESELECT_ALWAYS}, | 211 | { "always", BOND_PRI_RESELECT_ALWAYS}, |
218 | { "better", BOND_PRI_RESELECT_BETTER}, | 212 | { "better", BOND_PRI_RESELECT_BETTER}, |
@@ -4025,12 +4019,15 @@ static int bond_check_params(struct bond_params *params) | |||
4025 | pr_info("lacp_rate param is irrelevant in mode %s\n", | 4019 | pr_info("lacp_rate param is irrelevant in mode %s\n", |
4026 | bond_mode_name(bond_mode)); | 4020 | bond_mode_name(bond_mode)); |
4027 | } else { | 4021 | } else { |
4028 | lacp_fast = bond_parse_parm(lacp_rate, bond_lacp_tbl); | 4022 | bond_opt_initstr(&newval, lacp_rate); |
4029 | if (lacp_fast == -1) { | 4023 | valptr = bond_opt_parse(bond_opt_get(BOND_OPT_LACP_RATE), |
4024 | &newval); | ||
4025 | if (!valptr) { | ||
4030 | pr_err("Error: Invalid lacp rate \"%s\"\n", | 4026 | pr_err("Error: Invalid lacp rate \"%s\"\n", |
4031 | lacp_rate == NULL ? "NULL" : lacp_rate); | 4027 | lacp_rate); |
4032 | return -EINVAL; | 4028 | return -EINVAL; |
4033 | } | 4029 | } |
4030 | lacp_fast = valptr->value; | ||
4034 | } | 4031 | } |
4035 | } | 4032 | } |
4036 | 4033 | ||