Lines Matching full:bond
136 * __get_first_agg - get the first aggregator in the bond
139 * Return the aggregator of the first slave in @bond, or %NULL if it can't be
145 struct bonding *bond = __get_bond_by_port(port); in __get_first_agg() local
149 /* If there's no bond for this port, or bond has no slaves */ in __get_first_agg()
150 if (bond == NULL) in __get_first_agg()
154 first_slave = bond_first_slave_rcu(bond); in __get_first_agg()
259 struct bonding *bond = __get_bond_by_port(port); in __get_agg_selection_mode() local
261 if (bond == NULL) in __get_agg_selection_mode()
264 return bond->params.ad_select; in __get_agg_selection_mode()
273 struct bonding *bond = __get_bond_by_port(port); in __check_agg_selection_timer() local
275 if (bond == NULL) in __check_agg_selection_timer()
278 return atomic_read(&BOND_AD_INFO(bond).agg_select_timer) ? 1 : 0; in __check_agg_selection_timer()
386 slave->bond->dev->name, in __get_link_speed()
394 slave_dbg(slave->bond->dev, slave->dev, "Port %d Received link speed %d update from adapter\n", in __get_link_speed()
419 …slave_dbg(slave->bond->dev, slave->dev, "Port %d Received status full duplex update from adapter\n… in __get_duplex()
425 …slave_dbg(slave->bond->dev, slave->dev, "Port %d Received status NOT full duplex update from adapt… in __get_duplex()
435 const struct bonding *bond = bond_get_bond_by_slave(port->slave); in __ad_actor_update_port() local
437 port->actor_system = BOND_AD_INFO(bond).system.sys_mac_addr; in __ad_actor_update_port()
438 port->actor_system_priority = BOND_AD_INFO(bond).system.sys_priority; in __ad_actor_update_port()
560 slave_dbg(port->slave->bond->dev, port->slave->dev, in __record_pdu()
564 slave_dbg(port->slave->bond->dev, port->slave->dev, in __record_pdu()
827 struct bonding *bond = aggregator->slave->bond; in __get_active_agg() local
831 bond_for_each_slave_rcu(bond, slave, iter) in __get_active_agg()
860 slave_dbg(port->slave->bond->dev, port->slave->dev, in __update_lacpdu_from_port()
908 atomic64_inc(&BOND_AD_INFO(slave->bond).stats.lacpdu_tx); in ad_lacpdu_send()
954 atomic64_inc(&BOND_AD_INFO(slave->bond).stats.marker_tx); in ad_marker_send()
958 atomic64_inc(&BOND_AD_INFO(slave->bond).stats.marker_resp_tx); in ad_marker_send()
992 struct bonding *bond = __get_bond_by_port(port); in ad_mux_machine() local
1053 if (!bond->params.coupled_control) in ad_mux_machine()
1133 slave_dbg(port->slave->bond->dev, port->slave->dev, in ad_mux_machine()
1211 atomic64_inc(&BOND_AD_INFO(port->slave->bond).stats.lacpdu_rx); in ad_rx_machine()
1265 slave_dbg(port->slave->bond->dev, port->slave->dev, in ad_rx_machine()
1317 slave_err(port->slave->bond->dev, port->slave->dev, "An illegal loopback occurred on slave\n" in ad_rx_machine()
1387 slave_dbg(port->slave->bond->dev, in ad_tx_machine()
1408 * @bond_params: bond parameters we will use
1470 slave_dbg(port->slave->bond->dev, port->slave->dev, in ad_periodic_machine()
1509 struct bonding *bond; in ad_port_selection_logic() local
1517 bond = __get_bond_by_port(port); in ad_port_selection_logic()
1549 slave_dbg(bond->dev, port->slave->dev, "Port %d left LAG %d\n", in ad_port_selection_logic()
1565 port->slave->bond->dev->name, in ad_port_selection_logic()
1572 bond_for_each_slave(bond, slave, iter) { in ad_port_selection_logic()
1598 slave_dbg(bond->dev, slave->dev, "Port %d joined LAG %d (existing LAG)\n", in ad_port_selection_logic()
1645 slave_dbg(bond->dev, port->slave->dev, "Port %d joined LAG %d (new LAG)\n", in ad_port_selection_logic()
1649 slave_err(bond->dev, port->slave->dev, in ad_port_selection_logic()
1732 curr->slave->bond->dev->name, in ad_agg_selection_test()
1774 * set of slaves in the bond changes.
1778 * set of slaves in the bond changes.
1780 * FIXME: this function MUST be called with the first agg in the bond, or
1782 * called with the bond itself, and retrieve the first agg from it.
1788 struct bonding *bond = agg->slave->bond; in ad_agg_selection_logic() local
1798 bond_for_each_slave_rcu(bond, slave, iter) { in ad_agg_selection_logic()
1834 netdev_dbg(bond->dev, "(slave %s): best Agg=%d; P=%d; a k=%d; p k=%d; Ind=%d; Act=%d\n", in ad_agg_selection_logic()
1840 netdev_dbg(bond->dev, "(slave %s): best ports %p slave %p\n", in ad_agg_selection_logic()
1844 bond_for_each_slave_rcu(bond, slave, iter) { in ad_agg_selection_logic()
1847 slave_dbg(bond->dev, slave->dev, "Agg=%d; P=%d; a k=%d; p k=%d; Ind=%d; Act=%d\n", in ad_agg_selection_logic()
1856 …atelimited("%s: Warning: No 802.3ad response from the link partner for any adapters in the bond\n", in ad_agg_selection_logic()
1857 bond->dev->name); in ad_agg_selection_logic()
1860 netdev_dbg(bond->dev, "(slave %s): LAG %d chosen as the active LAG\n", in ad_agg_selection_logic()
1863 netdev_dbg(bond->dev, "(slave %s): Agg=%d; P=%d; a k=%d; p k=%d; Ind=%d; Act=%d\n", in ad_agg_selection_logic()
1900 bond_3ad_set_carrier(bond); in ad_agg_selection_logic()
2020 slave_dbg(slave->bond->dev, slave->dev, in ad_enable_collecting()
2036 slave_dbg(port->slave->bond->dev, port->slave->dev, in ad_disable_distributing()
2057 slave_dbg(port->slave->bond->dev, port->slave->dev, in ad_enable_collecting_distributing()
2076 slave_dbg(port->slave->bond->dev, port->slave->dev, in ad_disable_collecting_distributing()
2097 atomic64_inc(&BOND_AD_INFO(port->slave->bond).stats.marker_rx); in ad_marker_info_received()
2106 slave_dbg(port->slave->bond->dev, port->slave->dev, in ad_marker_info_received()
2124 atomic64_inc(&BOND_AD_INFO(port->slave->bond).stats.marker_resp_rx); in ad_marker_response_received()
2136 * @bond: bonding struct
2141 * any down to up transitions of the bond.
2143 void bond_3ad_initiate_agg_selection(struct bonding *bond, int timeout) in bond_3ad_initiate_agg_selection() argument
2145 atomic_set(&BOND_AD_INFO(bond).agg_select_timer, timeout); in bond_3ad_initiate_agg_selection()
2149 * bond_3ad_initialize - initialize a bond's 802.3ad parameters and structures
2150 * @bond: bonding struct to work on
2152 * Can be called only after the mac address of the bond is set.
2154 void bond_3ad_initialize(struct bonding *bond) in bond_3ad_initialize() argument
2156 BOND_AD_INFO(bond).aggregator_identifier = 0; in bond_3ad_initialize()
2157 BOND_AD_INFO(bond).system.sys_priority = in bond_3ad_initialize()
2158 bond->params.ad_actor_sys_prio; in bond_3ad_initialize()
2159 if (is_zero_ether_addr(bond->params.ad_actor_system)) in bond_3ad_initialize()
2160 BOND_AD_INFO(bond).system.sys_mac_addr = in bond_3ad_initialize()
2161 *((struct mac_addr *)bond->dev->dev_addr); in bond_3ad_initialize()
2163 BOND_AD_INFO(bond).system.sys_mac_addr = in bond_3ad_initialize()
2164 *((struct mac_addr *)bond->params.ad_actor_system); in bond_3ad_initialize()
2166 bond_3ad_initiate_agg_selection(bond, in bond_3ad_initialize()
2180 struct bonding *bond = bond_get_bond_by_slave(slave); in bond_3ad_bind_slave() local
2190 ad_initialize_port(port, bond->params.lacp_fast); in bond_3ad_bind_slave()
2197 port->actor_admin_port_key = bond->params.ad_user_port_key << 6; in bond_3ad_bind_slave()
2199 /* actor system is the bond's system */ in bond_3ad_bind_slave()
2213 aggregator->aggregator_mac_address = *((struct mac_addr *)bond->dev->dev_addr); in bond_3ad_bind_slave()
2214 aggregator->aggregator_identifier = ++BOND_AD_INFO(bond).aggregator_identifier; in bond_3ad_bind_slave()
2234 struct bonding *bond = slave->bond; in bond_3ad_unbind_slave() local
2240 spin_lock_bh(&bond->mode_lock); in bond_3ad_unbind_slave()
2246 slave_warn(bond->dev, slave->dev, "Trying to unbind an uninitialized port\n"); in bond_3ad_unbind_slave()
2250 slave_dbg(bond->dev, slave->dev, "Unbinding Link Aggregation Group %d\n", in bond_3ad_unbind_slave()
2271 bond_for_each_slave(bond, slave_iter, iter) { in bond_3ad_unbind_slave()
2289 slave_dbg(bond->dev, slave->dev, "Some port(s) related to LAG %d - replacing with LAG %d\n", in bond_3ad_unbind_slave()
2295 slave_info(bond->dev, slave->dev, "Removing an active aggregator\n"); in bond_3ad_unbind_slave()
2326 …slave_warn(bond->dev, slave->dev, "unbinding aggregator, and could not find a new aggregator for i… in bond_3ad_unbind_slave()
2335 slave_info(bond->dev, slave->dev, "Removing an active aggregator\n"); in bond_3ad_unbind_slave()
2345 slave_dbg(bond->dev, slave->dev, "Unbinding port %d\n", port->actor_port_number); in bond_3ad_unbind_slave()
2348 bond_for_each_slave(bond, slave_iter, iter) { in bond_3ad_unbind_slave()
2369 slave_info(bond->dev, slave->dev, "Removing an active aggregator\n"); in bond_3ad_unbind_slave()
2382 spin_unlock_bh(&bond->mode_lock); in bond_3ad_unbind_slave()
2387 * @bond: bonding struct to work on
2390 * settings so the bond device will use the new values when it gets upped.
2392 void bond_3ad_update_ad_actor_settings(struct bonding *bond) in bond_3ad_update_ad_actor_settings() argument
2399 BOND_AD_INFO(bond).system.sys_priority = bond->params.ad_actor_sys_prio; in bond_3ad_update_ad_actor_settings()
2400 if (is_zero_ether_addr(bond->params.ad_actor_system)) in bond_3ad_update_ad_actor_settings()
2401 BOND_AD_INFO(bond).system.sys_mac_addr = in bond_3ad_update_ad_actor_settings()
2402 *((struct mac_addr *)bond->dev->dev_addr); in bond_3ad_update_ad_actor_settings()
2404 BOND_AD_INFO(bond).system.sys_mac_addr = in bond_3ad_update_ad_actor_settings()
2405 *((struct mac_addr *)bond->params.ad_actor_system); in bond_3ad_update_ad_actor_settings()
2407 spin_lock_bh(&bond->mode_lock); in bond_3ad_update_ad_actor_settings()
2408 bond_for_each_slave(bond, slave, iter) { in bond_3ad_update_ad_actor_settings()
2414 spin_unlock_bh(&bond->mode_lock); in bond_3ad_update_ad_actor_settings()
2419 * @bond: bonding structure
2423 static bool bond_agg_timer_advance(struct bonding *bond) in bond_agg_timer_advance() argument
2428 val = atomic_read(&BOND_AD_INFO(bond).agg_select_timer); in bond_agg_timer_advance()
2432 if (atomic_cmpxchg(&BOND_AD_INFO(bond).agg_select_timer, in bond_agg_timer_advance()
2450 * related to any aggregator, and selects the active aggregator for a bond.
2454 struct bonding *bond = container_of(work, struct bonding, in bond_3ad_state_machine_handler() local
2467 spin_lock_bh(&bond->mode_lock); in bond_3ad_state_machine_handler()
2471 if (!bond_has_slaves(bond)) in bond_3ad_state_machine_handler()
2474 if (bond_agg_timer_advance(bond)) { in bond_3ad_state_machine_handler()
2475 slave = bond_first_slave_rcu(bond); in bond_3ad_state_machine_handler()
2478 /* select the active aggregator for the bond */ in bond_3ad_state_machine_handler()
2481 net_warn_ratelimited("%s: Warning: bond's first port is uninitialized\n", in bond_3ad_state_machine_handler()
2482 bond->dev->name); in bond_3ad_state_machine_handler()
2489 bond_3ad_set_carrier(bond); in bond_3ad_state_machine_handler()
2493 bond_for_each_slave_rcu(bond, slave, iter) { in bond_3ad_state_machine_handler()
2497 bond->dev->name); in bond_3ad_state_machine_handler()
2502 ad_periodic_machine(port, &bond->params); in bond_3ad_state_machine_handler()
2514 bond_for_each_slave_rcu(bond, slave, iter) { in bond_3ad_state_machine_handler()
2521 spin_unlock_bh(&bond->mode_lock); in bond_3ad_state_machine_handler()
2524 bond_slave_arr_work_rearm(bond, 0); in bond_3ad_state_machine_handler()
2527 bond_slave_state_notify(bond); in bond_3ad_state_machine_handler()
2530 queue_delayed_work(bond->wq, &bond->ad_work, ad_delta_in_ticks); in bond_3ad_state_machine_handler()
2544 struct bonding *bond = slave->bond; in bond_3ad_rx_indication() local
2553 slave->dev->name, slave->bond->dev->name); in bond_3ad_rx_indication()
2560 slave_dbg(slave->bond->dev, slave->dev, in bond_3ad_rx_indication()
2564 spin_lock(&slave->bond->mode_lock); in bond_3ad_rx_indication()
2566 spin_unlock(&slave->bond->mode_lock); in bond_3ad_rx_indication()
2576 slave_dbg(slave->bond->dev, slave->dev, "Received Marker Information on port %d\n", in bond_3ad_rx_indication()
2581 slave_dbg(slave->bond->dev, slave->dev, "Received Marker Response on port %d\n", in bond_3ad_rx_indication()
2586 slave_dbg(slave->bond->dev, slave->dev, "Received an unknown Marker subtype on port %d\n", in bond_3ad_rx_indication()
2590 stat = &BOND_AD_INFO(bond).stats.marker_unknown_rx; in bond_3ad_rx_indication()
2596 atomic64_inc(&BOND_AD_INFO(bond).stats.lacpdu_unknown_rx); in bond_3ad_rx_indication()
2637 slave_err(port->slave->bond->dev, in ad_update_actor_keys()
2665 slave_warn(slave->bond->dev, slave->dev, in bond_3ad_adapter_speed_duplex_changed()
2670 spin_lock_bh(&slave->bond->mode_lock); in bond_3ad_adapter_speed_duplex_changed()
2672 spin_unlock_bh(&slave->bond->mode_lock); in bond_3ad_adapter_speed_duplex_changed()
2673 slave_dbg(slave->bond->dev, slave->dev, "Port %d changed speed/duplex\n", in bond_3ad_adapter_speed_duplex_changed()
2694 slave_warn(slave->bond->dev, slave->dev, "link status changed for uninitialized port\n"); in bond_3ad_handle_link_change()
2698 spin_lock_bh(&slave->bond->mode_lock); in bond_3ad_handle_link_change()
2717 spin_unlock_bh(&slave->bond->mode_lock); in bond_3ad_handle_link_change()
2719 slave_dbg(slave->bond->dev, slave->dev, "Port %d changed link status to %s\n", in bond_3ad_handle_link_change()
2726 bond_update_slave_arr(slave->bond, NULL); in bond_3ad_handle_link_change()
2731 * @bond: bonding structure
2742 int bond_3ad_set_carrier(struct bonding *bond) in bond_3ad_set_carrier() argument
2749 first_slave = bond_first_slave_rcu(bond); in bond_3ad_set_carrier()
2757 if (__agg_active_ports(active) < bond->params.min_links) { in bond_3ad_set_carrier()
2758 if (netif_carrier_ok(bond->dev)) { in bond_3ad_set_carrier()
2759 netif_carrier_off(bond->dev); in bond_3ad_set_carrier()
2762 } else if (!netif_carrier_ok(bond->dev)) { in bond_3ad_set_carrier()
2763 netif_carrier_on(bond->dev); in bond_3ad_set_carrier()
2766 } else if (netif_carrier_ok(bond->dev)) { in bond_3ad_set_carrier()
2767 netif_carrier_off(bond->dev); in bond_3ad_set_carrier()
2776 * @bond: bonding struct to work on
2777 * @ad_info: ad_info struct to fill with the bond's info
2782 int __bond_3ad_get_active_agg_info(struct bonding *bond, in __bond_3ad_get_active_agg_info() argument
2790 bond_for_each_slave_rcu(bond, slave, iter) { in __bond_3ad_get_active_agg_info()
2810 int bond_3ad_get_active_agg_info(struct bonding *bond, struct ad_info *ad_info) in bond_3ad_get_active_agg_info() argument
2815 ret = __bond_3ad_get_active_agg_info(bond, ad_info); in bond_3ad_get_active_agg_info()
2821 int bond_3ad_lacpdu_recv(const struct sk_buff *skb, struct bonding *bond, in bond_3ad_lacpdu_recv() argument
2835 atomic64_inc(&BOND_AD_INFO(bond).stats.lacpdu_illegal_rx); in bond_3ad_lacpdu_recv()
2844 * @bond: bonding struct
2849 * Hold bond->mode_lock,
2851 * no matter bond is up or down.
2853 void bond_3ad_update_lacp_rate(struct bonding *bond) in bond_3ad_update_lacp_rate() argument
2860 lacp_fast = bond->params.lacp_fast; in bond_3ad_update_lacp_rate()
2861 spin_lock_bh(&bond->mode_lock); in bond_3ad_update_lacp_rate()
2862 bond_for_each_slave(bond, slave, iter) { in bond_3ad_update_lacp_rate()
2869 spin_unlock_bh(&bond->mode_lock); in bond_3ad_update_lacp_rate()