Lines Matching full:bond

3  * Bond several ethernet interfaces into a Cisco, running 'Etherchannel'.
51 #define BOND_MODE(bond) ((bond)->params.mode) argument
54 #define bond_slave_list(bond) (&(bond)->dev->adj_list.lower) argument
56 #define bond_has_slaves(bond) !list_empty(bond_slave_list(bond)) argument
59 #define bond_first_slave(bond) \ argument
60 (bond_has_slaves(bond) ? \
61 netdev_adjacent_get_private(bond_slave_list(bond)->next) : \
63 #define bond_last_slave(bond) \ argument
64 (bond_has_slaves(bond) ? \
65 netdev_adjacent_get_private(bond_slave_list(bond)->prev) : \
69 #define bond_first_slave_rcu(bond) \ argument
70 netdev_lower_get_first_private_rcu(bond->dev)
72 #define bond_is_first_slave(bond, pos) (pos == bond_first_slave(bond)) argument
73 #define bond_is_last_slave(bond, pos) (pos == bond_last_slave(bond)) argument
77 * @bond: the bond holding this list
83 #define bond_for_each_slave(bond, pos, iter) \ argument
84 netdev_for_each_lower_private((bond)->dev, pos, iter)
87 #define bond_for_each_slave_rcu(bond, pos, iter) \ argument
88 netdev_for_each_lower_private_rcu((bond)->dev, pos, iter)
159 struct bonding *bond; /* our master */ member
283 * Returns NULL if the net_device does not belong to any of the bond's slaves
285 * Caller must hold bond lock for read
287 static inline struct slave *bond_get_slave_by_dev(struct bonding *bond, in bond_get_slave_by_dev() argument
290 return netdev_lower_dev_get_private(bond->dev, slave_dev); in bond_get_slave_by_dev()
295 return slave->bond; in bond_get_bond_by_slave()
298 static inline bool bond_should_override_tx_queue(struct bonding *bond) in bond_should_override_tx_queue() argument
300 return BOND_MODE(bond) == BOND_MODE_ACTIVEBACKUP || in bond_should_override_tx_queue()
301 BOND_MODE(bond) == BOND_MODE_ROUNDROBIN; in bond_should_override_tx_queue()
304 static inline bool bond_is_lb(const struct bonding *bond) in bond_is_lb() argument
306 return BOND_MODE(bond) == BOND_MODE_TLB || in bond_is_lb()
307 BOND_MODE(bond) == BOND_MODE_ALB; in bond_is_lb()
310 static inline bool bond_needs_speed_duplex(const struct bonding *bond) in bond_needs_speed_duplex() argument
312 return BOND_MODE(bond) == BOND_MODE_8023AD || bond_is_lb(bond); in bond_needs_speed_duplex()
315 static inline bool bond_is_nondyn_tlb(const struct bonding *bond) in bond_is_nondyn_tlb() argument
317 return (bond_is_lb(bond) && bond->params.tlb_dynamic_lb == 0); in bond_is_nondyn_tlb()
320 static inline bool bond_mode_can_use_xmit_hash(const struct bonding *bond) in bond_mode_can_use_xmit_hash() argument
322 return (BOND_MODE(bond) == BOND_MODE_8023AD || in bond_mode_can_use_xmit_hash()
323 BOND_MODE(bond) == BOND_MODE_XOR || in bond_mode_can_use_xmit_hash()
324 BOND_MODE(bond) == BOND_MODE_TLB || in bond_mode_can_use_xmit_hash()
325 BOND_MODE(bond) == BOND_MODE_ALB); in bond_mode_can_use_xmit_hash()
328 static inline bool bond_mode_uses_xmit_hash(const struct bonding *bond) in bond_mode_uses_xmit_hash() argument
330 return (BOND_MODE(bond) == BOND_MODE_8023AD || in bond_mode_uses_xmit_hash()
331 BOND_MODE(bond) == BOND_MODE_XOR || in bond_mode_uses_xmit_hash()
332 bond_is_nondyn_tlb(bond)); in bond_mode_uses_xmit_hash()
347 static inline bool bond_uses_primary(struct bonding *bond) in bond_uses_primary() argument
349 return bond_mode_uses_primary(BOND_MODE(bond)); in bond_uses_primary()
352 static inline struct net_device *bond_option_active_slave_get_rcu(struct bonding *bond) in bond_option_active_slave_get_rcu() argument
354 struct slave *slave = rcu_dereference_rtnl(bond->curr_active_slave); in bond_option_active_slave_get_rcu()
356 return bond_uses_primary(bond) && slave ? slave->dev : NULL; in bond_option_active_slave_get_rcu()
401 static inline void bond_slave_state_change(struct bonding *bond) in bond_slave_state_change() argument
406 bond_for_each_slave(bond, tmp, iter) { in bond_slave_state_change()
414 static inline void bond_slave_state_notify(struct bonding *bond) in bond_slave_state_notify() argument
419 bond_for_each_slave(bond, tmp, iter) { in bond_slave_state_notify()
491 static inline int slave_do_arp_validate(struct bonding *bond, in slave_do_arp_validate() argument
494 return bond->params.arp_validate & (1 << bond_slave_state(slave)); in slave_do_arp_validate()
497 static inline int slave_do_arp_validate_only(struct bonding *bond) in slave_do_arp_validate_only() argument
499 return bond->params.arp_validate & BOND_ARP_FILTER; in slave_do_arp_validate_only()
516 /* Get the oldest arp which we've received on this slave for bond's
519 static inline unsigned long slave_oldest_target_arp_rx(struct bonding *bond, in slave_oldest_target_arp_rx() argument
525 for (; (i < BOND_MAX_ARP_TARGETS) && bond->params.arp_targets[i]; i++) in slave_oldest_target_arp_rx()
532 static inline unsigned long slave_last_rx(struct bonding *bond, in slave_last_rx() argument
535 if (bond->params.arp_all_targets == BOND_ARP_TARGETS_ALL) in slave_last_rx()
536 return slave_oldest_target_arp_rx(bond, slave); in slave_last_rx()
569 if (!bond_is_lb(slave->bond)) in bond_set_slave_inactive_flags()
571 if (!slave->bond->params.all_slaves_active) in bond_set_slave_inactive_flags()
573 if (BOND_MODE(slave->bond) == BOND_MODE_8023AD) in bond_set_slave_inactive_flags()
588 if (BOND_MODE(slave->bond) == BOND_MODE_8023AD) in bond_set_slave_active_flags()
638 static inline void bond_slave_link_notify(struct bonding *bond) in bond_slave_link_notify() argument
643 bond_for_each_slave(bond, tmp, iter) { in bond_slave_link_notify()
676 int bond_rcv_validate(const struct sk_buff *skb, struct bonding *bond, struct slave *slave);
677 netdev_tx_t bond_dev_queue_xmit(struct bonding *bond, struct sk_buff *skb, struct net_device *slave…
681 void bond_prepare_sysfs_group(struct bonding *bond);
688 u32 bond_xmit_hash(struct bonding *bond, struct sk_buff *skb);
689 int bond_set_carrier(struct bonding *bond);
690 void bond_select_active_slave(struct bonding *bond);
691 void bond_change_active_slave(struct bonding *bond, struct slave *new_active);
694 void bond_debug_register(struct bonding *bond);
695 void bond_debug_unregister(struct bonding *bond);
696 void bond_debug_reregister(struct bonding *bond);
702 struct net_device *bond_option_active_slave_get_rcu(struct bonding *bond);
707 int bond_update_slave_arr(struct bonding *bond, struct slave *skipslave);
708 void bond_slave_arr_work_rearm(struct bonding *bond, unsigned long delay);
709 void bond_work_init_all(struct bonding *bond);
712 void bond_create_proc_entry(struct bonding *bond);
713 void bond_remove_proc_entry(struct bonding *bond);
717 static inline void bond_create_proc_entry(struct bonding *bond) in bond_create_proc_entry() argument
721 static inline void bond_remove_proc_entry(struct bonding *bond) in bond_remove_proc_entry() argument
734 static inline struct slave *bond_slave_has_mac(struct bonding *bond, in bond_slave_has_mac() argument
740 bond_for_each_slave(bond, tmp, iter) in bond_slave_has_mac()
748 static inline bool bond_slave_has_mac_rcu(struct bonding *bond, const u8 *mac) in bond_slave_has_mac_rcu() argument
753 bond_for_each_slave_rcu(bond, tmp, iter) in bond_slave_has_mac_rcu()