Lines Matching refs:bond
50 #define BOND_MODE(bond) ((bond)->params.mode) argument
53 #define bond_slave_list(bond) (&(bond)->dev->adj_list.lower) argument
55 #define bond_has_slaves(bond) !list_empty(bond_slave_list(bond)) argument
58 #define bond_first_slave(bond) \ argument
59 (bond_has_slaves(bond) ? \
60 netdev_adjacent_get_private(bond_slave_list(bond)->next) : \
62 #define bond_last_slave(bond) \ argument
63 (bond_has_slaves(bond) ? \
64 netdev_adjacent_get_private(bond_slave_list(bond)->prev) : \
68 #define bond_first_slave_rcu(bond) \ argument
69 netdev_lower_get_first_private_rcu(bond->dev)
71 #define bond_is_first_slave(bond, pos) (pos == bond_first_slave(bond)) argument
72 #define bond_is_last_slave(bond, pos) (pos == bond_last_slave(bond)) argument
82 #define bond_for_each_slave(bond, pos, iter) \ argument
83 netdev_for_each_lower_private((bond)->dev, pos, iter)
86 #define bond_for_each_slave_rcu(bond, pos, iter) \ argument
87 netdev_for_each_lower_private_rcu((bond)->dev, pos, iter)
157 struct bonding *bond; /* our master */ member
280 static inline struct slave *bond_get_slave_by_dev(struct bonding *bond, in bond_get_slave_by_dev() argument
283 return netdev_lower_dev_get_private(bond->dev, slave_dev); in bond_get_slave_by_dev()
288 return slave->bond; in bond_get_bond_by_slave()
291 static inline bool bond_should_override_tx_queue(struct bonding *bond) in bond_should_override_tx_queue() argument
293 return BOND_MODE(bond) == BOND_MODE_ACTIVEBACKUP || in bond_should_override_tx_queue()
294 BOND_MODE(bond) == BOND_MODE_ROUNDROBIN; in bond_should_override_tx_queue()
297 static inline bool bond_is_lb(const struct bonding *bond) in bond_is_lb() argument
299 return BOND_MODE(bond) == BOND_MODE_TLB || in bond_is_lb()
300 BOND_MODE(bond) == BOND_MODE_ALB; in bond_is_lb()
303 static inline bool bond_needs_speed_duplex(const struct bonding *bond) in bond_needs_speed_duplex() argument
305 return BOND_MODE(bond) == BOND_MODE_8023AD || bond_is_lb(bond); in bond_needs_speed_duplex()
308 static inline bool bond_is_nondyn_tlb(const struct bonding *bond) in bond_is_nondyn_tlb() argument
310 return (bond_is_lb(bond) && bond->params.tlb_dynamic_lb == 0); in bond_is_nondyn_tlb()
313 static inline bool bond_mode_can_use_xmit_hash(const struct bonding *bond) in bond_mode_can_use_xmit_hash() argument
315 return (BOND_MODE(bond) == BOND_MODE_8023AD || in bond_mode_can_use_xmit_hash()
316 BOND_MODE(bond) == BOND_MODE_XOR || in bond_mode_can_use_xmit_hash()
317 BOND_MODE(bond) == BOND_MODE_TLB || in bond_mode_can_use_xmit_hash()
318 BOND_MODE(bond) == BOND_MODE_ALB); in bond_mode_can_use_xmit_hash()
321 static inline bool bond_mode_uses_xmit_hash(const struct bonding *bond) in bond_mode_uses_xmit_hash() argument
323 return (BOND_MODE(bond) == BOND_MODE_8023AD || in bond_mode_uses_xmit_hash()
324 BOND_MODE(bond) == BOND_MODE_XOR || in bond_mode_uses_xmit_hash()
325 bond_is_nondyn_tlb(bond)); in bond_mode_uses_xmit_hash()
340 static inline bool bond_uses_primary(struct bonding *bond) in bond_uses_primary() argument
342 return bond_mode_uses_primary(BOND_MODE(bond)); in bond_uses_primary()
345 static inline struct net_device *bond_option_active_slave_get_rcu(struct bonding *bond) in bond_option_active_slave_get_rcu() argument
347 struct slave *slave = rcu_dereference(bond->curr_active_slave); in bond_option_active_slave_get_rcu()
349 return bond_uses_primary(bond) && slave ? slave->dev : NULL; in bond_option_active_slave_get_rcu()
394 static inline void bond_slave_state_change(struct bonding *bond) in bond_slave_state_change() argument
399 bond_for_each_slave(bond, tmp, iter) { in bond_slave_state_change()
407 static inline void bond_slave_state_notify(struct bonding *bond) in bond_slave_state_notify() argument
412 bond_for_each_slave(bond, tmp, iter) { in bond_slave_state_notify()
484 static inline int slave_do_arp_validate(struct bonding *bond, in slave_do_arp_validate() argument
487 return bond->params.arp_validate & (1 << bond_slave_state(slave)); in slave_do_arp_validate()
490 static inline int slave_do_arp_validate_only(struct bonding *bond) in slave_do_arp_validate_only() argument
492 return bond->params.arp_validate & BOND_ARP_FILTER; in slave_do_arp_validate_only()
503 static inline unsigned long slave_oldest_target_arp_rx(struct bonding *bond, in slave_oldest_target_arp_rx() argument
509 for (; (i < BOND_MAX_ARP_TARGETS) && bond->params.arp_targets[i]; i++) in slave_oldest_target_arp_rx()
516 static inline unsigned long slave_last_rx(struct bonding *bond, in slave_last_rx() argument
519 if (bond->params.arp_all_targets == BOND_ARP_TARGETS_ALL) in slave_last_rx()
520 return slave_oldest_target_arp_rx(bond, slave); in slave_last_rx()
543 if (!bond_is_lb(slave->bond)) in bond_set_slave_inactive_flags()
545 if (!slave->bond->params.all_slaves_active) in bond_set_slave_inactive_flags()
591 static inline void bond_slave_link_notify(struct bonding *bond) in bond_slave_link_notify() argument
596 bond_for_each_slave(bond, tmp, iter) { in bond_slave_link_notify()
629 int bond_arp_rcv(const struct sk_buff *skb, struct bonding *bond, struct slave *slave);
630 netdev_tx_t bond_dev_queue_xmit(struct bonding *bond, struct sk_buff *skb, struct net_device *slave…
634 void bond_prepare_sysfs_group(struct bonding *bond);
640 u32 bond_xmit_hash(struct bonding *bond, struct sk_buff *skb);
641 int bond_set_carrier(struct bonding *bond);
642 void bond_select_active_slave(struct bonding *bond);
643 void bond_change_active_slave(struct bonding *bond, struct slave *new_active);
646 void bond_debug_register(struct bonding *bond);
647 void bond_debug_unregister(struct bonding *bond);
648 void bond_debug_reregister(struct bonding *bond);
654 struct net_device *bond_option_active_slave_get_rcu(struct bonding *bond);
659 int bond_update_slave_arr(struct bonding *bond, struct slave *skipslave);
660 void bond_slave_arr_work_rearm(struct bonding *bond, unsigned long delay);
661 void bond_work_init_all(struct bonding *bond);
664 void bond_create_proc_entry(struct bonding *bond);
665 void bond_remove_proc_entry(struct bonding *bond);
669 static inline void bond_create_proc_entry(struct bonding *bond) in bond_create_proc_entry() argument
673 static inline void bond_remove_proc_entry(struct bonding *bond) in bond_remove_proc_entry() argument
686 static inline struct slave *bond_slave_has_mac(struct bonding *bond, in bond_slave_has_mac() argument
692 bond_for_each_slave(bond, tmp, iter) in bond_slave_has_mac()
700 static inline struct slave *bond_slave_has_mac_rcu(struct bonding *bond, in bond_slave_has_mac_rcu() argument
706 bond_for_each_slave_rcu(bond, tmp, iter) in bond_slave_has_mac_rcu()
714 static inline bool bond_slave_has_mac_rx(struct bonding *bond, const u8 *mac) in bond_slave_has_mac_rx() argument
720 bond_for_each_slave_rcu(bond, tmp, iter) in bond_slave_has_mac_rx()
724 if (netdev_uc_empty(bond->dev)) in bond_slave_has_mac_rx()
727 netdev_for_each_uc_addr(ha, bond->dev) in bond_slave_has_mac_rx()