diff options
author | Nikolay Aleksandrov <nikolay@redhat.com> | 2014-01-22 14:53:19 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-01-22 15:38:41 -0800 |
commit | a4b32ce7f891d507aa663bc78118ef267f0d6d4c (patch) | |
tree | 292a816b471d2aac09e070835eaf6535b70df2f9 /drivers/net/bonding/bond_main.c | |
parent | aa59d8517d1017e571b803ba6302c4b693b324ab (diff) | |
download | lwn-a4b32ce7f891d507aa663bc78118ef267f0d6d4c.tar.gz lwn-a4b32ce7f891d507aa663bc78118ef267f0d6d4c.zip |
bonding: convert xmit_hash_policy to use the new option API
This patch adds the necessary changes so xmit_hash_policy would use the
new bonding option API. Also fix some trivial/style errors.
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 | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index a50577bc8bc1..6aacb49034f3 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -214,15 +214,6 @@ const struct bond_parm_tbl bond_lacp_tbl[] = { { NULL, -1}, }; -const struct bond_parm_tbl xmit_hashtype_tbl[] = { -{ "layer2", BOND_XMIT_POLICY_LAYER2}, -{ "layer3+4", BOND_XMIT_POLICY_LAYER34}, -{ "layer2+3", BOND_XMIT_POLICY_LAYER23}, -{ "encap2+3", BOND_XMIT_POLICY_ENCAP23}, -{ "encap3+4", BOND_XMIT_POLICY_ENCAP34}, -{ NULL, -1}, -}; - const struct bond_parm_tbl arp_all_targets_tbl[] = { { "any", BOND_ARP_TARGETS_ANY}, { "all", BOND_ARP_TARGETS_ALL}, @@ -4039,14 +4030,15 @@ static int bond_check_params(struct bond_params *params) pr_info("xmit_hash_policy param is irrelevant in mode %s\n", bond_mode_name(bond_mode)); } else { - xmit_hashtype = bond_parse_parm(xmit_hash_policy, - xmit_hashtype_tbl); - if (xmit_hashtype == -1) { + bond_opt_initstr(&newval, xmit_hash_policy); + valptr = bond_opt_parse(bond_opt_get(BOND_OPT_XMIT_HASH), + &newval); + if (!valptr) { pr_err("Error: Invalid xmit_hash_policy \"%s\"\n", - xmit_hash_policy == NULL ? "NULL" : xmit_hash_policy); return -EINVAL; } + xmit_hashtype = valptr->value; } } |