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()
716 struct slave *prim = rtnl_dereference(bond->primary_slave); in bond_should_change_active()
717 struct slave *curr = rtnl_dereference(bond->curr_active_slave); in bond_should_change_active()
738 static struct slave *bond_find_best_slave(struct bonding *bond) in bond_find_best_slave()
740 struct slave *slave, *bestslave = NULL, *primary; in bond_find_best_slave() local
749 bond_for_each_slave(bond, slave, iter) { in bond_find_best_slave()
750 if (slave->link == BOND_LINK_UP) in bond_find_best_slave()
751 return slave; in bond_find_best_slave()
752 if (slave->link == BOND_LINK_BACK && bond_slave_is_up(slave) && in bond_find_best_slave()
753 slave->delay < mintime) { in bond_find_best_slave()
754 mintime = slave->delay; in bond_find_best_slave()
755 bestslave = slave; in bond_find_best_slave()
764 struct slave *slave; in bond_should_notify_peers() local
767 slave = rcu_dereference(bond->curr_active_slave); in bond_should_notify_peers()
771 slave ? slave->dev->name : "NULL"); in bond_should_notify_peers()
773 if (!slave || !bond->send_peer_notif || in bond_should_notify_peers()
774 test_bit(__LINK_STATE_LINKWATCH_PENDING, &slave->dev->state)) in bond_should_notify_peers()
795 void bond_change_active_slave(struct bonding *bond, struct slave *new_active) in bond_change_active_slave()
797 struct slave *old_active; in bond_change_active_slave()
902 struct slave *best_slave; in bond_select_active_slave()
923 static inline int slave_enable_netpoll(struct slave *slave) in slave_enable_netpoll() argument
933 err = __netpoll_setup(np, slave->dev); in slave_enable_netpoll()
938 slave->np = np; in slave_enable_netpoll()
942 static inline void slave_disable_netpoll(struct slave *slave) in slave_disable_netpoll() argument
944 struct netpoll *np = slave->np; in slave_disable_netpoll()
949 slave->np = NULL; in slave_disable_netpoll()
956 struct slave *slave = NULL; in bond_poll_controller() local
967 bond_for_each_slave_rcu(bond, slave, iter) { in bond_poll_controller()
968 ops = slave->dev->netdev_ops; in bond_poll_controller()
969 if (!bond_slave_is_up(slave) || !ops->ndo_poll_controller) in bond_poll_controller()
974 SLAVE_AD_INFO(slave)->port.aggregator; in bond_poll_controller()
981 ni = rcu_dereference_bh(slave->dev->npinfo); in bond_poll_controller()
984 ops->ndo_poll_controller(slave->dev); in bond_poll_controller()
994 struct slave *slave; in bond_netpoll_cleanup() local
996 bond_for_each_slave(bond, slave, iter) in bond_netpoll_cleanup()
997 if (bond_slave_is_up(slave)) in bond_netpoll_cleanup()
998 slave_disable_netpoll(slave); in bond_netpoll_cleanup()
1005 struct slave *slave; in bond_netpoll_setup() local
1008 bond_for_each_slave(bond, slave, iter) { in bond_netpoll_setup()
1009 err = slave_enable_netpoll(slave); in bond_netpoll_setup()
1018 static inline int slave_enable_netpoll(struct slave *slave) in slave_enable_netpoll() argument
1022 static inline void slave_disable_netpoll(struct slave *slave) in slave_disable_netpoll() argument
1038 struct slave *slave; in bond_fix_features() local
1048 bond_for_each_slave(bond, slave, iter) { in bond_fix_features()
1050 slave->dev->features, in bond_fix_features()
1073 struct slave *slave; in bond_compute_features() local
1082 bond_for_each_slave(bond, slave, iter) { in bond_compute_features()
1084 slave->dev->vlan_features, BOND_VLAN_FEATURES); in bond_compute_features()
1087 slave->dev->hw_enc_features, in bond_compute_features()
1089 dst_release_flag &= slave->dev->priv_flags; in bond_compute_features()
1090 if (slave->dev->hard_header_len > max_hard_header_len) in bond_compute_features()
1091 max_hard_header_len = slave->dev->hard_header_len; in bond_compute_features()
1093 gso_max_size = min(gso_max_size, slave->dev->gso_max_size); in bond_compute_features()
1094 gso_max_segs = min(gso_max_segs, slave->dev->gso_max_segs); in bond_compute_features()
1129 struct slave *slave, in bond_should_deliver_exact_match() argument
1132 if (bond_is_slave_inactive(slave)) { in bond_should_deliver_exact_match()
1145 struct slave *slave; in bond_handle_frame() local
1148 struct slave *); in bond_handle_frame()
1157 slave = bond_slave_get_rcu(skb->dev); in bond_handle_frame()
1158 bond = slave->bond; in bond_handle_frame()
1162 ret = recv_probe(skb, bond, slave); in bond_handle_frame()
1169 if (bond_should_deliver_exact_match(skb, slave, bond)) { in bond_handle_frame()
1192 struct slave *slave) in bond_master_upper_dev_link() argument
1196 err = netdev_master_upper_dev_link_private(slave_dev, bond_dev, slave); in bond_master_upper_dev_link()
1211 static struct slave *bond_alloc_slave(struct bonding *bond) in bond_alloc_slave()
1213 struct slave *slave = NULL; in bond_alloc_slave() local
1215 slave = kzalloc(sizeof(struct slave), GFP_KERNEL); in bond_alloc_slave()
1216 if (!slave) in bond_alloc_slave()
1220 SLAVE_AD_INFO(slave) = kzalloc(sizeof(struct ad_slave_info), in bond_alloc_slave()
1222 if (!SLAVE_AD_INFO(slave)) { in bond_alloc_slave()
1223 kfree(slave); in bond_alloc_slave()
1227 return slave; in bond_alloc_slave()
1230 static void bond_free_slave(struct slave *slave) in bond_free_slave() argument
1232 struct bonding *bond = bond_get_bond_by_slave(slave); in bond_free_slave()
1235 kfree(SLAVE_AD_INFO(slave)); in bond_free_slave()
1237 kfree(slave); in bond_free_slave()
1247 static void bond_fill_ifslave(struct slave *slave, struct ifslave *info) in bond_fill_ifslave() argument
1249 strcpy(info->slave_name, slave->dev->name); in bond_fill_ifslave()
1250 info->link = slave->link; in bond_fill_ifslave()
1251 info->state = bond_slave_state(slave); in bond_fill_ifslave()
1252 info->link_failure_count = slave->link_failure_count; in bond_fill_ifslave()
1273 void bond_queue_slave_event(struct slave *slave) in bond_queue_slave_event() argument
1275 struct bonding *bond = slave->bond; in bond_queue_slave_event()
1281 dev_hold(slave->dev); in bond_queue_slave_event()
1282 nnw->dev = slave->dev; in bond_queue_slave_event()
1283 bond_fill_ifslave(slave, &nnw->bonding_info.slave); in bond_queue_slave_event()
1287 queue_delayed_work(slave->bond->wq, &nnw->work, 0); in bond_queue_slave_event()
1295 struct slave *new_slave = NULL, *prev_slave; in bond_enslave()
1762 struct slave *slave, *oldcurrent; in __bond_release_one() local
1777 slave = bond_get_slave_by_dev(bond, slave_dev); in __bond_release_one()
1778 if (!slave) { in __bond_release_one()
1786 bond_sysfs_slave_del(slave); in __bond_release_one()
1798 bond_3ad_unbind_slave(slave); in __bond_release_one()
1801 bond_update_slave_arr(bond, slave); in __bond_release_one()
1804 bond_is_active_slave(slave) ? "active" : "backup", in __bond_release_one()
1813 if (ether_addr_equal_64bits(bond_dev->dev_addr, slave->perm_hwaddr) && in __bond_release_one()
1816 slave_dev->name, slave->perm_hwaddr, in __bond_release_one()
1820 if (rtnl_dereference(bond->primary_slave) == slave) in __bond_release_one()
1823 if (oldcurrent == slave) in __bond_release_one()
1832 bond_alb_deinit_slave(bond, slave); in __bond_release_one()
1837 } else if (oldcurrent == slave) { in __bond_release_one()
1888 slave_disable_netpoll(slave); in __bond_release_one()
1896 ether_addr_copy(addr.sa_data, slave->perm_hwaddr); in __bond_release_one()
1901 dev_set_mtu(slave_dev, slave->original_mtu); in __bond_release_one()
1905 bond_free_slave(slave); in __bond_release_one()
1948 struct slave *slave; in bond_slave_info_query() local
1950 bond_for_each_slave(bond, slave, iter) { in bond_slave_info_query()
1953 bond_fill_ifslave(slave, info); in bond_slave_info_query()
1968 struct slave *slave; in bond_miimon_inspect() local
1973 bond_for_each_slave_rcu(bond, slave, iter) { in bond_miimon_inspect()
1974 slave->new_link = BOND_LINK_NOCHANGE; in bond_miimon_inspect()
1976 link_state = bond_check_dev_link(bond, slave->dev, 0); in bond_miimon_inspect()
1978 switch (slave->link) { in bond_miimon_inspect()
1983 bond_set_slave_link_state(slave, BOND_LINK_FAIL); in bond_miimon_inspect()
1984 slave->delay = bond->params.downdelay; in bond_miimon_inspect()
1985 if (slave->delay) { in bond_miimon_inspect()
1989 (bond_is_active_slave(slave) ? in bond_miimon_inspect()
1991 slave->dev->name, in bond_miimon_inspect()
1998 bond_set_slave_link_state(slave, BOND_LINK_UP); in bond_miimon_inspect()
1999 slave->last_link_up = jiffies; in bond_miimon_inspect()
2001 (bond->params.downdelay - slave->delay) * in bond_miimon_inspect()
2003 slave->dev->name); in bond_miimon_inspect()
2007 if (slave->delay <= 0) { in bond_miimon_inspect()
2008 slave->new_link = BOND_LINK_DOWN; in bond_miimon_inspect()
2013 slave->delay--; in bond_miimon_inspect()
2020 bond_set_slave_link_state(slave, BOND_LINK_BACK); in bond_miimon_inspect()
2021 slave->delay = bond->params.updelay; in bond_miimon_inspect()
2023 if (slave->delay) { in bond_miimon_inspect()
2025 slave->dev->name, in bond_miimon_inspect()
2033 bond_set_slave_link_state(slave, in bond_miimon_inspect()
2036 (bond->params.updelay - slave->delay) * in bond_miimon_inspect()
2038 slave->dev->name); in bond_miimon_inspect()
2044 slave->delay = 0; in bond_miimon_inspect()
2046 if (slave->delay <= 0) { in bond_miimon_inspect()
2047 slave->new_link = BOND_LINK_UP; in bond_miimon_inspect()
2053 slave->delay--; in bond_miimon_inspect()
2064 struct slave *slave, *primary; in bond_miimon_commit() local
2066 bond_for_each_slave(bond, slave, iter) { in bond_miimon_commit()
2067 switch (slave->new_link) { in bond_miimon_commit()
2072 bond_set_slave_link_state(slave, BOND_LINK_UP); in bond_miimon_commit()
2073 slave->last_link_up = jiffies; in bond_miimon_commit()
2078 bond_set_backup_slave(slave); in bond_miimon_commit()
2081 bond_set_active_slave(slave); in bond_miimon_commit()
2082 } else if (slave != primary) { in bond_miimon_commit()
2084 bond_set_backup_slave(slave); in bond_miimon_commit()
2088 slave->dev->name, in bond_miimon_commit()
2089 slave->speed == SPEED_UNKNOWN ? 0 : slave->speed, in bond_miimon_commit()
2090 slave->duplex ? "full" : "half"); in bond_miimon_commit()
2094 bond_3ad_handle_link_change(slave, BOND_LINK_UP); in bond_miimon_commit()
2097 bond_alb_handle_link_change(bond, slave, in bond_miimon_commit()
2103 if (!bond->curr_active_slave || slave == primary) in bond_miimon_commit()
2109 if (slave->link_failure_count < UINT_MAX) in bond_miimon_commit()
2110 slave->link_failure_count++; in bond_miimon_commit()
2112 bond_set_slave_link_state(slave, BOND_LINK_DOWN); in bond_miimon_commit()
2116 bond_set_slave_inactive_flags(slave, in bond_miimon_commit()
2120 slave->dev->name); in bond_miimon_commit()
2123 bond_3ad_handle_link_change(slave, in bond_miimon_commit()
2127 bond_alb_handle_link_change(bond, slave, in bond_miimon_commit()
2133 if (slave == rcu_access_pointer(bond->curr_active_slave)) in bond_miimon_commit()
2140 slave->new_link, slave->dev->name); in bond_miimon_commit()
2141 slave->new_link = BOND_LINK_NOCHANGE; in bond_miimon_commit()
2324 static void bond_arp_send_all(struct bonding *bond, struct slave *slave) in bond_arp_send_all() argument
2346 bond_arp_send(slave->dev, ARPOP_REQUEST, targets[i], in bond_arp_send_all()
2372 bond_arp_send(slave->dev, ARPOP_REQUEST, targets[i], in bond_arp_send_all()
2378 static void bond_validate_arp(struct bonding *bond, struct slave *slave, __be32 sip, __be32 tip) in bond_validate_arp() argument
2394 slave->last_rx = jiffies; in bond_validate_arp()
2395 slave->target_last_arp_rx[i] = jiffies; in bond_validate_arp()
2399 struct slave *slave) in bond_arp_rcv() argument
2402 struct slave *curr_active_slave, *curr_arp_slave; in bond_arp_rcv()
2407 if (!slave_do_arp_validate(bond, slave)) { in bond_arp_rcv()
2410 slave->last_rx = jiffies; in bond_arp_rcv()
2444 slave->dev->name, bond_slave_state(slave), in bond_arp_rcv()
2445 bond->params.arp_validate, slave_do_arp_validate(bond, slave), in bond_arp_rcv()
2474 if (bond_is_active_slave(slave)) in bond_arp_rcv()
2475 bond_validate_arp(bond, slave, sip, tip); in bond_arp_rcv()
2479 bond_validate_arp(bond, slave, tip, sip); in bond_arp_rcv()
2483 bond_validate_arp(bond, slave, sip, tip); in bond_arp_rcv()
2515 struct slave *slave, *oldcurrent; in bond_loadbalance_arp_mon() local
2533 bond_for_each_slave_rcu(bond, slave, iter) { in bond_loadbalance_arp_mon()
2534 unsigned long trans_start = dev_trans_start(slave->dev); in bond_loadbalance_arp_mon()
2536 if (slave->link != BOND_LINK_UP) { in bond_loadbalance_arp_mon()
2538 bond_time_in_interval(bond, slave->last_rx, 1)) { in bond_loadbalance_arp_mon()
2540 slave->link = BOND_LINK_UP; in bond_loadbalance_arp_mon()
2550 slave->dev->name); in bond_loadbalance_arp_mon()
2554 slave->dev->name); in bond_loadbalance_arp_mon()
2565 !bond_time_in_interval(bond, slave->last_rx, 2)) { in bond_loadbalance_arp_mon()
2567 slave->link = BOND_LINK_DOWN; in bond_loadbalance_arp_mon()
2570 if (slave->link_failure_count < UINT_MAX) in bond_loadbalance_arp_mon()
2571 slave->link_failure_count++; in bond_loadbalance_arp_mon()
2574 slave->dev->name); in bond_loadbalance_arp_mon()
2576 if (slave == oldcurrent) in bond_loadbalance_arp_mon()
2588 if (bond_slave_is_up(slave)) in bond_loadbalance_arp_mon()
2589 bond_arp_send_all(bond, slave); in bond_loadbalance_arp_mon()
2628 struct slave *slave; in bond_ab_arp_inspect() local
2631 bond_for_each_slave_rcu(bond, slave, iter) { in bond_ab_arp_inspect()
2632 slave->new_link = BOND_LINK_NOCHANGE; in bond_ab_arp_inspect()
2633 last_rx = slave_last_rx(bond, slave); in bond_ab_arp_inspect()
2635 if (slave->link != BOND_LINK_UP) { in bond_ab_arp_inspect()
2637 slave->new_link = BOND_LINK_UP; in bond_ab_arp_inspect()
2647 if (bond_time_in_interval(bond, slave->last_link_up, 2)) in bond_ab_arp_inspect()
2662 if (!bond_is_active_slave(slave) && in bond_ab_arp_inspect()
2665 slave->new_link = BOND_LINK_DOWN; in bond_ab_arp_inspect()
2674 trans_start = dev_trans_start(slave->dev); in bond_ab_arp_inspect()
2675 if (bond_is_active_slave(slave) && in bond_ab_arp_inspect()
2678 slave->new_link = BOND_LINK_DOWN; in bond_ab_arp_inspect()
2695 struct slave *slave; in bond_ab_arp_commit() local
2697 bond_for_each_slave(bond, slave, iter) { in bond_ab_arp_commit()
2698 switch (slave->new_link) { in bond_ab_arp_commit()
2703 trans_start = dev_trans_start(slave->dev); in bond_ab_arp_commit()
2704 if (rtnl_dereference(bond->curr_active_slave) != slave || in bond_ab_arp_commit()
2707 struct slave *current_arp_slave; in bond_ab_arp_commit()
2710 bond_set_slave_link_state(slave, BOND_LINK_UP); in bond_ab_arp_commit()
2719 slave->dev->name); in bond_ab_arp_commit()
2722 slave == rtnl_dereference(bond->primary_slave)) in bond_ab_arp_commit()
2730 if (slave->link_failure_count < UINT_MAX) in bond_ab_arp_commit()
2731 slave->link_failure_count++; in bond_ab_arp_commit()
2733 bond_set_slave_link_state(slave, BOND_LINK_DOWN); in bond_ab_arp_commit()
2734 bond_set_slave_inactive_flags(slave, in bond_ab_arp_commit()
2738 slave->dev->name); in bond_ab_arp_commit()
2740 if (slave == rtnl_dereference(bond->curr_active_slave)) { in bond_ab_arp_commit()
2749 slave->new_link, slave->dev->name); in bond_ab_arp_commit()
2768 struct slave *slave, *before = NULL, *new_slave = NULL, in bond_ab_arp_probe() local
2798 bond_for_each_slave_rcu(bond, slave, iter) { in bond_ab_arp_probe()
2799 if (!found && !before && bond_slave_is_up(slave)) in bond_ab_arp_probe()
2800 before = slave; in bond_ab_arp_probe()
2802 if (found && !new_slave && bond_slave_is_up(slave)) in bond_ab_arp_probe()
2803 new_slave = slave; in bond_ab_arp_probe()
2811 if (!bond_slave_is_up(slave) && slave->link == BOND_LINK_UP) { in bond_ab_arp_probe()
2812 bond_set_slave_link_state(slave, BOND_LINK_DOWN); in bond_ab_arp_probe()
2813 if (slave->link_failure_count < UINT_MAX) in bond_ab_arp_probe()
2814 slave->link_failure_count++; in bond_ab_arp_probe()
2816 bond_set_slave_inactive_flags(slave, in bond_ab_arp_probe()
2820 slave->dev->name); in bond_ab_arp_probe()
2822 if (slave == curr_arp_slave) in bond_ab_arp_probe()
2839 bond_for_each_slave_rcu(bond, slave, iter) { in bond_ab_arp_probe()
2840 if (slave->should_notify) { in bond_ab_arp_probe()
2943 struct slave *slave = bond_slave_get_rtnl(slave_dev), *primary; in bond_slave_netdev_event() local
2953 if (!slave) in bond_slave_netdev_event()
2955 bond_dev = slave->bond->dev; in bond_slave_netdev_event()
2956 bond = slave->bond; in bond_slave_netdev_event()
2968 old_speed = slave->speed; in bond_slave_netdev_event()
2969 old_duplex = slave->duplex; in bond_slave_netdev_event()
2971 bond_update_speed_duplex(slave); in bond_slave_netdev_event()
2974 if (old_speed != slave->speed) in bond_slave_netdev_event()
2975 bond_3ad_adapter_speed_changed(slave); in bond_slave_netdev_event()
2976 if (old_duplex != slave->duplex) in bond_slave_netdev_event()
2977 bond_3ad_adapter_duplex_changed(slave); in bond_slave_netdev_event()
3011 if (slave == primary) { in bond_slave_netdev_event()
3016 rcu_assign_pointer(bond->primary_slave, slave); in bond_slave_netdev_event()
3033 call_netdevice_notifiers(event, slave->bond->dev); in bond_slave_netdev_event()
3187 struct slave *slave; in bond_open() local
3191 bond_for_each_slave(bond, slave, iter) { in bond_open()
3193 slave != rcu_access_pointer(bond->curr_active_slave)) { in bond_open()
3194 bond_set_slave_inactive_flags(slave, in bond_open()
3197 bond_set_slave_active_flags(slave, in bond_open()
3255 struct slave *slave; in bond_get_stats() local
3259 bond_for_each_slave(bond, slave, iter) { in bond_get_stats()
3261 dev_get_stats(slave->dev, &temp); in bond_get_stats()
3262 struct rtnl_link_stats64 *pstats = &slave->slave_stats; in bond_get_stats()
3422 struct slave *slave; in bond_set_rx_mode() local
3426 slave = rcu_dereference(bond->curr_active_slave); in bond_set_rx_mode()
3427 if (slave) { in bond_set_rx_mode()
3428 dev_uc_sync(slave->dev, bond_dev); in bond_set_rx_mode()
3429 dev_mc_sync(slave->dev, bond_dev); in bond_set_rx_mode()
3432 bond_for_each_slave_rcu(bond, slave, iter) { in bond_set_rx_mode()
3433 dev_uc_sync_multiple(slave->dev, bond_dev); in bond_set_rx_mode()
3434 dev_mc_sync_multiple(slave->dev, bond_dev); in bond_set_rx_mode()
3445 struct slave *slave; in bond_neigh_init() local
3448 slave = bond_first_slave(bond); in bond_neigh_init()
3449 if (!slave) in bond_neigh_init()
3451 slave_ops = slave->dev->netdev_ops; in bond_neigh_init()
3457 ret = slave_ops->ndo_neigh_setup(slave->dev, &parms); in bond_neigh_init()
3496 struct slave *slave, *rollback_slave; in bond_change_mtu() local
3502 bond_for_each_slave(bond, slave, iter) { in bond_change_mtu()
3504 slave, slave->dev->netdev_ops->ndo_change_mtu); in bond_change_mtu()
3506 res = dev_set_mtu(slave->dev, new_mtu); in bond_change_mtu()
3518 slave->dev->name); in bond_change_mtu()
3532 if (rollback_slave == slave) in bond_change_mtu()
3554 struct slave *slave, *rollback_slave; in bond_set_mac_address() local
3575 bond_for_each_slave(bond, slave, iter) { in bond_set_mac_address()
3576 netdev_dbg(bond_dev, "slave %p %s\n", slave, slave->dev->name); in bond_set_mac_address()
3577 res = dev_set_mac_address(slave->dev, addr); in bond_set_mac_address()
3585 netdev_dbg(bond_dev, "err %d %s\n", res, slave->dev->name); in bond_set_mac_address()
3602 if (rollback_slave == slave) in bond_set_mac_address()
3628 struct slave *slave; in bond_xmit_slave_id() local
3632 bond_for_each_slave_rcu(bond, slave, iter) { in bond_xmit_slave_id()
3634 if (bond_slave_can_tx(slave)) { in bond_xmit_slave_id()
3635 bond_dev_queue_xmit(bond, skb, slave->dev); in bond_xmit_slave_id()
3643 bond_for_each_slave_rcu(bond, slave, iter) { in bond_xmit_slave_id()
3646 if (bond_slave_can_tx(slave)) { in bond_xmit_slave_id()
3647 bond_dev_queue_xmit(bond, skb, slave->dev); in bond_xmit_slave_id()
3692 struct slave *slave; in bond_xmit_roundrobin() local
3702 slave = rcu_dereference(bond->curr_active_slave); in bond_xmit_roundrobin()
3703 if (slave) in bond_xmit_roundrobin()
3704 bond_dev_queue_xmit(bond, skb, slave->dev); in bond_xmit_roundrobin()
3727 struct slave *slave; in bond_xmit_activebackup() local
3729 slave = rcu_dereference(bond->curr_active_slave); in bond_xmit_activebackup()
3730 if (slave) in bond_xmit_activebackup()
3731 bond_dev_queue_xmit(bond, skb, slave->dev); in bond_xmit_activebackup()
3777 int bond_update_slave_arr(struct bonding *bond, struct slave *skipslave) in bond_update_slave_arr()
3779 struct slave *slave; in bond_update_slave_arr() local
3816 bond_for_each_slave(bond, slave, iter) { in bond_update_slave_arr()
3820 agg = SLAVE_AD_INFO(slave)->port.aggregator; in bond_update_slave_arr()
3824 if (!bond_slave_can_tx(slave)) in bond_update_slave_arr()
3826 if (skipslave == slave) in bond_update_slave_arr()
3828 new_arr->arr[new_arr->count++] = slave; in bond_update_slave_arr()
3867 struct slave *slave; in bond_3ad_xor_xmit() local
3874 slave = slaves->arr[bond_xmit_hash(bond, skb) % count]; in bond_3ad_xor_xmit()
3875 bond_dev_queue_xmit(bond, skb, slave->dev); in bond_3ad_xor_xmit()
3887 struct slave *slave = NULL; in bond_xmit_broadcast() local
3890 bond_for_each_slave_rcu(bond, slave, iter) { in bond_xmit_broadcast()
3891 if (bond_is_last_slave(bond, slave)) in bond_xmit_broadcast()
3893 if (bond_slave_is_up(slave) && slave->link == BOND_LINK_UP) { in bond_xmit_broadcast()
3901 bond_dev_queue_xmit(bond, skb2, slave->dev); in bond_xmit_broadcast()
3904 if (slave && bond_slave_is_up(slave) && slave->link == BOND_LINK_UP) in bond_xmit_broadcast()
3905 bond_dev_queue_xmit(bond, skb, slave->dev); in bond_xmit_broadcast()
3918 struct slave *slave = NULL; in bond_slave_override() local
3925 bond_for_each_slave_rcu(bond, slave, iter) { in bond_slave_override()
3926 if (slave->queue_id == skb->queue_mapping) { in bond_slave_override()
3927 if (bond_slave_is_up(slave) && in bond_slave_override()
3928 slave->link == BOND_LINK_UP) { in bond_slave_override()
3929 bond_dev_queue_xmit(bond, skb, slave->dev); in bond_slave_override()
4020 struct slave *slave; in bond_ethtool_get_settings() local
4030 bond_for_each_slave(bond, slave, iter) { in bond_ethtool_get_settings()
4031 if (bond_slave_can_tx(slave)) { in bond_ethtool_get_settings()
4032 if (slave->speed != SPEED_UNKNOWN) in bond_ethtool_get_settings()
4033 speed += slave->speed; in bond_ethtool_get_settings()
4035 slave->duplex != DUPLEX_UNKNOWN) in bond_ethtool_get_settings()
4036 ecmd->duplex = slave->duplex; in bond_ethtool_get_settings()
4155 struct slave *slave; in bond_uninit() local
4161 bond_for_each_slave(bond, slave, iter) in bond_uninit()
4162 __bond_release_one(bond_dev, slave->dev, true); in bond_uninit()