|
@@ -201,12 +201,6 @@ atomic_t netpoll_block_tx = ATOMIC_INIT(0);
|
|
|
|
|
|
unsigned int bond_net_id __read_mostly;
|
|
|
|
|
|
-static __be32 arp_target[BOND_MAX_ARP_TARGETS];
|
|
|
-static int arp_ip_count;
|
|
|
-static int bond_mode = BOND_MODE_ROUNDROBIN;
|
|
|
-static int xmit_hashtype = BOND_XMIT_POLICY_LAYER2;
|
|
|
-static int lacp_fast;
|
|
|
-
|
|
|
/*-------------------------- Forward declarations ---------------------------*/
|
|
|
|
|
|
static int bond_init(struct net_device *bond_dev);
|
|
@@ -2575,10 +2569,8 @@ static bool bond_time_in_interval(struct bonding *bond, unsigned long last_act,
|
|
|
* arp is transmitted to generate traffic. see activebackup_arp_monitor for
|
|
|
* arp monitoring in active backup mode.
|
|
|
*/
|
|
|
-static void bond_loadbalance_arp_mon(struct work_struct *work)
|
|
|
+static void bond_loadbalance_arp_mon(struct bonding *bond)
|
|
|
{
|
|
|
- struct bonding *bond = container_of(work, struct bonding,
|
|
|
- arp_work.work);
|
|
|
struct slave *slave, *oldcurrent;
|
|
|
struct list_head *iter;
|
|
|
int do_failover = 0, slave_state_changed = 0;
|
|
@@ -2916,10 +2908,8 @@ check_state:
|
|
|
return should_notify_rtnl;
|
|
|
}
|
|
|
|
|
|
-static void bond_activebackup_arp_mon(struct work_struct *work)
|
|
|
+static void bond_activebackup_arp_mon(struct bonding *bond)
|
|
|
{
|
|
|
- struct bonding *bond = container_of(work, struct bonding,
|
|
|
- arp_work.work);
|
|
|
bool should_notify_peers = false;
|
|
|
bool should_notify_rtnl = false;
|
|
|
int delta_in_ticks;
|
|
@@ -2972,6 +2962,17 @@ re_arm:
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+static void bond_arp_monitor(struct work_struct *work)
|
|
|
+{
|
|
|
+ struct bonding *bond = container_of(work, struct bonding,
|
|
|
+ arp_work.work);
|
|
|
+
|
|
|
+ if (BOND_MODE(bond) == BOND_MODE_ACTIVEBACKUP)
|
|
|
+ bond_activebackup_arp_mon(bond);
|
|
|
+ else
|
|
|
+ bond_loadbalance_arp_mon(bond);
|
|
|
+}
|
|
|
+
|
|
|
/*-------------------------- netdev event handling --------------------------*/
|
|
|
|
|
|
/* Change device name */
|
|
@@ -3228,10 +3229,7 @@ static void bond_work_init_all(struct bonding *bond)
|
|
|
bond_resend_igmp_join_requests_delayed);
|
|
|
INIT_DELAYED_WORK(&bond->alb_work, bond_alb_monitor);
|
|
|
INIT_DELAYED_WORK(&bond->mii_work, bond_mii_monitor);
|
|
|
- if (BOND_MODE(bond) == BOND_MODE_ACTIVEBACKUP)
|
|
|
- INIT_DELAYED_WORK(&bond->arp_work, bond_activebackup_arp_mon);
|
|
|
- else
|
|
|
- INIT_DELAYED_WORK(&bond->arp_work, bond_loadbalance_arp_mon);
|
|
|
+ INIT_DELAYED_WORK(&bond->arp_work, bond_arp_monitor);
|
|
|
INIT_DELAYED_WORK(&bond->ad_work, bond_3ad_state_machine_handler);
|
|
|
INIT_DELAYED_WORK(&bond->slave_arr_work, bond_slave_arr_handler);
|
|
|
}
|
|
@@ -3266,8 +3264,6 @@ static int bond_open(struct net_device *bond_dev)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- bond_work_init_all(bond);
|
|
|
-
|
|
|
if (bond_is_lb(bond)) {
|
|
|
/* bond_alb_initialize must be called before the timer
|
|
|
* is started.
|
|
@@ -4252,6 +4248,12 @@ static int bond_check_params(struct bond_params *params)
|
|
|
int arp_all_targets_value;
|
|
|
u16 ad_actor_sys_prio = 0;
|
|
|
u16 ad_user_port_key = 0;
|
|
|
+ __be32 arp_target[BOND_MAX_ARP_TARGETS];
|
|
|
+ int arp_ip_count;
|
|
|
+ int bond_mode = BOND_MODE_ROUNDROBIN;
|
|
|
+ int xmit_hashtype = BOND_XMIT_POLICY_LAYER2;
|
|
|
+ int lacp_fast = 0;
|
|
|
+ int tlb_dynamic_lb = 0;
|
|
|
|
|
|
/* Convert string parameters. */
|
|
|
if (mode) {
|
|
@@ -4564,6 +4566,17 @@ static int bond_check_params(struct bond_params *params)
|
|
|
}
|
|
|
ad_user_port_key = valptr->value;
|
|
|
|
|
|
+ if (bond_mode == BOND_MODE_TLB) {
|
|
|
+ bond_opt_initstr(&newval, "default");
|
|
|
+ valptr = bond_opt_parse(bond_opt_get(BOND_OPT_TLB_DYNAMIC_LB),
|
|
|
+ &newval);
|
|
|
+ if (!valptr) {
|
|
|
+ pr_err("Error: No tlb_dynamic_lb default value");
|
|
|
+ return -EINVAL;
|
|
|
+ }
|
|
|
+ tlb_dynamic_lb = valptr->value;
|
|
|
+ }
|
|
|
+
|
|
|
if (lp_interval == 0) {
|
|
|
pr_warn("Warning: ip_interval must be between 1 and %d, so it was reset to %d\n",
|
|
|
INT_MAX, BOND_ALB_DEFAULT_LP_INTERVAL);
|
|
@@ -4591,7 +4604,7 @@ static int bond_check_params(struct bond_params *params)
|
|
|
params->min_links = min_links;
|
|
|
params->lp_interval = lp_interval;
|
|
|
params->packets_per_slave = packets_per_slave;
|
|
|
- params->tlb_dynamic_lb = 1; /* Default value */
|
|
|
+ params->tlb_dynamic_lb = tlb_dynamic_lb;
|
|
|
params->ad_actor_sys_prio = ad_actor_sys_prio;
|
|
|
eth_zero_addr(params->ad_actor_system);
|
|
|
params->ad_user_port_key = ad_user_port_key;
|
|
@@ -4687,6 +4700,8 @@ int bond_create(struct net *net, const char *name)
|
|
|
|
|
|
netif_carrier_off(bond_dev);
|
|
|
|
|
|
+ bond_work_init_all(bond);
|
|
|
+
|
|
|
rtnl_unlock();
|
|
|
if (res < 0)
|
|
|
bond_destructor(bond_dev);
|