Lines Matching refs:slave
284 struct slave *slave, *rollback_slave; in bond_vlan_rx_add_vid() local
288 bond_for_each_slave(bond, slave, iter) { in bond_vlan_rx_add_vid()
289 res = vlan_vid_add(slave->dev, proto, vid); in bond_vlan_rx_add_vid()
299 if (rollback_slave == slave) in bond_vlan_rx_add_vid()
318 struct slave *slave; in bond_vlan_rx_kill_vid() local
320 bond_for_each_slave(bond, slave, iter) in bond_vlan_rx_kill_vid()
321 vlan_vid_del(slave->dev, proto, vid); in bond_vlan_rx_kill_vid()
340 struct slave *slave; in bond_set_carrier() local
348 bond_for_each_slave(bond, slave, iter) { in bond_set_carrier()
349 if (slave->link == BOND_LINK_UP) { in bond_set_carrier()
372 static int bond_update_speed_duplex(struct slave *slave) in bond_update_speed_duplex() argument
374 struct net_device *slave_dev = slave->dev; in bond_update_speed_duplex()
378 slave->speed = SPEED_UNKNOWN; in bond_update_speed_duplex()
379 slave->duplex = DUPLEX_UNKNOWN; in bond_update_speed_duplex()
394 slave->speed = ecmd.base.speed; in bond_update_speed_duplex()
395 slave->duplex = ecmd.base.duplex; in bond_update_speed_duplex()
492 struct slave *curr_active = rtnl_dereference(bond->curr_active_slave); in bond_set_promiscuity()
497 struct slave *slave; in bond_set_promiscuity() local
499 bond_for_each_slave(bond, slave, iter) { in bond_set_promiscuity()
500 err = dev_set_promiscuity(slave->dev, inc); in bond_set_promiscuity()
515 struct slave *curr_active = rtnl_dereference(bond->curr_active_slave); in bond_set_allmulti()
520 struct slave *slave; in bond_set_allmulti() local
522 bond_for_each_slave(bond, slave, iter) { in bond_set_allmulti()
523 err = dev_set_allmulti(slave->dev, inc); in bond_set_allmulti()
577 static void bond_hw_addr_swap(struct bonding *bond, struct slave *new_active, in bond_hw_addr_swap()
578 struct slave *old_active) in bond_hw_addr_swap()
622 static struct slave *bond_get_old_active(struct bonding *bond, in bond_get_old_active()
623 struct slave *new_active) in bond_get_old_active()
625 struct slave *slave; in bond_get_old_active() local
628 bond_for_each_slave(bond, slave, iter) { in bond_get_old_active()
629 if (slave == new_active) in bond_get_old_active()
632 if (ether_addr_equal(bond->dev->dev_addr, slave->dev->dev_addr)) in bond_get_old_active()
633 return slave; in bond_get_old_active()
646 struct slave *new_active, in bond_do_fail_over_mac()
647 struct slave *old_active) in bond_do_fail_over_mac()
712 static struct slave *bond_choose_primary_or_current(struct bonding *bond) in bond_choose_primary_or_current()
714 struct slave *prim = rtnl_dereference(bond->primary_slave); in bond_choose_primary_or_current()
715 struct slave *curr = rtnl_dereference(bond->curr_active_slave); in bond_choose_primary_or_current()
754 static struct slave *bond_find_best_slave(struct bonding *bond) in bond_find_best_slave()
756 struct slave *slave, *bestslave = NULL; in bond_find_best_slave() local
760 slave = bond_choose_primary_or_current(bond); in bond_find_best_slave()
761 if (slave) in bond_find_best_slave()
762 return slave; in bond_find_best_slave()
764 bond_for_each_slave(bond, slave, iter) { in bond_find_best_slave()
765 if (slave->link == BOND_LINK_UP) in bond_find_best_slave()
766 return slave; in bond_find_best_slave()
767 if (slave->link == BOND_LINK_BACK && bond_slave_is_up(slave) && in bond_find_best_slave()
768 slave->delay < mintime) { in bond_find_best_slave()
769 mintime = slave->delay; in bond_find_best_slave()
770 bestslave = slave; in bond_find_best_slave()
779 struct slave *slave; in bond_should_notify_peers() local
782 slave = rcu_dereference(bond->curr_active_slave); in bond_should_notify_peers()
786 slave ? slave->dev->name : "NULL"); in bond_should_notify_peers()
788 if (!slave || !bond->send_peer_notif || in bond_should_notify_peers()
790 test_bit(__LINK_STATE_LINKWATCH_PENDING, &slave->dev->state)) in bond_should_notify_peers()
811 void bond_change_active_slave(struct bonding *bond, struct slave *new_active) in bond_change_active_slave()
813 struct slave *old_active; in bond_change_active_slave()
919 struct slave *best_slave; in bond_select_active_slave()
939 static inline int slave_enable_netpoll(struct slave *slave) in slave_enable_netpoll() argument
949 err = __netpoll_setup(np, slave->dev); in slave_enable_netpoll()
954 slave->np = np; in slave_enable_netpoll()
958 static inline void slave_disable_netpoll(struct slave *slave) in slave_disable_netpoll() argument
960 struct netpoll *np = slave->np; in slave_disable_netpoll()
965 slave->np = NULL; in slave_disable_netpoll()
972 struct slave *slave = NULL; in bond_poll_controller() local
980 bond_for_each_slave_rcu(bond, slave, iter) { in bond_poll_controller()
981 if (!bond_slave_is_up(slave)) in bond_poll_controller()
986 SLAVE_AD_INFO(slave)->port.aggregator; in bond_poll_controller()
993 netpoll_poll_dev(slave->dev); in bond_poll_controller()
1001 struct slave *slave; in bond_netpoll_cleanup() local
1003 bond_for_each_slave(bond, slave, iter) in bond_netpoll_cleanup()
1004 if (bond_slave_is_up(slave)) in bond_netpoll_cleanup()
1005 slave_disable_netpoll(slave); in bond_netpoll_cleanup()
1012 struct slave *slave; in bond_netpoll_setup() local
1015 bond_for_each_slave(bond, slave, iter) { in bond_netpoll_setup()
1016 err = slave_enable_netpoll(slave); in bond_netpoll_setup()
1025 static inline int slave_enable_netpoll(struct slave *slave) in slave_enable_netpoll() argument
1029 static inline void slave_disable_netpoll(struct slave *slave) in slave_disable_netpoll() argument
1045 struct slave *slave; in bond_fix_features() local
1052 bond_for_each_slave(bond, slave, iter) { in bond_fix_features()
1054 slave->dev->features, in bond_fix_features()
1077 struct slave *slave; in bond_compute_features() local
1086 bond_for_each_slave(bond, slave, iter) { in bond_compute_features()
1088 slave->dev->vlan_features, BOND_VLAN_FEATURES); in bond_compute_features()
1091 slave->dev->hw_enc_features, in bond_compute_features()
1093 dst_release_flag &= slave->dev->priv_flags; in bond_compute_features()
1094 if (slave->dev->hard_header_len > max_hard_header_len) in bond_compute_features()
1095 max_hard_header_len = slave->dev->hard_header_len; in bond_compute_features()
1097 gso_max_size = min(gso_max_size, slave->dev->gso_max_size); in bond_compute_features()
1098 gso_max_segs = min(gso_max_segs, slave->dev->gso_max_segs); in bond_compute_features()
1134 struct slave *slave, in bond_should_deliver_exact_match() argument
1137 if (bond_is_slave_inactive(slave)) { in bond_should_deliver_exact_match()
1150 struct slave *slave; in bond_handle_frame() local
1153 struct slave *); in bond_handle_frame()
1162 slave = bond_slave_get_rcu(skb->dev); in bond_handle_frame()
1163 bond = slave->bond; in bond_handle_frame()
1167 ret = recv_probe(skb, bond, slave); in bond_handle_frame()
1195 if (bond_should_deliver_exact_match(skb, slave, bond)) in bond_handle_frame()
1255 static int bond_master_upper_dev_link(struct bonding *bond, struct slave *slave, in bond_master_upper_dev_link() argument
1265 return netdev_master_upper_dev_link(slave->dev, bond->dev, slave, in bond_master_upper_dev_link()
1269 static void bond_upper_dev_unlink(struct bonding *bond, struct slave *slave) in bond_upper_dev_unlink() argument
1271 netdev_upper_dev_unlink(slave->dev, bond->dev); in bond_upper_dev_unlink()
1272 slave->dev->flags &= ~IFF_SLAVE; in bond_upper_dev_unlink()
1275 static struct slave *bond_alloc_slave(struct bonding *bond) in bond_alloc_slave()
1277 struct slave *slave = NULL; in bond_alloc_slave() local
1279 slave = kzalloc(sizeof(*slave), GFP_KERNEL); in bond_alloc_slave()
1280 if (!slave) in bond_alloc_slave()
1284 SLAVE_AD_INFO(slave) = kzalloc(sizeof(struct ad_slave_info), in bond_alloc_slave()
1286 if (!SLAVE_AD_INFO(slave)) { in bond_alloc_slave()
1287 kfree(slave); in bond_alloc_slave()
1291 INIT_DELAYED_WORK(&slave->notify_work, bond_netdev_notify_work); in bond_alloc_slave()
1293 return slave; in bond_alloc_slave()
1296 static void bond_free_slave(struct slave *slave) in bond_free_slave() argument
1298 struct bonding *bond = bond_get_bond_by_slave(slave); in bond_free_slave()
1300 cancel_delayed_work_sync(&slave->notify_work); in bond_free_slave()
1302 kfree(SLAVE_AD_INFO(slave)); in bond_free_slave()
1304 kfree(slave); in bond_free_slave()
1314 static void bond_fill_ifslave(struct slave *slave, struct ifslave *info) in bond_fill_ifslave() argument
1316 strcpy(info->slave_name, slave->dev->name); in bond_fill_ifslave()
1317 info->link = slave->link; in bond_fill_ifslave()
1318 info->state = bond_slave_state(slave); in bond_fill_ifslave()
1319 info->link_failure_count = slave->link_failure_count; in bond_fill_ifslave()
1324 struct slave *slave = container_of(_work, struct slave, in bond_netdev_notify_work() local
1330 bond_fill_ifslave(slave, &binfo.slave); in bond_netdev_notify_work()
1331 bond_fill_ifbond(slave->bond, &binfo.master); in bond_netdev_notify_work()
1332 netdev_bonding_info_change(slave->dev, &binfo); in bond_netdev_notify_work()
1335 queue_delayed_work(slave->bond->wq, &slave->notify_work, 1); in bond_netdev_notify_work()
1339 void bond_queue_slave_event(struct slave *slave) in bond_queue_slave_event() argument
1341 queue_delayed_work(slave->bond->wq, &slave->notify_work, 0); in bond_queue_slave_event()
1344 void bond_lower_state_changed(struct slave *slave) in bond_lower_state_changed() argument
1348 info.link_up = slave->link == BOND_LINK_UP || in bond_lower_state_changed()
1349 slave->link == BOND_LINK_FAIL; in bond_lower_state_changed()
1350 info.tx_enabled = bond_is_active_slave(slave); in bond_lower_state_changed()
1351 netdev_lower_state_changed(slave->dev, &info); in bond_lower_state_changed()
1360 struct slave *new_slave = NULL, *prev_slave; in bond_enslave()
1862 struct slave *slave, *oldcurrent; in __bond_release_one() local
1877 slave = bond_get_slave_by_dev(bond, slave_dev); in __bond_release_one()
1878 if (!slave) { in __bond_release_one()
1886 bond_set_slave_inactive_flags(slave, BOND_SLAVE_NOTIFY_NOW); in __bond_release_one()
1888 bond_sysfs_slave_del(slave); in __bond_release_one()
1893 bond_upper_dev_unlink(bond, slave); in __bond_release_one()
1900 bond_3ad_unbind_slave(slave); in __bond_release_one()
1903 bond_update_slave_arr(bond, slave); in __bond_release_one()
1906 bond_is_active_slave(slave) ? "active" : "backup", in __bond_release_one()
1915 if (ether_addr_equal_64bits(bond_dev->dev_addr, slave->perm_hwaddr) && in __bond_release_one()
1918 slave_dev->name, slave->perm_hwaddr, in __bond_release_one()
1922 if (rtnl_dereference(bond->primary_slave) == slave) in __bond_release_one()
1925 if (oldcurrent == slave) in __bond_release_one()
1934 bond_alb_deinit_slave(bond, slave); in __bond_release_one()
1939 } else if (oldcurrent == slave) { in __bond_release_one()
1990 slave_disable_netpoll(slave); in __bond_release_one()
1998 bond_hw_addr_copy(ss.__data, slave->perm_hwaddr, in __bond_release_one()
1999 slave->dev->addr_len); in __bond_release_one()
2005 __dev_set_mtu(slave_dev, slave->original_mtu); in __bond_release_one()
2007 dev_set_mtu(slave_dev, slave->original_mtu); in __bond_release_one()
2011 bond_free_slave(slave); in __bond_release_one()
2053 struct slave *slave; in bond_slave_info_query() local
2055 bond_for_each_slave(bond, slave, iter) { in bond_slave_info_query()
2058 bond_fill_ifslave(slave, info); in bond_slave_info_query()
2073 struct slave *slave; in bond_miimon_inspect() local
2078 bond_for_each_slave_rcu(bond, slave, iter) { in bond_miimon_inspect()
2079 slave->new_link = BOND_LINK_NOCHANGE; in bond_miimon_inspect()
2080 slave->link_new_state = slave->link; in bond_miimon_inspect()
2082 link_state = bond_check_dev_link(bond, slave->dev, 0); in bond_miimon_inspect()
2084 switch (slave->link) { in bond_miimon_inspect()
2089 bond_propose_link_state(slave, BOND_LINK_FAIL); in bond_miimon_inspect()
2091 slave->delay = bond->params.downdelay; in bond_miimon_inspect()
2092 if (slave->delay) { in bond_miimon_inspect()
2096 (bond_is_active_slave(slave) ? in bond_miimon_inspect()
2098 slave->dev->name, in bond_miimon_inspect()
2105 bond_propose_link_state(slave, BOND_LINK_UP); in bond_miimon_inspect()
2106 slave->last_link_up = jiffies; in bond_miimon_inspect()
2108 (bond->params.downdelay - slave->delay) * in bond_miimon_inspect()
2110 slave->dev->name); in bond_miimon_inspect()
2115 if (slave->delay <= 0) { in bond_miimon_inspect()
2116 slave->new_link = BOND_LINK_DOWN; in bond_miimon_inspect()
2121 slave->delay--; in bond_miimon_inspect()
2128 bond_propose_link_state(slave, BOND_LINK_BACK); in bond_miimon_inspect()
2130 slave->delay = bond->params.updelay; in bond_miimon_inspect()
2132 if (slave->delay) { in bond_miimon_inspect()
2134 slave->dev->name, in bond_miimon_inspect()
2142 bond_propose_link_state(slave, BOND_LINK_DOWN); in bond_miimon_inspect()
2144 (bond->params.updelay - slave->delay) * in bond_miimon_inspect()
2146 slave->dev->name); in bond_miimon_inspect()
2152 slave->delay = 0; in bond_miimon_inspect()
2154 if (slave->delay <= 0) { in bond_miimon_inspect()
2155 slave->new_link = BOND_LINK_UP; in bond_miimon_inspect()
2161 slave->delay--; in bond_miimon_inspect()
2170 struct slave *slave, in bond_miimon_link_change() argument
2175 bond_3ad_handle_link_change(slave, link); in bond_miimon_link_change()
2179 bond_alb_handle_link_change(bond, slave, link); in bond_miimon_link_change()
2190 struct slave *slave, *primary; in bond_miimon_commit() local
2192 bond_for_each_slave(bond, slave, iter) { in bond_miimon_commit()
2193 switch (slave->new_link) { in bond_miimon_commit()
2198 if (bond_update_speed_duplex(slave) && in bond_miimon_commit()
2200 slave->link = BOND_LINK_DOWN; in bond_miimon_commit()
2204 slave->dev->name); in bond_miimon_commit()
2207 bond_set_slave_link_state(slave, BOND_LINK_UP, in bond_miimon_commit()
2209 slave->last_link_up = jiffies; in bond_miimon_commit()
2214 bond_set_backup_slave(slave); in bond_miimon_commit()
2217 bond_set_active_slave(slave); in bond_miimon_commit()
2218 } else if (slave != primary) { in bond_miimon_commit()
2220 bond_set_backup_slave(slave); in bond_miimon_commit()
2224 slave->dev->name, in bond_miimon_commit()
2225 slave->speed == SPEED_UNKNOWN ? 0 : slave->speed, in bond_miimon_commit()
2226 slave->duplex ? "full" : "half"); in bond_miimon_commit()
2228 bond_miimon_link_change(bond, slave, BOND_LINK_UP); in bond_miimon_commit()
2230 if (!bond->curr_active_slave || slave == primary) in bond_miimon_commit()
2236 if (slave->link_failure_count < UINT_MAX) in bond_miimon_commit()
2237 slave->link_failure_count++; in bond_miimon_commit()
2239 bond_set_slave_link_state(slave, BOND_LINK_DOWN, in bond_miimon_commit()
2244 bond_set_slave_inactive_flags(slave, in bond_miimon_commit()
2248 slave->dev->name); in bond_miimon_commit()
2250 bond_miimon_link_change(bond, slave, BOND_LINK_DOWN); in bond_miimon_commit()
2252 if (slave == rcu_access_pointer(bond->curr_active_slave)) in bond_miimon_commit()
2259 slave->new_link, slave->dev->name); in bond_miimon_commit()
2260 slave->new_link = BOND_LINK_NOCHANGE; in bond_miimon_commit()
2287 struct slave *slave; in bond_mii_monitor() local
2309 bond_for_each_slave(bond, slave, iter) { in bond_mii_monitor()
2310 bond_commit_link_state(slave, BOND_SLAVE_NOTIFY_LATER); in bond_mii_monitor()
2449 static void bond_arp_send_all(struct bonding *bond, struct slave *slave) in bond_arp_send_all() argument
2471 bond_arp_send(slave->dev, ARPOP_REQUEST, targets[i], in bond_arp_send_all()
2497 bond_arp_send(slave->dev, ARPOP_REQUEST, targets[i], in bond_arp_send_all()
2503 static void bond_validate_arp(struct bonding *bond, struct slave *slave, __be32 sip, __be32 tip) in bond_validate_arp() argument
2519 slave->last_rx = jiffies; in bond_validate_arp()
2520 slave->target_last_arp_rx[i] = jiffies; in bond_validate_arp()
2524 struct slave *slave) in bond_arp_rcv() argument
2527 struct slave *curr_active_slave, *curr_arp_slave; in bond_arp_rcv()
2533 if (!slave_do_arp_validate(bond, slave)) { in bond_arp_rcv()
2536 slave->last_rx = jiffies; in bond_arp_rcv()
2570 slave->dev->name, bond_slave_state(slave), in bond_arp_rcv()
2571 bond->params.arp_validate, slave_do_arp_validate(bond, slave), in bond_arp_rcv()
2600 if (bond_is_active_slave(slave)) in bond_arp_rcv()
2601 bond_validate_arp(bond, slave, sip, tip); in bond_arp_rcv()
2605 bond_validate_arp(bond, slave, tip, sip); in bond_arp_rcv()
2609 bond_validate_arp(bond, slave, sip, tip); in bond_arp_rcv()
2639 struct slave *slave, *oldcurrent; in bond_loadbalance_arp_mon() local
2657 bond_for_each_slave_rcu(bond, slave, iter) { in bond_loadbalance_arp_mon()
2658 unsigned long trans_start = dev_trans_start(slave->dev); in bond_loadbalance_arp_mon()
2660 slave->new_link = BOND_LINK_NOCHANGE; in bond_loadbalance_arp_mon()
2662 if (slave->link != BOND_LINK_UP) { in bond_loadbalance_arp_mon()
2664 bond_time_in_interval(bond, slave->last_rx, 1)) { in bond_loadbalance_arp_mon()
2666 slave->new_link = BOND_LINK_UP; in bond_loadbalance_arp_mon()
2676 slave->dev->name); in bond_loadbalance_arp_mon()
2680 slave->dev->name); in bond_loadbalance_arp_mon()
2691 !bond_time_in_interval(bond, slave->last_rx, 2)) { in bond_loadbalance_arp_mon()
2693 slave->new_link = BOND_LINK_DOWN; in bond_loadbalance_arp_mon()
2696 if (slave->link_failure_count < UINT_MAX) in bond_loadbalance_arp_mon()
2697 slave->link_failure_count++; in bond_loadbalance_arp_mon()
2700 slave->dev->name); in bond_loadbalance_arp_mon()
2702 if (slave == oldcurrent) in bond_loadbalance_arp_mon()
2714 if (bond_slave_is_up(slave)) in bond_loadbalance_arp_mon()
2715 bond_arp_send_all(bond, slave); in bond_loadbalance_arp_mon()
2724 bond_for_each_slave(bond, slave, iter) { in bond_loadbalance_arp_mon()
2725 if (slave->new_link != BOND_LINK_NOCHANGE) in bond_loadbalance_arp_mon()
2726 slave->link = slave->new_link; in bond_loadbalance_arp_mon()
2759 struct slave *slave; in bond_ab_arp_inspect() local
2762 bond_for_each_slave_rcu(bond, slave, iter) { in bond_ab_arp_inspect()
2763 slave->new_link = BOND_LINK_NOCHANGE; in bond_ab_arp_inspect()
2764 last_rx = slave_last_rx(bond, slave); in bond_ab_arp_inspect()
2766 if (slave->link != BOND_LINK_UP) { in bond_ab_arp_inspect()
2768 slave->new_link = BOND_LINK_UP; in bond_ab_arp_inspect()
2778 if (bond_time_in_interval(bond, slave->last_link_up, 2)) in bond_ab_arp_inspect()
2793 if (!bond_is_active_slave(slave) && in bond_ab_arp_inspect()
2796 slave->new_link = BOND_LINK_DOWN; in bond_ab_arp_inspect()
2805 trans_start = dev_trans_start(slave->dev); in bond_ab_arp_inspect()
2806 if (bond_is_active_slave(slave) && in bond_ab_arp_inspect()
2809 slave->new_link = BOND_LINK_DOWN; in bond_ab_arp_inspect()
2826 struct slave *slave; in bond_ab_arp_commit() local
2828 bond_for_each_slave(bond, slave, iter) { in bond_ab_arp_commit()
2829 switch (slave->new_link) { in bond_ab_arp_commit()
2834 trans_start = dev_trans_start(slave->dev); in bond_ab_arp_commit()
2835 if (rtnl_dereference(bond->curr_active_slave) != slave || in bond_ab_arp_commit()
2838 struct slave *current_arp_slave; in bond_ab_arp_commit()
2841 bond_set_slave_link_state(slave, BOND_LINK_UP, in bond_ab_arp_commit()
2851 slave->dev->name); in bond_ab_arp_commit()
2854 slave == rtnl_dereference(bond->primary_slave)) in bond_ab_arp_commit()
2862 if (slave->link_failure_count < UINT_MAX) in bond_ab_arp_commit()
2863 slave->link_failure_count++; in bond_ab_arp_commit()
2865 bond_set_slave_link_state(slave, BOND_LINK_DOWN, in bond_ab_arp_commit()
2867 bond_set_slave_inactive_flags(slave, in bond_ab_arp_commit()
2871 slave->dev->name); in bond_ab_arp_commit()
2873 if (slave == rtnl_dereference(bond->curr_active_slave)) { in bond_ab_arp_commit()
2882 slave->new_link, slave->dev->name); in bond_ab_arp_commit()
2901 struct slave *slave, *before = NULL, *new_slave = NULL, in bond_ab_arp_probe() local
2931 bond_for_each_slave_rcu(bond, slave, iter) { in bond_ab_arp_probe()
2932 if (!found && !before && bond_slave_is_up(slave)) in bond_ab_arp_probe()
2933 before = slave; in bond_ab_arp_probe()
2935 if (found && !new_slave && bond_slave_is_up(slave)) in bond_ab_arp_probe()
2936 new_slave = slave; in bond_ab_arp_probe()
2944 if (!bond_slave_is_up(slave) && slave->link == BOND_LINK_UP) { in bond_ab_arp_probe()
2945 bond_set_slave_link_state(slave, BOND_LINK_DOWN, in bond_ab_arp_probe()
2947 if (slave->link_failure_count < UINT_MAX) in bond_ab_arp_probe()
2948 slave->link_failure_count++; in bond_ab_arp_probe()
2950 bond_set_slave_inactive_flags(slave, in bond_ab_arp_probe()
2954 slave->dev->name); in bond_ab_arp_probe()
2956 if (slave == curr_arp_slave) in bond_ab_arp_probe()
2974 bond_for_each_slave_rcu(bond, slave, iter) { in bond_ab_arp_probe()
2975 if (slave->should_notify || slave->should_notify_link) { in bond_ab_arp_probe()
3089 struct slave *slave = bond_slave_get_rtnl(slave_dev), *primary; in bond_slave_netdev_event() local
3097 if (!slave) in bond_slave_netdev_event()
3099 bond_dev = slave->bond->dev; in bond_slave_netdev_event()
3100 bond = slave->bond; in bond_slave_netdev_event()
3118 if (bond_update_speed_duplex(slave) && in bond_slave_netdev_event()
3120 slave->link = BOND_LINK_DOWN; in bond_slave_netdev_event()
3123 bond_3ad_adapter_speed_duplex_changed(slave); in bond_slave_netdev_event()
3156 if (slave == primary) { in bond_slave_netdev_event()
3161 rcu_assign_pointer(bond->primary_slave, slave); in bond_slave_netdev_event()
3178 call_netdevice_notifiers(event, slave->bond->dev); in bond_slave_netdev_event()
3332 struct slave *slave; in bond_open() local
3336 bond_for_each_slave(bond, slave, iter) { in bond_open()
3338 slave != rcu_access_pointer(bond->curr_active_slave)) { in bond_open()
3339 bond_set_slave_inactive_flags(slave, in bond_open()
3342 bond_set_slave_active_flags(slave, in bond_open()
3434 struct slave *slave; in bond_get_stats() local
3440 bond_for_each_slave_rcu(bond, slave, iter) { in bond_get_stats()
3442 dev_get_stats(slave->dev, &temp); in bond_get_stats()
3444 bond_fold_stats(stats, new, &slave->slave_stats); in bond_get_stats()
3447 memcpy(&slave->slave_stats, new, sizeof(*new)); in bond_get_stats()
3579 struct slave *slave; in bond_set_rx_mode() local
3583 slave = rcu_dereference(bond->curr_active_slave); in bond_set_rx_mode()
3584 if (slave) { in bond_set_rx_mode()
3585 dev_uc_sync(slave->dev, bond_dev); in bond_set_rx_mode()
3586 dev_mc_sync(slave->dev, bond_dev); in bond_set_rx_mode()
3589 bond_for_each_slave_rcu(bond, slave, iter) { in bond_set_rx_mode()
3590 dev_uc_sync_multiple(slave->dev, bond_dev); in bond_set_rx_mode()
3591 dev_mc_sync_multiple(slave->dev, bond_dev); in bond_set_rx_mode()
3602 struct slave *slave; in bond_neigh_init() local
3605 slave = bond_first_slave(bond); in bond_neigh_init()
3606 if (!slave) in bond_neigh_init()
3608 slave_ops = slave->dev->netdev_ops; in bond_neigh_init()
3614 ret = slave_ops->ndo_neigh_setup(slave->dev, &parms); in bond_neigh_init()
3653 struct slave *slave, *rollback_slave; in bond_change_mtu() local
3659 bond_for_each_slave(bond, slave, iter) { in bond_change_mtu()
3661 slave, slave->dev->netdev_ops->ndo_change_mtu); in bond_change_mtu()
3663 res = dev_set_mtu(slave->dev, new_mtu); in bond_change_mtu()
3675 slave->dev->name); in bond_change_mtu()
3689 if (rollback_slave == slave) in bond_change_mtu()
3711 struct slave *slave, *rollback_slave; in bond_set_mac_address() local
3732 bond_for_each_slave(bond, slave, iter) { in bond_set_mac_address()
3733 netdev_dbg(bond_dev, "slave %p %s\n", slave, slave->dev->name); in bond_set_mac_address()
3734 res = dev_set_mac_address(slave->dev, addr); in bond_set_mac_address()
3742 netdev_dbg(bond_dev, "err %d %s\n", res, slave->dev->name); in bond_set_mac_address()
3759 if (rollback_slave == slave) in bond_set_mac_address()
3786 struct slave *slave; in bond_xmit_slave_id() local
3790 bond_for_each_slave_rcu(bond, slave, iter) { in bond_xmit_slave_id()
3792 if (bond_slave_can_tx(slave)) { in bond_xmit_slave_id()
3793 bond_dev_queue_xmit(bond, skb, slave->dev); in bond_xmit_slave_id()
3801 bond_for_each_slave_rcu(bond, slave, iter) { in bond_xmit_slave_id()
3804 if (bond_slave_can_tx(slave)) { in bond_xmit_slave_id()
3805 bond_dev_queue_xmit(bond, skb, slave->dev); in bond_xmit_slave_id()
3851 struct slave *slave; in bond_xmit_roundrobin() local
3861 slave = rcu_dereference(bond->curr_active_slave); in bond_xmit_roundrobin()
3862 if (slave) in bond_xmit_roundrobin()
3863 bond_dev_queue_xmit(bond, skb, slave->dev); in bond_xmit_roundrobin()
3887 struct slave *slave; in bond_xmit_activebackup() local
3889 slave = rcu_dereference(bond->curr_active_slave); in bond_xmit_activebackup()
3890 if (slave) in bond_xmit_activebackup()
3891 bond_dev_queue_xmit(bond, skb, slave->dev); in bond_xmit_activebackup()
3937 int bond_update_slave_arr(struct bonding *bond, struct slave *skipslave) in bond_update_slave_arr()
3939 struct slave *slave; in bond_update_slave_arr() local
3974 bond_for_each_slave(bond, slave, iter) { in bond_update_slave_arr()
3978 agg = SLAVE_AD_INFO(slave)->port.aggregator; in bond_update_slave_arr()
3982 if (!bond_slave_can_tx(slave)) in bond_update_slave_arr()
3984 if (skipslave == slave) in bond_update_slave_arr()
3989 slave->dev->name, new_arr->count); in bond_update_slave_arr()
3991 new_arr->arr[new_arr->count++] = slave; in bond_update_slave_arr()
4031 struct slave *slave; in bond_3ad_xor_xmit() local
4038 slave = slaves->arr[bond_xmit_hash(bond, skb) % count]; in bond_3ad_xor_xmit()
4039 bond_dev_queue_xmit(bond, skb, slave->dev); in bond_3ad_xor_xmit()
4052 struct slave *slave = NULL; in bond_xmit_broadcast() local
4055 bond_for_each_slave_rcu(bond, slave, iter) { in bond_xmit_broadcast()
4056 if (bond_is_last_slave(bond, slave)) in bond_xmit_broadcast()
4058 if (bond_slave_is_up(slave) && slave->link == BOND_LINK_UP) { in bond_xmit_broadcast()
4066 bond_dev_queue_xmit(bond, skb2, slave->dev); in bond_xmit_broadcast()
4069 if (slave && bond_slave_is_up(slave) && slave->link == BOND_LINK_UP) in bond_xmit_broadcast()
4070 bond_dev_queue_xmit(bond, skb, slave->dev); in bond_xmit_broadcast()
4083 struct slave *slave = NULL; in bond_slave_override() local
4090 bond_for_each_slave_rcu(bond, slave, iter) { in bond_slave_override()
4091 if (slave->queue_id == skb_get_queue_mapping(skb)) { in bond_slave_override()
4092 if (bond_slave_is_up(slave) && in bond_slave_override()
4093 slave->link == BOND_LINK_UP) { in bond_slave_override()
4094 bond_dev_queue_xmit(bond, skb, slave->dev); in bond_slave_override()
4186 struct slave *slave; in bond_ethtool_get_link_ksettings() local
4196 bond_for_each_slave(bond, slave, iter) { in bond_ethtool_get_link_ksettings()
4197 if (bond_slave_can_tx(slave)) { in bond_ethtool_get_link_ksettings()
4198 if (slave->speed != SPEED_UNKNOWN) in bond_ethtool_get_link_ksettings()
4199 speed += slave->speed; in bond_ethtool_get_link_ksettings()
4201 slave->duplex != DUPLEX_UNKNOWN) in bond_ethtool_get_link_ksettings()
4202 cmd->base.duplex = slave->duplex; in bond_ethtool_get_link_ksettings()
4320 struct slave *slave; in bond_uninit() local
4326 bond_for_each_slave(bond, slave, iter) in bond_uninit()
4327 __bond_release_one(bond_dev, slave->dev, true, true); in bond_uninit()