|
@@ -2473,3 +2473,34 @@ void bond_3ad_lacpdu_recv(struct sk_buff *skb, struct bonding *bond,
|
|
bond_3ad_rx_indication((struct lacpdu *) skb->data, slave, skb->len);
|
|
bond_3ad_rx_indication((struct lacpdu *) skb->data, slave, skb->len);
|
|
read_unlock(&bond->lock);
|
|
read_unlock(&bond->lock);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+/*
|
|
|
|
+ * When modify lacp_rate parameter via sysfs,
|
|
|
|
+ * update actor_oper_port_state of each port.
|
|
|
|
+ *
|
|
|
|
+ * Hold slave->state_machine_lock,
|
|
|
|
+ * so we can modify port->actor_oper_port_state,
|
|
|
|
+ * no matter bond is up or down.
|
|
|
|
+ */
|
|
|
|
+void bond_3ad_update_lacp_rate(struct bonding *bond)
|
|
|
|
+{
|
|
|
|
+ int i;
|
|
|
|
+ struct slave *slave;
|
|
|
|
+ struct port *port = NULL;
|
|
|
|
+ int lacp_fast;
|
|
|
|
+
|
|
|
|
+ read_lock(&bond->lock);
|
|
|
|
+ lacp_fast = bond->params.lacp_fast;
|
|
|
|
+
|
|
|
|
+ bond_for_each_slave(bond, slave, i) {
|
|
|
|
+ port = &(SLAVE_AD_INFO(slave).port);
|
|
|
|
+ __get_state_machine_lock(port);
|
|
|
|
+ if (lacp_fast)
|
|
|
|
+ port->actor_oper_port_state |= AD_STATE_LACP_TIMEOUT;
|
|
|
|
+ else
|
|
|
|
+ port->actor_oper_port_state &= ~AD_STATE_LACP_TIMEOUT;
|
|
|
|
+ __release_state_machine_lock(port);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ read_unlock(&bond->lock);
|
|
|
|
+}
|