summaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding/bond_main.c
diff options
context:
space:
mode:
authorNikolay Aleksandrov2014-01-22 14:53:19 +0100
committerDavid S. Miller2014-01-23 00:38:41 +0100
commita4b32ce7f891d507aa663bc78118ef267f0d6d4c (patch)
tree292a816b471d2aac09e070835eaf6535b70df2f9 /drivers/net/bonding/bond_main.c
parentbonding: convert packets_per_slave to use the new option API (diff)
downloadkernel-qcow2-linux-a4b32ce7f891d507aa663bc78118ef267f0d6d4c.tar.gz
kernel-qcow2-linux-a4b32ce7f891d507aa663bc78118ef267f0d6d4c.tar.xz
kernel-qcow2-linux-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.c18
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;
}
}