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_port - disable the port's slave
179 bond_set_slave_inactive_flags(port->slave, BOND_SLAVE_NOTIFY_LATER); in __disable_port()
183 * __enable_port - enable the port's slave, if it's up
188 struct slave *slave = port->slave; in __enable_port() local
190 if ((slave->link == BOND_LINK_UP) && bond_slave_is_up(slave)) in __enable_port()
191 bond_set_slave_active_flags(slave, BOND_SLAVE_NOTIFY_LATER); in __enable_port()
195 * __port_is_enabled - check if the port's slave is in active state
200 return bond_is_active_slave(port->slave); in __port_is_enabled()
257 struct slave *slave = port->slave; in __get_link_speed() local
265 if (slave->link != BOND_LINK_UP) in __get_link_speed()
268 switch (slave->speed) { in __get_link_speed()
331 if (slave->speed != SPEED_UNKNOWN) in __get_link_speed()
332 pr_err_once("%s: (slave %s): unknown ethtool speed (%d) for port %d (set it to 0)\n", in __get_link_speed()
333 slave->bond->dev->name, in __get_link_speed()
334 slave->dev->name, slave->speed, in __get_link_speed()
341 slave_dbg(slave->bond->dev, slave->dev, "Port %d Received link speed %d update from adapter\n", in __get_link_speed()
356 struct slave *slave = port->slave; in __get_duplex() local
362 if (slave->link == BOND_LINK_UP) { in __get_duplex()
363 switch (slave->duplex) { in __get_duplex()
366 …slave_dbg(slave->bond->dev, slave->dev, "Port %d Received status full duplex update from adapter\n… in __get_duplex()
372 …slave_dbg(slave->bond->dev, slave->dev, "Port %d Received status NOT full duplex update from adapt… in __get_duplex()
382 const struct bonding *bond = bond_get_bond_by_slave(port->slave); in __ad_actor_update_port()
507 slave_dbg(port->slave->bond->dev, port->slave->dev, in __record_pdu()
511 slave_dbg(port->slave->bond->dev, port->slave->dev, in __record_pdu()
771 struct bonding *bond = aggregator->slave->bond; in __get_active_agg()
773 struct slave *slave; in __get_active_agg() local
775 bond_for_each_slave_rcu(bond, slave, iter) in __get_active_agg()
776 if (SLAVE_AD_INFO(slave)->aggregator.is_active) in __get_active_agg()
777 return &(SLAVE_AD_INFO(slave)->aggregator); in __get_active_agg()
804 slave_dbg(port->slave->bond->dev, port->slave->dev, in __update_lacpdu_from_port()
842 struct slave *slave = port->slave; in ad_lacpdu_send() local
851 atomic64_inc(&SLAVE_AD_INFO(slave)->stats.lacpdu_tx); in ad_lacpdu_send()
852 atomic64_inc(&BOND_AD_INFO(slave->bond).stats.lacpdu_tx); in ad_lacpdu_send()
854 skb->dev = slave->dev; in ad_lacpdu_send()
866 ether_addr_copy(lacpdu_header->hdr.h_source, slave->perm_hwaddr); in ad_lacpdu_send()
886 struct slave *slave = port->slave; in ad_marker_send() local
897 atomic64_inc(&SLAVE_AD_INFO(slave)->stats.marker_tx); in ad_marker_send()
898 atomic64_inc(&BOND_AD_INFO(slave->bond).stats.marker_tx); in ad_marker_send()
901 atomic64_inc(&SLAVE_AD_INFO(slave)->stats.marker_resp_tx); in ad_marker_send()
902 atomic64_inc(&BOND_AD_INFO(slave->bond).stats.marker_resp_tx); in ad_marker_send()
908 skb->dev = slave->dev; in ad_marker_send()
919 ether_addr_copy(marker_header->hdr.h_source, slave->perm_hwaddr); in ad_marker_send()
932 * @update_slave_arr: Does slave array need update?
1038 slave_dbg(port->slave->bond->dev, port->slave->dev, in ad_mux_machine()
1101 atomic64_inc(&SLAVE_AD_INFO(port->slave)->stats.lacpdu_rx); in ad_rx_machine()
1102 atomic64_inc(&BOND_AD_INFO(port->slave->bond).stats.lacpdu_rx); in ad_rx_machine()
1156 slave_dbg(port->slave->bond->dev, port->slave->dev, in ad_rx_machine()
1208 slave_err(port->slave->bond->dev, port->slave->dev, "An illegal loopback occurred on slave\n" in ad_rx_machine()
1278 slave_dbg(port->slave->bond->dev, in ad_tx_machine()
1279 port->slave->dev, in ad_tx_machine()
1361 slave_dbg(port->slave->bond->dev, port->slave->dev, in ad_periodic_machine()
1389 * @update_slave_arr: Does slave array need update?
1401 struct slave *slave; in ad_port_selection_logic() local
1440 slave_dbg(bond->dev, port->slave->dev, "Port %d left LAG %d\n", in ad_port_selection_logic()
1455 …net_warn_ratelimited("%s: (slave %s): Warning: Port %d was related to aggregator %d but was not on… in ad_port_selection_logic()
1456 port->slave->bond->dev->name, in ad_port_selection_logic()
1457 port->slave->dev->name, in ad_port_selection_logic()
1463 bond_for_each_slave(bond, slave, iter) { in ad_port_selection_logic()
1464 aggregator = &(SLAVE_AD_INFO(slave)->aggregator); in ad_port_selection_logic()
1489 slave_dbg(bond->dev, slave->dev, "Port %d joined LAG %d (existing LAG)\n", in ad_port_selection_logic()
1536 slave_dbg(bond->dev, port->slave->dev, "Port %d joined LAG %d (new LAG)\n", in ad_port_selection_logic()
1540 slave_err(bond->dev, port->slave->dev, in ad_port_selection_logic()
1621 net_warn_ratelimited("%s: (slave %s): Impossible agg select mode %d\n", in ad_agg_selection_test()
1622 curr->slave->bond->dev->name, in ad_agg_selection_test()
1623 curr->slave->dev->name, in ad_agg_selection_test()
1640 if (netif_running(port->slave->dev) && in agg_device_up()
1641 netif_carrier_ok(port->slave->dev)) in agg_device_up()
1651 * @update_slave_arr: Does slave array need update?
1678 struct bonding *bond = agg->slave->bond; in ad_agg_selection_logic()
1680 struct slave *slave; in ad_agg_selection_logic() local
1688 bond_for_each_slave_rcu(bond, slave, iter) { in ad_agg_selection_logic()
1689 agg = &(SLAVE_AD_INFO(slave)->aggregator); in ad_agg_selection_logic()
1724 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()
1725 best->slave ? best->slave->dev->name : "NULL", in ad_agg_selection_logic()
1730 netdev_dbg(bond->dev, "(slave %s): best ports %p slave %p\n", in ad_agg_selection_logic()
1731 best->slave ? best->slave->dev->name : "NULL", in ad_agg_selection_logic()
1732 best->lag_ports, best->slave); in ad_agg_selection_logic()
1734 bond_for_each_slave_rcu(bond, slave, iter) { in ad_agg_selection_logic()
1735 agg = &(SLAVE_AD_INFO(slave)->aggregator); in ad_agg_selection_logic()
1737 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()
1750 netdev_dbg(bond->dev, "(slave %s): LAG %d chosen as the active LAG\n", in ad_agg_selection_logic()
1751 best->slave ? best->slave->dev->name : "NULL", in ad_agg_selection_logic()
1753 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()
1754 best->slave ? best->slave->dev->name : "NULL", in ad_agg_selection_logic()
1769 /* Slave array needs update. */ in ad_agg_selection_logic()
1812 aggregator->slave ? in ad_clear_agg()
1813 aggregator->slave->dev->name : "NULL", in ad_clear_agg()
1829 aggregator->slave = NULL; in ad_initialize_agg()
1902 * @update_slave_arr: Does slave array need update?
1910 slave_dbg(port->slave->bond->dev, port->slave->dev, in ad_enable_collecting_distributing()
1915 /* Slave array needs update */ in ad_enable_collecting_distributing()
1923 * @update_slave_arr: Does slave array need update?
1931 slave_dbg(port->slave->bond->dev, port->slave->dev, in ad_disable_collecting_distributing()
1936 /* Slave array needs an update */ in ad_disable_collecting_distributing()
1951 atomic64_inc(&SLAVE_AD_INFO(port->slave)->stats.marker_rx); in ad_marker_info_received()
1952 atomic64_inc(&BOND_AD_INFO(port->slave->bond).stats.marker_rx); in ad_marker_info_received()
1961 slave_dbg(port->slave->bond->dev, port->slave->dev, in ad_marker_info_received()
1978 atomic64_inc(&SLAVE_AD_INFO(port->slave)->stats.marker_resp_rx); in ad_marker_response_received()
1979 atomic64_inc(&BOND_AD_INFO(port->slave->bond).stats.marker_resp_rx); in ad_marker_response_received()
2027 * bond_3ad_bind_slave - initialize a slave's port
2028 * @slave: slave struct to work on
2033 void bond_3ad_bind_slave(struct slave *slave) in bond_3ad_bind_slave() argument
2035 struct bonding *bond = bond_get_bond_by_slave(slave); in bond_3ad_bind_slave()
2039 /* check that the slave has not been initialized yet. */ in bond_3ad_bind_slave()
2040 if (SLAVE_AD_INFO(slave)->port.slave != slave) { in bond_3ad_bind_slave()
2043 port = &(SLAVE_AD_INFO(slave)->port); in bond_3ad_bind_slave()
2047 port->slave = slave; in bond_3ad_bind_slave()
2048 port->actor_port_number = SLAVE_AD_INFO(slave)->id; in bond_3ad_bind_slave()
2064 aggregator = &(SLAVE_AD_INFO(slave)->aggregator); in bond_3ad_bind_slave()
2070 aggregator->slave = slave; in bond_3ad_bind_slave()
2077 * bond_3ad_unbind_slave - deinitialize a slave's port
2078 * @slave: slave struct to work on
2084 void bond_3ad_unbind_slave(struct slave *slave) in bond_3ad_unbind_slave() argument
2089 struct bonding *bond = slave->bond; in bond_3ad_unbind_slave()
2090 struct slave *slave_iter; in bond_3ad_unbind_slave()
2096 aggregator = &(SLAVE_AD_INFO(slave)->aggregator); in bond_3ad_unbind_slave()
2097 port = &(SLAVE_AD_INFO(slave)->port); in bond_3ad_unbind_slave()
2099 /* if slave is null, the whole port is not initialized */ in bond_3ad_unbind_slave()
2100 if (!port->slave) { in bond_3ad_unbind_slave()
2101 slave_warn(bond->dev, slave->dev, "Trying to unbind an uninitialized port\n"); in bond_3ad_unbind_slave()
2105 slave_dbg(bond->dev, slave->dev, "Unbinding Link Aggregation Group %d\n", in bond_3ad_unbind_slave()
2119 * except the port related to this slave(thats ensure us that in bond_3ad_unbind_slave()
2144 slave_dbg(bond->dev, slave->dev, "Some port(s) related to LAG %d - replacing with LAG %d\n", in bond_3ad_unbind_slave()
2150 slave_info(bond->dev, slave->dev, "Removing an active aggregator\n"); in bond_3ad_unbind_slave()
2181 …slave_warn(bond->dev, slave->dev, "unbinding aggregator, and could not find a new aggregator for i… in bond_3ad_unbind_slave()
2190 slave_info(bond->dev, slave->dev, "Removing an active aggregator\n"); in bond_3ad_unbind_slave()
2200 slave_dbg(bond->dev, slave->dev, "Unbinding port %d\n", port->actor_port_number); in bond_3ad_unbind_slave()
2224 slave_info(bond->dev, slave->dev, "Removing an active aggregator\n"); in bond_3ad_unbind_slave()
2234 port->slave = NULL; in bond_3ad_unbind_slave()
2250 struct slave *slave; in bond_3ad_update_ad_actor_settings() local
2263 bond_for_each_slave(bond, slave, iter) { in bond_3ad_update_ad_actor_settings()
2264 struct port *port = &(SLAVE_AD_INFO(slave))->port; in bond_3ad_update_ad_actor_settings()
2313 struct slave *slave; in bond_3ad_state_machine_handler() local
2330 slave = bond_first_slave_rcu(bond); in bond_3ad_state_machine_handler()
2331 port = slave ? &(SLAVE_AD_INFO(slave)->port) : NULL; in bond_3ad_state_machine_handler()
2335 if (!port->slave) { in bond_3ad_state_machine_handler()
2348 bond_for_each_slave_rcu(bond, slave, iter) { in bond_3ad_state_machine_handler()
2349 port = &(SLAVE_AD_INFO(slave)->port); in bond_3ad_state_machine_handler()
2350 if (!port->slave) { in bond_3ad_state_machine_handler()
2369 bond_for_each_slave_rcu(bond, slave, iter) { in bond_3ad_state_machine_handler()
2370 if (slave->should_notify) { in bond_3ad_state_machine_handler()
2391 * @slave: slave struct to work on
2397 static int bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave) in bond_3ad_rx_indication() argument
2399 struct bonding *bond = slave->bond; in bond_3ad_rx_indication()
2405 port = &(SLAVE_AD_INFO(slave)->port); in bond_3ad_rx_indication()
2406 if (!port->slave) { in bond_3ad_rx_indication()
2407 net_warn_ratelimited("%s: Warning: port of slave %s is uninitialized\n", in bond_3ad_rx_indication()
2408 slave->dev->name, slave->bond->dev->name); in bond_3ad_rx_indication()
2415 slave_dbg(slave->bond->dev, slave->dev, in bond_3ad_rx_indication()
2419 spin_lock(&slave->bond->mode_lock); in bond_3ad_rx_indication()
2421 spin_unlock(&slave->bond->mode_lock); in bond_3ad_rx_indication()
2431 slave_dbg(slave->bond->dev, slave->dev, "Received Marker Information on port %d\n", in bond_3ad_rx_indication()
2436 slave_dbg(slave->bond->dev, slave->dev, "Received Marker Response on port %d\n", in bond_3ad_rx_indication()
2441 slave_dbg(slave->bond->dev, slave->dev, "Received an unknown Marker subtype on port %d\n", in bond_3ad_rx_indication()
2443 stat = &SLAVE_AD_INFO(slave)->stats.marker_unknown_rx; in bond_3ad_rx_indication()
2450 atomic64_inc(&SLAVE_AD_INFO(slave)->stats.lacpdu_unknown_rx); in bond_3ad_rx_indication()
2492 slave_err(port->slave->bond->dev, in ad_update_actor_keys()
2493 port->slave->dev, in ad_update_actor_keys()
2505 * bond_3ad_adapter_speed_duplex_changed - handle a slave's speed / duplex
2508 * @slave: slave struct to work on
2512 void bond_3ad_adapter_speed_duplex_changed(struct slave *slave) in bond_3ad_adapter_speed_duplex_changed() argument
2516 port = &(SLAVE_AD_INFO(slave)->port); in bond_3ad_adapter_speed_duplex_changed()
2518 /* if slave is null, the whole port is not initialized */ in bond_3ad_adapter_speed_duplex_changed()
2519 if (!port->slave) { in bond_3ad_adapter_speed_duplex_changed()
2520 slave_warn(slave->bond->dev, slave->dev, in bond_3ad_adapter_speed_duplex_changed()
2525 spin_lock_bh(&slave->bond->mode_lock); in bond_3ad_adapter_speed_duplex_changed()
2527 spin_unlock_bh(&slave->bond->mode_lock); in bond_3ad_adapter_speed_duplex_changed()
2528 slave_dbg(slave->bond->dev, slave->dev, "Port %d changed speed/duplex\n", in bond_3ad_adapter_speed_duplex_changed()
2533 * bond_3ad_handle_link_change - handle a slave's link status change indication
2534 * @slave: slave struct to work on
2539 void bond_3ad_handle_link_change(struct slave *slave, char link) in bond_3ad_handle_link_change() argument
2545 port = &(SLAVE_AD_INFO(slave)->port); in bond_3ad_handle_link_change()
2547 /* if slave is null, the whole port is not initialized */ in bond_3ad_handle_link_change()
2548 if (!port->slave) { in bond_3ad_handle_link_change()
2549 slave_warn(slave->bond->dev, slave->dev, "link status changed for uninitialized port\n"); in bond_3ad_handle_link_change()
2553 spin_lock_bh(&slave->bond->mode_lock); in bond_3ad_handle_link_change()
2572 spin_unlock_bh(&slave->bond->mode_lock); in bond_3ad_handle_link_change()
2574 slave_dbg(slave->bond->dev, slave->dev, "Port %d changed link status to %s\n", in bond_3ad_handle_link_change()
2581 bond_update_slave_arr(slave->bond, NULL); in bond_3ad_handle_link_change()
2600 struct slave *first_slave; in bond_3ad_set_carrier()
2642 struct slave *slave; in __bond_3ad_get_active_agg_info() local
2645 bond_for_each_slave_rcu(bond, slave, iter) { in __bond_3ad_get_active_agg_info()
2646 port = &(SLAVE_AD_INFO(slave)->port); in __bond_3ad_get_active_agg_info()
2677 struct slave *slave) in bond_3ad_lacpdu_recv() argument
2689 atomic64_inc(&SLAVE_AD_INFO(slave)->stats.lacpdu_illegal_rx); in bond_3ad_lacpdu_recv()
2694 return bond_3ad_rx_indication(lacpdu, slave); in bond_3ad_lacpdu_recv()
2712 struct slave *slave; in bond_3ad_update_lacp_rate() local
2717 bond_for_each_slave(bond, slave, iter) { in bond_3ad_update_lacp_rate()
2718 port = &(SLAVE_AD_INFO(slave)->port); in bond_3ad_update_lacp_rate()