Lines Matching refs:slave

289 	struct slave *slave, *rollback_slave;  in bond_vlan_rx_add_vid()  local
293 bond_for_each_slave(bond, slave, iter) { in bond_vlan_rx_add_vid()
294 res = vlan_vid_add(slave->dev, proto, vid); in bond_vlan_rx_add_vid()
304 if (rollback_slave == slave) in bond_vlan_rx_add_vid()
323 struct slave *slave; in bond_vlan_rx_kill_vid() local
325 bond_for_each_slave(bond, slave, iter) in bond_vlan_rx_kill_vid()
326 vlan_vid_del(slave->dev, proto, vid); in bond_vlan_rx_kill_vid()
345 struct slave *slave; in bond_set_carrier() local
353 bond_for_each_slave(bond, slave, iter) { in bond_set_carrier()
354 if (slave->link == BOND_LINK_UP) { in bond_set_carrier()
376 static void bond_update_speed_duplex(struct slave *slave) in bond_update_speed_duplex() argument
378 struct net_device *slave_dev = slave->dev; in bond_update_speed_duplex()
383 slave->speed = SPEED_UNKNOWN; in bond_update_speed_duplex()
384 slave->duplex = DUPLEX_UNKNOWN; in bond_update_speed_duplex()
402 slave->speed = slave_speed; in bond_update_speed_duplex()
403 slave->duplex = ecmd.duplex; in bond_update_speed_duplex()
500 struct slave *curr_active = rtnl_dereference(bond->curr_active_slave); in bond_set_promiscuity()
505 struct slave *slave; in bond_set_promiscuity() local
507 bond_for_each_slave(bond, slave, iter) { in bond_set_promiscuity()
508 err = dev_set_promiscuity(slave->dev, inc); in bond_set_promiscuity()
523 struct slave *curr_active = rtnl_dereference(bond->curr_active_slave); in bond_set_allmulti()
528 struct slave *slave; in bond_set_allmulti() local
530 bond_for_each_slave(bond, slave, iter) { in bond_set_allmulti()
531 err = dev_set_allmulti(slave->dev, inc); in bond_set_allmulti()
585 static void bond_hw_addr_swap(struct bonding *bond, struct slave *new_active, in bond_hw_addr_swap()
586 struct slave *old_active) in bond_hw_addr_swap()
630 static struct slave *bond_get_old_active(struct bonding *bond, in bond_get_old_active()
631 struct slave *new_active) in bond_get_old_active()
633 struct slave *slave; in bond_get_old_active() local
636 bond_for_each_slave(bond, slave, iter) { in bond_get_old_active()
637 if (slave == new_active) in bond_get_old_active()
640 if (ether_addr_equal(bond->dev->dev_addr, slave->dev->dev_addr)) in bond_get_old_active()
641 return slave; in bond_get_old_active()
654 struct slave *new_active, in bond_do_fail_over_mac()
655 struct slave *old_active) in bond_do_fail_over_mac()
714 static struct slave *bond_choose_primary_or_current(struct bonding *bond) in bond_choose_primary_or_current()
716 struct slave *prim = rtnl_dereference(bond->primary_slave); in bond_choose_primary_or_current()
717 struct slave *curr = rtnl_dereference(bond->curr_active_slave); in bond_choose_primary_or_current()
756 static struct slave *bond_find_best_slave(struct bonding *bond) in bond_find_best_slave()
758 struct slave *slave, *bestslave = NULL; in bond_find_best_slave() local
762 slave = bond_choose_primary_or_current(bond); in bond_find_best_slave()
763 if (slave) in bond_find_best_slave()
764 return slave; in bond_find_best_slave()
766 bond_for_each_slave(bond, slave, iter) { in bond_find_best_slave()
767 if (slave->link == BOND_LINK_UP) in bond_find_best_slave()
768 return slave; in bond_find_best_slave()
769 if (slave->link == BOND_LINK_BACK && bond_slave_is_up(slave) && in bond_find_best_slave()
770 slave->delay < mintime) { in bond_find_best_slave()
771 mintime = slave->delay; in bond_find_best_slave()
772 bestslave = slave; in bond_find_best_slave()
781 struct slave *slave; in bond_should_notify_peers() local
784 slave = rcu_dereference(bond->curr_active_slave); in bond_should_notify_peers()
788 slave ? slave->dev->name : "NULL"); in bond_should_notify_peers()
790 if (!slave || !bond->send_peer_notif || in bond_should_notify_peers()
792 test_bit(__LINK_STATE_LINKWATCH_PENDING, &slave->dev->state)) in bond_should_notify_peers()
813 void bond_change_active_slave(struct bonding *bond, struct slave *new_active) in bond_change_active_slave()
815 struct slave *old_active; in bond_change_active_slave()
920 struct slave *best_slave; in bond_select_active_slave()
941 static inline int slave_enable_netpoll(struct slave *slave) in slave_enable_netpoll() argument
951 err = __netpoll_setup(np, slave->dev); in slave_enable_netpoll()
956 slave->np = np; in slave_enable_netpoll()
960 static inline void slave_disable_netpoll(struct slave *slave) in slave_disable_netpoll() argument
962 struct netpoll *np = slave->np; in slave_disable_netpoll()
967 slave->np = NULL; in slave_disable_netpoll()
974 struct slave *slave = NULL; in bond_poll_controller() local
984 bond_for_each_slave_rcu(bond, slave, iter) { in bond_poll_controller()
985 ops = slave->dev->netdev_ops; in bond_poll_controller()
986 if (!bond_slave_is_up(slave) || !ops->ndo_poll_controller) in bond_poll_controller()
991 SLAVE_AD_INFO(slave)->port.aggregator; in bond_poll_controller()
998 ni = rcu_dereference_bh(slave->dev->npinfo); in bond_poll_controller()
1001 ops->ndo_poll_controller(slave->dev); in bond_poll_controller()
1010 struct slave *slave; in bond_netpoll_cleanup() local
1012 bond_for_each_slave(bond, slave, iter) in bond_netpoll_cleanup()
1013 if (bond_slave_is_up(slave)) in bond_netpoll_cleanup()
1014 slave_disable_netpoll(slave); in bond_netpoll_cleanup()
1021 struct slave *slave; in bond_netpoll_setup() local
1024 bond_for_each_slave(bond, slave, iter) { in bond_netpoll_setup()
1025 err = slave_enable_netpoll(slave); in bond_netpoll_setup()
1034 static inline int slave_enable_netpoll(struct slave *slave) in slave_enable_netpoll() argument
1038 static inline void slave_disable_netpoll(struct slave *slave) in slave_disable_netpoll() argument
1054 struct slave *slave; in bond_fix_features() local
1061 bond_for_each_slave(bond, slave, iter) { in bond_fix_features()
1063 slave->dev->features, in bond_fix_features()
1086 struct slave *slave; in bond_compute_features() local
1095 bond_for_each_slave(bond, slave, iter) { in bond_compute_features()
1097 slave->dev->vlan_features, BOND_VLAN_FEATURES); in bond_compute_features()
1100 slave->dev->hw_enc_features, in bond_compute_features()
1102 dst_release_flag &= slave->dev->priv_flags; in bond_compute_features()
1103 if (slave->dev->hard_header_len > max_hard_header_len) in bond_compute_features()
1104 max_hard_header_len = slave->dev->hard_header_len; in bond_compute_features()
1106 gso_max_size = min(gso_max_size, slave->dev->gso_max_size); in bond_compute_features()
1107 gso_max_segs = min(gso_max_segs, slave->dev->gso_max_segs); in bond_compute_features()
1142 struct slave *slave, in bond_should_deliver_exact_match() argument
1145 if (bond_is_slave_inactive(slave)) { in bond_should_deliver_exact_match()
1158 struct slave *slave; in bond_handle_frame() local
1161 struct slave *); in bond_handle_frame()
1170 slave = bond_slave_get_rcu(skb->dev); in bond_handle_frame()
1171 bond = slave->bond; in bond_handle_frame()
1175 ret = recv_probe(skb, bond, slave); in bond_handle_frame()
1182 if (bond_should_deliver_exact_match(skb, slave, bond)) { in bond_handle_frame()
1205 struct slave *slave) in bond_master_upper_dev_link() argument
1209 err = netdev_master_upper_dev_link_private(slave_dev, bond_dev, slave); in bond_master_upper_dev_link()
1224 static struct slave *bond_alloc_slave(struct bonding *bond) in bond_alloc_slave()
1226 struct slave *slave = NULL; in bond_alloc_slave() local
1228 slave = kzalloc(sizeof(struct slave), GFP_KERNEL); in bond_alloc_slave()
1229 if (!slave) in bond_alloc_slave()
1233 SLAVE_AD_INFO(slave) = kzalloc(sizeof(struct ad_slave_info), in bond_alloc_slave()
1235 if (!SLAVE_AD_INFO(slave)) { in bond_alloc_slave()
1236 kfree(slave); in bond_alloc_slave()
1240 return slave; in bond_alloc_slave()
1243 static void bond_free_slave(struct slave *slave) in bond_free_slave() argument
1245 struct bonding *bond = bond_get_bond_by_slave(slave); in bond_free_slave()
1248 kfree(SLAVE_AD_INFO(slave)); in bond_free_slave()
1250 kfree(slave); in bond_free_slave()
1260 static void bond_fill_ifslave(struct slave *slave, struct ifslave *info) in bond_fill_ifslave() argument
1262 strcpy(info->slave_name, slave->dev->name); in bond_fill_ifslave()
1263 info->link = slave->link; in bond_fill_ifslave()
1264 info->state = bond_slave_state(slave); in bond_fill_ifslave()
1265 info->link_failure_count = slave->link_failure_count; in bond_fill_ifslave()
1286 void bond_queue_slave_event(struct slave *slave) in bond_queue_slave_event() argument
1288 struct bonding *bond = slave->bond; in bond_queue_slave_event()
1294 dev_hold(slave->dev); in bond_queue_slave_event()
1295 nnw->dev = slave->dev; in bond_queue_slave_event()
1296 bond_fill_ifslave(slave, &nnw->bonding_info.slave); in bond_queue_slave_event()
1300 queue_delayed_work(slave->bond->wq, &nnw->work, 0); in bond_queue_slave_event()
1308 struct slave *new_slave = NULL, *prev_slave; in bond_enslave()
1783 struct slave *slave, *oldcurrent; in __bond_release_one() local
1798 slave = bond_get_slave_by_dev(bond, slave_dev); in __bond_release_one()
1799 if (!slave) { in __bond_release_one()
1807 bond_sysfs_slave_del(slave); in __bond_release_one()
1819 bond_3ad_unbind_slave(slave); in __bond_release_one()
1822 bond_update_slave_arr(bond, slave); in __bond_release_one()
1825 bond_is_active_slave(slave) ? "active" : "backup", in __bond_release_one()
1834 if (ether_addr_equal_64bits(bond_dev->dev_addr, slave->perm_hwaddr) && in __bond_release_one()
1837 slave_dev->name, slave->perm_hwaddr, in __bond_release_one()
1841 if (rtnl_dereference(bond->primary_slave) == slave) in __bond_release_one()
1844 if (oldcurrent == slave) in __bond_release_one()
1853 bond_alb_deinit_slave(bond, slave); in __bond_release_one()
1858 } else if (oldcurrent == slave) { in __bond_release_one()
1909 slave_disable_netpoll(slave); in __bond_release_one()
1917 ether_addr_copy(addr.sa_data, slave->perm_hwaddr); in __bond_release_one()
1922 dev_set_mtu(slave_dev, slave->original_mtu); in __bond_release_one()
1926 bond_free_slave(slave); in __bond_release_one()
1969 struct slave *slave; in bond_slave_info_query() local
1971 bond_for_each_slave(bond, slave, iter) { in bond_slave_info_query()
1974 bond_fill_ifslave(slave, info); in bond_slave_info_query()
1989 struct slave *slave; in bond_miimon_inspect() local
1994 bond_for_each_slave_rcu(bond, slave, iter) { in bond_miimon_inspect()
1995 slave->new_link = BOND_LINK_NOCHANGE; in bond_miimon_inspect()
1997 link_state = bond_check_dev_link(bond, slave->dev, 0); in bond_miimon_inspect()
1999 switch (slave->link) { in bond_miimon_inspect()
2004 bond_set_slave_link_state(slave, BOND_LINK_FAIL); in bond_miimon_inspect()
2005 slave->delay = bond->params.downdelay; in bond_miimon_inspect()
2006 if (slave->delay) { in bond_miimon_inspect()
2010 (bond_is_active_slave(slave) ? in bond_miimon_inspect()
2012 slave->dev->name, in bond_miimon_inspect()
2019 bond_set_slave_link_state(slave, BOND_LINK_UP); in bond_miimon_inspect()
2020 slave->last_link_up = jiffies; in bond_miimon_inspect()
2022 (bond->params.downdelay - slave->delay) * in bond_miimon_inspect()
2024 slave->dev->name); in bond_miimon_inspect()
2028 if (slave->delay <= 0) { in bond_miimon_inspect()
2029 slave->new_link = BOND_LINK_DOWN; in bond_miimon_inspect()
2034 slave->delay--; in bond_miimon_inspect()
2041 bond_set_slave_link_state(slave, BOND_LINK_BACK); in bond_miimon_inspect()
2042 slave->delay = bond->params.updelay; in bond_miimon_inspect()
2044 if (slave->delay) { in bond_miimon_inspect()
2046 slave->dev->name, in bond_miimon_inspect()
2054 bond_set_slave_link_state(slave, in bond_miimon_inspect()
2057 (bond->params.updelay - slave->delay) * in bond_miimon_inspect()
2059 slave->dev->name); in bond_miimon_inspect()
2065 slave->delay = 0; in bond_miimon_inspect()
2067 if (slave->delay <= 0) { in bond_miimon_inspect()
2068 slave->new_link = BOND_LINK_UP; in bond_miimon_inspect()
2074 slave->delay--; in bond_miimon_inspect()
2085 struct slave *slave, *primary; in bond_miimon_commit() local
2087 bond_for_each_slave(bond, slave, iter) { in bond_miimon_commit()
2088 switch (slave->new_link) { in bond_miimon_commit()
2093 bond_set_slave_link_state(slave, BOND_LINK_UP); in bond_miimon_commit()
2094 slave->last_link_up = jiffies; in bond_miimon_commit()
2099 bond_set_backup_slave(slave); in bond_miimon_commit()
2102 bond_set_active_slave(slave); in bond_miimon_commit()
2103 } else if (slave != primary) { in bond_miimon_commit()
2105 bond_set_backup_slave(slave); in bond_miimon_commit()
2109 slave->dev->name, in bond_miimon_commit()
2110 slave->speed == SPEED_UNKNOWN ? 0 : slave->speed, in bond_miimon_commit()
2111 slave->duplex ? "full" : "half"); in bond_miimon_commit()
2115 bond_3ad_handle_link_change(slave, BOND_LINK_UP); in bond_miimon_commit()
2118 bond_alb_handle_link_change(bond, slave, in bond_miimon_commit()
2124 if (!bond->curr_active_slave || slave == primary) in bond_miimon_commit()
2130 if (slave->link_failure_count < UINT_MAX) in bond_miimon_commit()
2131 slave->link_failure_count++; in bond_miimon_commit()
2133 bond_set_slave_link_state(slave, BOND_LINK_DOWN); in bond_miimon_commit()
2137 bond_set_slave_inactive_flags(slave, in bond_miimon_commit()
2141 slave->dev->name); in bond_miimon_commit()
2144 bond_3ad_handle_link_change(slave, in bond_miimon_commit()
2148 bond_alb_handle_link_change(bond, slave, in bond_miimon_commit()
2154 if (slave == rcu_access_pointer(bond->curr_active_slave)) in bond_miimon_commit()
2161 slave->new_link, slave->dev->name); in bond_miimon_commit()
2162 slave->new_link = BOND_LINK_NOCHANGE; in bond_miimon_commit()
2345 static void bond_arp_send_all(struct bonding *bond, struct slave *slave) in bond_arp_send_all() argument
2367 bond_arp_send(slave->dev, ARPOP_REQUEST, targets[i], in bond_arp_send_all()
2393 bond_arp_send(slave->dev, ARPOP_REQUEST, targets[i], in bond_arp_send_all()
2399 static void bond_validate_arp(struct bonding *bond, struct slave *slave, __be32 sip, __be32 tip) in bond_validate_arp() argument
2415 slave->last_rx = jiffies; in bond_validate_arp()
2416 slave->target_last_arp_rx[i] = jiffies; in bond_validate_arp()
2420 struct slave *slave) in bond_arp_rcv() argument
2423 struct slave *curr_active_slave, *curr_arp_slave; in bond_arp_rcv()
2428 if (!slave_do_arp_validate(bond, slave)) { in bond_arp_rcv()
2431 slave->last_rx = jiffies; in bond_arp_rcv()
2465 slave->dev->name, bond_slave_state(slave), in bond_arp_rcv()
2466 bond->params.arp_validate, slave_do_arp_validate(bond, slave), in bond_arp_rcv()
2495 if (bond_is_active_slave(slave)) in bond_arp_rcv()
2496 bond_validate_arp(bond, slave, sip, tip); in bond_arp_rcv()
2500 bond_validate_arp(bond, slave, tip, sip); in bond_arp_rcv()
2504 bond_validate_arp(bond, slave, sip, tip); in bond_arp_rcv()
2536 struct slave *slave, *oldcurrent; in bond_loadbalance_arp_mon() local
2554 bond_for_each_slave_rcu(bond, slave, iter) { in bond_loadbalance_arp_mon()
2555 unsigned long trans_start = dev_trans_start(slave->dev); in bond_loadbalance_arp_mon()
2557 if (slave->link != BOND_LINK_UP) { in bond_loadbalance_arp_mon()
2559 bond_time_in_interval(bond, slave->last_rx, 1)) { in bond_loadbalance_arp_mon()
2561 slave->link = BOND_LINK_UP; in bond_loadbalance_arp_mon()
2571 slave->dev->name); in bond_loadbalance_arp_mon()
2575 slave->dev->name); in bond_loadbalance_arp_mon()
2586 !bond_time_in_interval(bond, slave->last_rx, 2)) { in bond_loadbalance_arp_mon()
2588 slave->link = BOND_LINK_DOWN; in bond_loadbalance_arp_mon()
2591 if (slave->link_failure_count < UINT_MAX) in bond_loadbalance_arp_mon()
2592 slave->link_failure_count++; in bond_loadbalance_arp_mon()
2595 slave->dev->name); in bond_loadbalance_arp_mon()
2597 if (slave == oldcurrent) in bond_loadbalance_arp_mon()
2609 if (bond_slave_is_up(slave)) in bond_loadbalance_arp_mon()
2610 bond_arp_send_all(bond, slave); in bond_loadbalance_arp_mon()
2649 struct slave *slave; in bond_ab_arp_inspect() local
2652 bond_for_each_slave_rcu(bond, slave, iter) { in bond_ab_arp_inspect()
2653 slave->new_link = BOND_LINK_NOCHANGE; in bond_ab_arp_inspect()
2654 last_rx = slave_last_rx(bond, slave); in bond_ab_arp_inspect()
2656 if (slave->link != BOND_LINK_UP) { in bond_ab_arp_inspect()
2658 slave->new_link = BOND_LINK_UP; in bond_ab_arp_inspect()
2668 if (bond_time_in_interval(bond, slave->last_link_up, 2)) in bond_ab_arp_inspect()
2683 if (!bond_is_active_slave(slave) && in bond_ab_arp_inspect()
2686 slave->new_link = BOND_LINK_DOWN; in bond_ab_arp_inspect()
2695 trans_start = dev_trans_start(slave->dev); in bond_ab_arp_inspect()
2696 if (bond_is_active_slave(slave) && in bond_ab_arp_inspect()
2699 slave->new_link = BOND_LINK_DOWN; in bond_ab_arp_inspect()
2716 struct slave *slave; in bond_ab_arp_commit() local
2718 bond_for_each_slave(bond, slave, iter) { in bond_ab_arp_commit()
2719 switch (slave->new_link) { in bond_ab_arp_commit()
2724 trans_start = dev_trans_start(slave->dev); in bond_ab_arp_commit()
2725 if (rtnl_dereference(bond->curr_active_slave) != slave || in bond_ab_arp_commit()
2728 struct slave *current_arp_slave; in bond_ab_arp_commit()
2731 bond_set_slave_link_state(slave, BOND_LINK_UP); in bond_ab_arp_commit()
2740 slave->dev->name); in bond_ab_arp_commit()
2743 slave == rtnl_dereference(bond->primary_slave)) in bond_ab_arp_commit()
2751 if (slave->link_failure_count < UINT_MAX) in bond_ab_arp_commit()
2752 slave->link_failure_count++; in bond_ab_arp_commit()
2754 bond_set_slave_link_state(slave, BOND_LINK_DOWN); in bond_ab_arp_commit()
2755 bond_set_slave_inactive_flags(slave, in bond_ab_arp_commit()
2759 slave->dev->name); in bond_ab_arp_commit()
2761 if (slave == rtnl_dereference(bond->curr_active_slave)) { in bond_ab_arp_commit()
2770 slave->new_link, slave->dev->name); in bond_ab_arp_commit()
2789 struct slave *slave, *before = NULL, *new_slave = NULL, in bond_ab_arp_probe() local
2819 bond_for_each_slave_rcu(bond, slave, iter) { in bond_ab_arp_probe()
2820 if (!found && !before && bond_slave_is_up(slave)) in bond_ab_arp_probe()
2821 before = slave; in bond_ab_arp_probe()
2823 if (found && !new_slave && bond_slave_is_up(slave)) in bond_ab_arp_probe()
2824 new_slave = slave; in bond_ab_arp_probe()
2832 if (!bond_slave_is_up(slave) && slave->link == BOND_LINK_UP) { in bond_ab_arp_probe()
2833 bond_set_slave_link_state(slave, BOND_LINK_DOWN); in bond_ab_arp_probe()
2834 if (slave->link_failure_count < UINT_MAX) in bond_ab_arp_probe()
2835 slave->link_failure_count++; in bond_ab_arp_probe()
2837 bond_set_slave_inactive_flags(slave, in bond_ab_arp_probe()
2841 slave->dev->name); in bond_ab_arp_probe()
2843 if (slave == curr_arp_slave) in bond_ab_arp_probe()
2860 bond_for_each_slave_rcu(bond, slave, iter) { in bond_ab_arp_probe()
2861 if (slave->should_notify) { in bond_ab_arp_probe()
2964 struct slave *slave = bond_slave_get_rtnl(slave_dev), *primary; in bond_slave_netdev_event() local
2972 if (!slave) in bond_slave_netdev_event()
2974 bond_dev = slave->bond->dev; in bond_slave_netdev_event()
2975 bond = slave->bond; in bond_slave_netdev_event()
2987 bond_update_speed_duplex(slave); in bond_slave_netdev_event()
2989 bond_3ad_adapter_speed_duplex_changed(slave); in bond_slave_netdev_event()
3022 if (slave == primary) { in bond_slave_netdev_event()
3027 rcu_assign_pointer(bond->primary_slave, slave); in bond_slave_netdev_event()
3044 call_netdevice_notifiers(event, slave->bond->dev); in bond_slave_netdev_event()
3201 struct slave *slave; in bond_open() local
3205 bond_for_each_slave(bond, slave, iter) { in bond_open()
3207 slave != rcu_access_pointer(bond->curr_active_slave)) { in bond_open()
3208 bond_set_slave_inactive_flags(slave, in bond_open()
3211 bond_set_slave_active_flags(slave, in bond_open()
3293 struct slave *slave; in bond_get_stats() local
3299 bond_for_each_slave_rcu(bond, slave, iter) { in bond_get_stats()
3301 dev_get_stats(slave->dev, &temp); in bond_get_stats()
3303 bond_fold_stats(stats, new, &slave->slave_stats); in bond_get_stats()
3306 memcpy(&slave->slave_stats, new, sizeof(*new)); in bond_get_stats()
3440 struct slave *slave; in bond_set_rx_mode() local
3444 slave = rcu_dereference(bond->curr_active_slave); in bond_set_rx_mode()
3445 if (slave) { in bond_set_rx_mode()
3446 dev_uc_sync(slave->dev, bond_dev); in bond_set_rx_mode()
3447 dev_mc_sync(slave->dev, bond_dev); in bond_set_rx_mode()
3450 bond_for_each_slave_rcu(bond, slave, iter) { in bond_set_rx_mode()
3451 dev_uc_sync_multiple(slave->dev, bond_dev); in bond_set_rx_mode()
3452 dev_mc_sync_multiple(slave->dev, bond_dev); in bond_set_rx_mode()
3463 struct slave *slave; in bond_neigh_init() local
3466 slave = bond_first_slave(bond); in bond_neigh_init()
3467 if (!slave) in bond_neigh_init()
3469 slave_ops = slave->dev->netdev_ops; in bond_neigh_init()
3475 ret = slave_ops->ndo_neigh_setup(slave->dev, &parms); in bond_neigh_init()
3514 struct slave *slave, *rollback_slave; in bond_change_mtu() local
3520 bond_for_each_slave(bond, slave, iter) { in bond_change_mtu()
3522 slave, slave->dev->netdev_ops->ndo_change_mtu); in bond_change_mtu()
3524 res = dev_set_mtu(slave->dev, new_mtu); in bond_change_mtu()
3536 slave->dev->name); in bond_change_mtu()
3550 if (rollback_slave == slave) in bond_change_mtu()
3572 struct slave *slave, *rollback_slave; in bond_set_mac_address() local
3593 bond_for_each_slave(bond, slave, iter) { in bond_set_mac_address()
3594 netdev_dbg(bond_dev, "slave %p %s\n", slave, slave->dev->name); in bond_set_mac_address()
3595 res = dev_set_mac_address(slave->dev, addr); in bond_set_mac_address()
3603 netdev_dbg(bond_dev, "err %d %s\n", res, slave->dev->name); in bond_set_mac_address()
3620 if (rollback_slave == slave) in bond_set_mac_address()
3646 struct slave *slave; in bond_xmit_slave_id() local
3650 bond_for_each_slave_rcu(bond, slave, iter) { in bond_xmit_slave_id()
3652 if (bond_slave_can_tx(slave)) { in bond_xmit_slave_id()
3653 bond_dev_queue_xmit(bond, skb, slave->dev); in bond_xmit_slave_id()
3661 bond_for_each_slave_rcu(bond, slave, iter) { in bond_xmit_slave_id()
3664 if (bond_slave_can_tx(slave)) { in bond_xmit_slave_id()
3665 bond_dev_queue_xmit(bond, skb, slave->dev); in bond_xmit_slave_id()
3710 struct slave *slave; in bond_xmit_roundrobin() local
3720 slave = rcu_dereference(bond->curr_active_slave); in bond_xmit_roundrobin()
3721 if (slave) in bond_xmit_roundrobin()
3722 bond_dev_queue_xmit(bond, skb, slave->dev); in bond_xmit_roundrobin()
3745 struct slave *slave; in bond_xmit_activebackup() local
3747 slave = rcu_dereference(bond->curr_active_slave); in bond_xmit_activebackup()
3748 if (slave) in bond_xmit_activebackup()
3749 bond_dev_queue_xmit(bond, skb, slave->dev); in bond_xmit_activebackup()
3795 int bond_update_slave_arr(struct bonding *bond, struct slave *skipslave) in bond_update_slave_arr()
3797 struct slave *slave; in bond_update_slave_arr() local
3832 bond_for_each_slave(bond, slave, iter) { in bond_update_slave_arr()
3836 agg = SLAVE_AD_INFO(slave)->port.aggregator; in bond_update_slave_arr()
3840 if (!bond_slave_can_tx(slave)) in bond_update_slave_arr()
3842 if (skipslave == slave) in bond_update_slave_arr()
3844 new_arr->arr[new_arr->count++] = slave; in bond_update_slave_arr()
3883 struct slave *slave; in bond_3ad_xor_xmit() local
3890 slave = slaves->arr[bond_xmit_hash(bond, skb) % count]; in bond_3ad_xor_xmit()
3891 bond_dev_queue_xmit(bond, skb, slave->dev); in bond_3ad_xor_xmit()
3903 struct slave *slave = NULL; in bond_xmit_broadcast() local
3906 bond_for_each_slave_rcu(bond, slave, iter) { in bond_xmit_broadcast()
3907 if (bond_is_last_slave(bond, slave)) in bond_xmit_broadcast()
3909 if (bond_slave_is_up(slave) && slave->link == BOND_LINK_UP) { in bond_xmit_broadcast()
3917 bond_dev_queue_xmit(bond, skb2, slave->dev); in bond_xmit_broadcast()
3920 if (slave && bond_slave_is_up(slave) && slave->link == BOND_LINK_UP) in bond_xmit_broadcast()
3921 bond_dev_queue_xmit(bond, skb, slave->dev); in bond_xmit_broadcast()
3934 struct slave *slave = NULL; in bond_slave_override() local
3941 bond_for_each_slave_rcu(bond, slave, iter) { in bond_slave_override()
3942 if (slave->queue_id == skb->queue_mapping) { in bond_slave_override()
3943 if (bond_slave_is_up(slave) && in bond_slave_override()
3944 slave->link == BOND_LINK_UP) { in bond_slave_override()
3945 bond_dev_queue_xmit(bond, skb, slave->dev); in bond_slave_override()
4036 struct slave *slave; in bond_ethtool_get_settings() local
4046 bond_for_each_slave(bond, slave, iter) { in bond_ethtool_get_settings()
4047 if (bond_slave_can_tx(slave)) { in bond_ethtool_get_settings()
4048 if (slave->speed != SPEED_UNKNOWN) in bond_ethtool_get_settings()
4049 speed += slave->speed; in bond_ethtool_get_settings()
4051 slave->duplex != DUPLEX_UNKNOWN) in bond_ethtool_get_settings()
4052 ecmd->duplex = slave->duplex; in bond_ethtool_get_settings()
4175 struct slave *slave; in bond_uninit() local
4181 bond_for_each_slave(bond, slave, iter) in bond_uninit()
4182 __bond_release_one(bond_dev, slave->dev, true); in bond_uninit()