Lines Matching full:slave
129 if (port->slave == NULL) in __get_bond_by_port()
132 return bond_get_bond_by_slave(port->slave); in __get_bond_by_port()
139 * Return the aggregator of the first slave in @bond, or %NULL if it can't be
146 struct slave *first_slave; in __get_first_agg()
174 * __disable_distributing_port - disable the port's slave for distributing.
178 * This will disable only distributing on the port's slave.
182 bond_set_slave_tx_disabled_flags(port->slave, BOND_SLAVE_NOTIFY_LATER); in __disable_distributing_port()
186 * __enable_collecting_port - enable the port's slave for collecting,
190 * This will enable only collecting on the port's slave.
194 struct slave *slave = port->slave; in __enable_collecting_port() local
196 if (slave->link == BOND_LINK_UP && bond_slave_is_up(slave)) in __enable_collecting_port()
197 bond_set_slave_rx_enabled_flags(slave, BOND_SLAVE_NOTIFY_LATER); in __enable_collecting_port()
201 * __disable_port - disable the port's slave
204 * This will disable both collecting and distributing on the port's slave.
208 bond_set_slave_inactive_flags(port->slave, BOND_SLAVE_NOTIFY_LATER); in __disable_port()
212 * __enable_port - enable the port's slave, if it's up
215 * This will enable both collecting and distributing on the port's slave.
219 struct slave *slave = port->slave; in __enable_port() local
221 if ((slave->link == BOND_LINK_UP) && bond_slave_is_up(slave)) in __enable_port()
222 bond_set_slave_active_flags(slave, BOND_SLAVE_NOTIFY_LATER); in __enable_port()
242 * __port_is_collecting_distributing - check if the port's slave is in the
248 return bond_is_active_slave(port->slave); in __port_is_collecting_distributing()
306 struct slave *slave = port->slave; in __get_link_speed() local
314 if (slave->link != BOND_LINK_UP) in __get_link_speed()
317 switch (slave->speed) { in __get_link_speed()
384 if (slave->speed != SPEED_UNKNOWN) in __get_link_speed()
385 pr_err_once("%s: (slave %s): unknown ethtool speed (%d) for port %d (set it to 0)\n", in __get_link_speed()
386 slave->bond->dev->name, in __get_link_speed()
387 slave->dev->name, slave->speed, 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()
409 struct slave *slave = port->slave; in __get_duplex() local
415 if (slave->link == BOND_LINK_UP) { in __get_duplex()
416 switch (slave->duplex) { in __get_duplex()
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()
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()
829 struct slave *slave; in __get_active_agg() local
831 bond_for_each_slave_rcu(bond, slave, iter) in __get_active_agg()
832 if (SLAVE_AD_INFO(slave)->aggregator.is_active) in __get_active_agg()
833 return &(SLAVE_AD_INFO(slave)->aggregator); in __get_active_agg()
860 slave_dbg(port->slave->bond->dev, port->slave->dev, in __update_lacpdu_from_port()
898 struct slave *slave = port->slave; in ad_lacpdu_send() local
907 atomic64_inc(&SLAVE_AD_INFO(slave)->stats.lacpdu_tx); in ad_lacpdu_send()
908 atomic64_inc(&BOND_AD_INFO(slave->bond).stats.lacpdu_tx); in ad_lacpdu_send()
910 skb->dev = slave->dev; in ad_lacpdu_send()
922 ether_addr_copy(lacpdu_header->hdr.h_source, slave->perm_hwaddr); in ad_lacpdu_send()
942 struct slave *slave = port->slave; in ad_marker_send() local
953 atomic64_inc(&SLAVE_AD_INFO(slave)->stats.marker_tx); in ad_marker_send()
954 atomic64_inc(&BOND_AD_INFO(slave->bond).stats.marker_tx); in ad_marker_send()
957 atomic64_inc(&SLAVE_AD_INFO(slave)->stats.marker_resp_tx); in ad_marker_send()
958 atomic64_inc(&BOND_AD_INFO(slave->bond).stats.marker_resp_tx); in ad_marker_send()
964 skb->dev = slave->dev; in ad_marker_send()
975 ether_addr_copy(marker_header->hdr.h_source, slave->perm_hwaddr); in ad_marker_send()
988 * @update_slave_arr: Does slave array need update?
1096 struct slave *slave = port->slave; in ad_mux_machine() local
1099 bond_is_slave_rx_disabled(slave)) { in ad_mux_machine()
1133 slave_dbg(port->slave->bond->dev, port->slave->dev, in ad_mux_machine()
1210 atomic64_inc(&SLAVE_AD_INFO(port->slave)->stats.lacpdu_rx); in ad_rx_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()
1388 port->slave->dev, in ad_tx_machine()
1470 slave_dbg(port->slave->bond->dev, port->slave->dev, in ad_periodic_machine()
1498 * @update_slave_arr: Does slave array need update?
1510 struct slave *slave; in ad_port_selection_logic() local
1549 slave_dbg(bond->dev, port->slave->dev, "Port %d left LAG %d\n", in ad_port_selection_logic()
1564 …net_warn_ratelimited("%s: (slave %s): Warning: Port %d was related to aggregator %d but was not on… in ad_port_selection_logic()
1565 port->slave->bond->dev->name, in ad_port_selection_logic()
1566 port->slave->dev->name, in ad_port_selection_logic()
1572 bond_for_each_slave(bond, slave, iter) { in ad_port_selection_logic()
1573 aggregator = &(SLAVE_AD_INFO(slave)->aggregator); 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()
1731 net_warn_ratelimited("%s: (slave %s): Impossible agg select mode %d\n", in ad_agg_selection_test()
1732 curr->slave->bond->dev->name, in ad_agg_selection_test()
1733 curr->slave->dev->name, in ad_agg_selection_test()
1750 if (netif_running(port->slave->dev) && in agg_device_up()
1751 netif_carrier_ok(port->slave->dev)) in agg_device_up()
1761 * @update_slave_arr: Does slave array need update?
1788 struct bonding *bond = agg->slave->bond; in ad_agg_selection_logic()
1790 struct slave *slave; in ad_agg_selection_logic() local
1798 bond_for_each_slave_rcu(bond, slave, iter) { in ad_agg_selection_logic()
1799 agg = &(SLAVE_AD_INFO(slave)->aggregator); 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()
1835 best->slave ? best->slave->dev->name : "NULL", in ad_agg_selection_logic()
1840 netdev_dbg(bond->dev, "(slave %s): best ports %p slave %p\n", in ad_agg_selection_logic()
1841 best->slave ? best->slave->dev->name : "NULL", in ad_agg_selection_logic()
1842 best->lag_ports, best->slave); in ad_agg_selection_logic()
1844 bond_for_each_slave_rcu(bond, slave, iter) { in ad_agg_selection_logic()
1845 agg = &(SLAVE_AD_INFO(slave)->aggregator); 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()
1860 netdev_dbg(bond->dev, "(slave %s): LAG %d chosen as the active LAG\n", in ad_agg_selection_logic()
1861 best->slave ? best->slave->dev->name : "NULL", 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()
1864 best->slave ? best->slave->dev->name : "NULL", in ad_agg_selection_logic()
1879 /* Slave array needs update. */ in ad_agg_selection_logic()
1922 aggregator->slave ? in ad_clear_agg()
1923 aggregator->slave->dev->name : "NULL", in ad_clear_agg()
1939 aggregator->slave = NULL; in ad_initialize_agg()
2018 struct slave *slave = port->slave; in ad_enable_collecting() local
2020 slave_dbg(slave->bond->dev, slave->dev, in ad_enable_collecting()
2031 * @update_slave_arr: Does slave array need update?
2036 slave_dbg(port->slave->bond->dev, port->slave->dev, in ad_disable_distributing()
2041 /* Slave array needs an update */ in ad_disable_distributing()
2049 * @update_slave_arr: Does slave array need update?
2057 slave_dbg(port->slave->bond->dev, port->slave->dev, in ad_enable_collecting_distributing()
2062 /* Slave array needs update */ in ad_enable_collecting_distributing()
2070 * @update_slave_arr: Does slave array need update?
2076 slave_dbg(port->slave->bond->dev, port->slave->dev, in ad_disable_collecting_distributing()
2081 /* Slave array needs an update */ in ad_disable_collecting_distributing()
2096 atomic64_inc(&SLAVE_AD_INFO(port->slave)->stats.marker_rx); in ad_marker_info_received()
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()
2123 atomic64_inc(&SLAVE_AD_INFO(port->slave)->stats.marker_resp_rx); in ad_marker_response_received()
2124 atomic64_inc(&BOND_AD_INFO(port->slave->bond).stats.marker_resp_rx); in ad_marker_response_received()
2172 * bond_3ad_bind_slave - initialize a slave's port
2173 * @slave: slave struct to work on
2178 void bond_3ad_bind_slave(struct slave *slave) in bond_3ad_bind_slave() argument
2180 struct bonding *bond = bond_get_bond_by_slave(slave); in bond_3ad_bind_slave()
2184 /* check that the slave has not been initialized yet. */ in bond_3ad_bind_slave()
2185 if (SLAVE_AD_INFO(slave)->port.slave != slave) { in bond_3ad_bind_slave()
2188 port = &(SLAVE_AD_INFO(slave)->port); in bond_3ad_bind_slave()
2192 port->slave = slave; in bond_3ad_bind_slave()
2193 port->actor_port_number = SLAVE_AD_INFO(slave)->id; in bond_3ad_bind_slave()
2209 aggregator = &(SLAVE_AD_INFO(slave)->aggregator); in bond_3ad_bind_slave()
2215 aggregator->slave = slave; in bond_3ad_bind_slave()
2222 * bond_3ad_unbind_slave - deinitialize a slave's port
2223 * @slave: slave struct to work on
2229 void bond_3ad_unbind_slave(struct slave *slave) in bond_3ad_unbind_slave() argument
2234 struct bonding *bond = slave->bond; in bond_3ad_unbind_slave()
2235 struct slave *slave_iter; in bond_3ad_unbind_slave()
2241 aggregator = &(SLAVE_AD_INFO(slave)->aggregator); in bond_3ad_unbind_slave()
2242 port = &(SLAVE_AD_INFO(slave)->port); in bond_3ad_unbind_slave()
2244 /* if slave is null, the whole port is not initialized */ in bond_3ad_unbind_slave()
2245 if (!port->slave) { 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()
2264 * except the port related to this slave(thats ensure us that 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()
2369 slave_info(bond->dev, slave->dev, "Removing an active aggregator\n"); in bond_3ad_unbind_slave()
2379 port->slave = NULL; in bond_3ad_unbind_slave()
2395 struct slave *slave; in bond_3ad_update_ad_actor_settings() local
2408 bond_for_each_slave(bond, slave, iter) { in bond_3ad_update_ad_actor_settings()
2409 struct port *port = &(SLAVE_AD_INFO(slave))->port; in bond_3ad_update_ad_actor_settings()
2458 struct slave *slave; in bond_3ad_state_machine_handler() local
2475 slave = bond_first_slave_rcu(bond); in bond_3ad_state_machine_handler()
2476 port = slave ? &(SLAVE_AD_INFO(slave)->port) : NULL; in bond_3ad_state_machine_handler()
2480 if (!port->slave) { in bond_3ad_state_machine_handler()
2493 bond_for_each_slave_rcu(bond, slave, iter) { in bond_3ad_state_machine_handler()
2494 port = &(SLAVE_AD_INFO(slave)->port); in bond_3ad_state_machine_handler()
2495 if (!port->slave) { in bond_3ad_state_machine_handler()
2514 bond_for_each_slave_rcu(bond, slave, iter) { in bond_3ad_state_machine_handler()
2515 if (slave->should_notify) { in bond_3ad_state_machine_handler()
2536 * @slave: slave struct to work on
2542 static int bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave) in bond_3ad_rx_indication() argument
2544 struct bonding *bond = slave->bond; in bond_3ad_rx_indication()
2550 port = &(SLAVE_AD_INFO(slave)->port); in bond_3ad_rx_indication()
2551 if (!port->slave) { in bond_3ad_rx_indication()
2552 net_warn_ratelimited("%s: Warning: port of slave %s is uninitialized\n", in bond_3ad_rx_indication()
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()
2588 stat = &SLAVE_AD_INFO(slave)->stats.marker_unknown_rx; in bond_3ad_rx_indication()
2595 atomic64_inc(&SLAVE_AD_INFO(slave)->stats.lacpdu_unknown_rx); in bond_3ad_rx_indication()
2637 slave_err(port->slave->bond->dev, in ad_update_actor_keys()
2638 port->slave->dev, in ad_update_actor_keys()
2650 * bond_3ad_adapter_speed_duplex_changed - handle a slave's speed / duplex
2653 * @slave: slave struct to work on
2657 void bond_3ad_adapter_speed_duplex_changed(struct slave *slave) in bond_3ad_adapter_speed_duplex_changed() argument
2661 port = &(SLAVE_AD_INFO(slave)->port); in bond_3ad_adapter_speed_duplex_changed()
2663 /* if slave is null, the whole port is not initialized */ in bond_3ad_adapter_speed_duplex_changed()
2664 if (!port->slave) { in bond_3ad_adapter_speed_duplex_changed()
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()
2678 * bond_3ad_handle_link_change - handle a slave's link status change indication
2679 * @slave: slave struct to work on
2684 void bond_3ad_handle_link_change(struct slave *slave, char link) in bond_3ad_handle_link_change() argument
2690 port = &(SLAVE_AD_INFO(slave)->port); in bond_3ad_handle_link_change()
2692 /* if slave is null, the whole port is not initialized */ in bond_3ad_handle_link_change()
2693 if (!port->slave) { in bond_3ad_handle_link_change()
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()
2745 struct slave *first_slave; in bond_3ad_set_carrier()
2787 struct slave *slave; in __bond_3ad_get_active_agg_info() local
2790 bond_for_each_slave_rcu(bond, slave, iter) { in __bond_3ad_get_active_agg_info()
2791 port = &(SLAVE_AD_INFO(slave)->port); in __bond_3ad_get_active_agg_info()
2822 struct slave *slave) in bond_3ad_lacpdu_recv() argument
2834 atomic64_inc(&SLAVE_AD_INFO(slave)->stats.lacpdu_illegal_rx); in bond_3ad_lacpdu_recv()
2839 return bond_3ad_rx_indication(lacpdu, slave); in bond_3ad_lacpdu_recv()
2857 struct slave *slave; in bond_3ad_update_lacp_rate() local
2862 bond_for_each_slave(bond, slave, iter) { in bond_3ad_update_lacp_rate()
2863 port = &(SLAVE_AD_INFO(slave)->port); in bond_3ad_update_lacp_rate()