aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding/bond_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/bonding/bond_main.c')
-rw-r--r--drivers/net/bonding/bond_main.c21
1 files changed, 6 insertions, 15 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index f100bd958b88..7a04f0f8449e 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -214,17 +214,6 @@ const struct bond_parm_tbl bond_lacp_tbl[] = {
214{ NULL, -1}, 214{ NULL, -1},
215}; 215};
216 216
217const struct bond_parm_tbl bond_mode_tbl[] = {
218{ "balance-rr", BOND_MODE_ROUNDROBIN},
219{ "active-backup", BOND_MODE_ACTIVEBACKUP},
220{ "balance-xor", BOND_MODE_XOR},
221{ "broadcast", BOND_MODE_BROADCAST},
222{ "802.3ad", BOND_MODE_8023AD},
223{ "balance-tlb", BOND_MODE_TLB},
224{ "balance-alb", BOND_MODE_ALB},
225{ NULL, -1},
226};
227
228const struct bond_parm_tbl xmit_hashtype_tbl[] = { 217const struct bond_parm_tbl xmit_hashtype_tbl[] = {
229{ "layer2", BOND_XMIT_POLICY_LAYER2}, 218{ "layer2", BOND_XMIT_POLICY_LAYER2},
230{ "layer3+4", BOND_XMIT_POLICY_LAYER34}, 219{ "layer3+4", BOND_XMIT_POLICY_LAYER34},
@@ -4028,18 +4017,20 @@ int bond_parse_parm(const char *buf, const struct bond_parm_tbl *tbl)
4028static int bond_check_params(struct bond_params *params) 4017static int bond_check_params(struct bond_params *params)
4029{ 4018{
4030 int arp_validate_value, fail_over_mac_value, primary_reselect_value, i; 4019 int arp_validate_value, fail_over_mac_value, primary_reselect_value, i;
4020 struct bond_opt_value newval, *valptr;
4031 int arp_all_targets_value; 4021 int arp_all_targets_value;
4032 4022
4033 /* 4023 /*
4034 * Convert string parameters. 4024 * Convert string parameters.
4035 */ 4025 */
4036 if (mode) { 4026 if (mode) {
4037 bond_mode = bond_parse_parm(mode, bond_mode_tbl); 4027 bond_opt_initstr(&newval, mode);
4038 if (bond_mode == -1) { 4028 valptr = bond_opt_parse(bond_opt_get(BOND_OPT_MODE), &newval);
4039 pr_err("Error: Invalid bonding mode \"%s\"\n", 4029 if (!valptr) {
4040 mode == NULL ? "NULL" : mode); 4030 pr_err("Error: Invalid bonding mode \"%s\"\n", mode);
4041 return -EINVAL; 4031 return -EINVAL;
4042 } 4032 }
4033 bond_mode = valptr->value;
4043 } 4034 }
4044 4035
4045 if (xmit_hash_policy) { 4036 if (xmit_hash_policy) {