Skip to content

Commit 8b426dc

Browse files
Mahesh Bandewardavem330
authored andcommitted
bonding: remove hardcoded value
Eliminate hard-coded value and use the default that is set. Signed-off-by: Mahesh Bandewar <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 4493b81 commit 8b426dc

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

drivers/net/bonding/bond_main.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4254,6 +4254,7 @@ static int bond_check_params(struct bond_params *params)
42544254
int arp_all_targets_value;
42554255
u16 ad_actor_sys_prio = 0;
42564256
u16 ad_user_port_key = 0;
4257+
int tlb_dynamic_lb = 0;
42574258

42584259
/* Convert string parameters. */
42594260
if (mode) {
@@ -4566,6 +4567,17 @@ static int bond_check_params(struct bond_params *params)
45664567
}
45674568
ad_user_port_key = valptr->value;
45684569

4570+
if (bond_mode == BOND_MODE_TLB) {
4571+
bond_opt_initstr(&newval, "default");
4572+
valptr = bond_opt_parse(bond_opt_get(BOND_OPT_TLB_DYNAMIC_LB),
4573+
&newval);
4574+
if (!valptr) {
4575+
pr_err("Error: No tlb_dynamic_lb default value");
4576+
return -EINVAL;
4577+
}
4578+
tlb_dynamic_lb = valptr->value;
4579+
}
4580+
45694581
if (lp_interval == 0) {
45704582
pr_warn("Warning: ip_interval must be between 1 and %d, so it was reset to %d\n",
45714583
INT_MAX, BOND_ALB_DEFAULT_LP_INTERVAL);
@@ -4593,7 +4605,7 @@ static int bond_check_params(struct bond_params *params)
45934605
params->min_links = min_links;
45944606
params->lp_interval = lp_interval;
45954607
params->packets_per_slave = packets_per_slave;
4596-
params->tlb_dynamic_lb = 1; /* Default value */
4608+
params->tlb_dynamic_lb = tlb_dynamic_lb;
45974609
params->ad_actor_sys_prio = ad_actor_sys_prio;
45984610
eth_zero_addr(params->ad_actor_system);
45994611
params->ad_user_port_key = ad_user_port_key;

0 commit comments

Comments
 (0)