Lines Matching full:slave
43 /* slave list primitives */
68 * @pos: current slave
142 struct slave { struct
152 u8 backup:1, /* indicates backup slave. Value corresponds with argument
154 inactive:1, /* indicates inactive slave */ argument
176 struct slave *arr[0]; argument
186 * Get rcu_read_lock when reading or RTNL when writing slave list.
190 struct slave __rcu *curr_active_slave;
191 struct slave __rcu *current_arp_slave;
192 struct slave __rcu *primary_slave;
198 struct slave *);
234 ((struct slave *) rcu_dereference(dev->rx_handler_data))
237 ((struct slave *) rtnl_dereference(dev->rx_handler_data))
239 void bond_queue_slave_event(struct slave *slave);
240 void bond_lower_state_changed(struct slave *slave);
252 static inline struct slave *bond_get_slave_by_dev(struct bonding *bond, in bond_get_slave_by_dev()
258 static inline struct bonding *bond_get_bond_by_slave(struct slave *slave) in bond_get_bond_by_slave() argument
260 return slave->bond; in bond_get_bond_by_slave()
319 struct slave *slave = rcu_dereference(bond->curr_active_slave); in bond_option_active_slave_get_rcu() local
321 return bond_uses_primary(bond) && slave ? slave->dev : NULL; in bond_option_active_slave_get_rcu()
324 static inline bool bond_slave_is_up(struct slave *slave) in bond_slave_is_up() argument
326 return netif_running(slave->dev) && netif_carrier_ok(slave->dev); in bond_slave_is_up()
329 static inline void bond_set_active_slave(struct slave *slave) in bond_set_active_slave() argument
331 if (slave->backup) { in bond_set_active_slave()
332 slave->backup = 0; in bond_set_active_slave()
333 bond_queue_slave_event(slave); in bond_set_active_slave()
334 bond_lower_state_changed(slave); in bond_set_active_slave()
338 static inline void bond_set_backup_slave(struct slave *slave) in bond_set_backup_slave() argument
340 if (!slave->backup) { in bond_set_backup_slave()
341 slave->backup = 1; in bond_set_backup_slave()
342 bond_queue_slave_event(slave); in bond_set_backup_slave()
343 bond_lower_state_changed(slave); in bond_set_backup_slave()
347 static inline void bond_set_slave_state(struct slave *slave, in bond_set_slave_state() argument
350 if (slave->backup == slave_state) in bond_set_slave_state()
353 slave->backup = slave_state; in bond_set_slave_state()
355 bond_lower_state_changed(slave); in bond_set_slave_state()
356 bond_queue_slave_event(slave); in bond_set_slave_state()
357 slave->should_notify = 0; in bond_set_slave_state()
359 if (slave->should_notify) in bond_set_slave_state()
360 slave->should_notify = 0; in bond_set_slave_state()
362 slave->should_notify = 1; in bond_set_slave_state()
369 struct slave *tmp; in bond_slave_state_change()
382 struct slave *tmp; in bond_slave_state_notify()
392 static inline int bond_slave_state(struct slave *slave) in bond_slave_state() argument
394 return slave->backup; in bond_slave_state()
397 static inline bool bond_is_active_slave(struct slave *slave) in bond_is_active_slave() argument
399 return !bond_slave_state(slave); in bond_is_active_slave()
402 static inline bool bond_slave_can_tx(struct slave *slave) in bond_slave_can_tx() argument
404 return bond_slave_is_up(slave) && slave->link == BOND_LINK_UP && in bond_slave_can_tx()
405 bond_is_active_slave(slave); in bond_slave_can_tx()
410 struct slave *slave; in bond_is_active_slave_dev() local
414 slave = bond_slave_get_rcu(slave_dev); in bond_is_active_slave_dev()
415 active = bond_is_active_slave(slave); in bond_is_active_slave_dev()
457 struct slave *slave) in slave_do_arp_validate() argument
459 return bond->params.arp_validate & (1 << bond_slave_state(slave)); in slave_do_arp_validate()
472 /* Get the oldest arp which we've received on this slave for bond's
476 struct slave *slave) in slave_oldest_target_arp_rx() argument
479 unsigned long ret = slave->target_last_arp_rx[0]; in slave_oldest_target_arp_rx()
482 if (time_before(slave->target_last_arp_rx[i], ret)) in slave_oldest_target_arp_rx()
483 ret = slave->target_last_arp_rx[i]; in slave_oldest_target_arp_rx()
489 struct slave *slave) in slave_last_rx() argument
492 return slave_oldest_target_arp_rx(bond, slave); in slave_last_rx()
494 return slave->last_rx; in slave_last_rx()
498 static inline void bond_netpoll_send_skb(const struct slave *slave, in bond_netpoll_send_skb() argument
501 struct netpoll *np = slave->np; in bond_netpoll_send_skb()
507 static inline void bond_netpoll_send_skb(const struct slave *slave, in bond_netpoll_send_skb() argument
513 static inline void bond_set_slave_inactive_flags(struct slave *slave, in bond_set_slave_inactive_flags() argument
516 if (!bond_is_lb(slave->bond)) in bond_set_slave_inactive_flags()
517 bond_set_slave_state(slave, BOND_STATE_BACKUP, notify); in bond_set_slave_inactive_flags()
518 if (!slave->bond->params.all_slaves_active) in bond_set_slave_inactive_flags()
519 slave->inactive = 1; in bond_set_slave_inactive_flags()
522 static inline void bond_set_slave_active_flags(struct slave *slave, in bond_set_slave_active_flags() argument
525 bond_set_slave_state(slave, BOND_STATE_ACTIVE, notify); in bond_set_slave_active_flags()
526 slave->inactive = 0; in bond_set_slave_active_flags()
529 static inline bool bond_is_slave_inactive(struct slave *slave) in bond_is_slave_inactive() argument
531 return slave->inactive; in bond_is_slave_inactive()
534 static inline void bond_propose_link_state(struct slave *slave, int state) in bond_propose_link_state() argument
536 slave->link_new_state = state; in bond_propose_link_state()
539 static inline void bond_commit_link_state(struct slave *slave, bool notify) in bond_commit_link_state() argument
541 if (slave->link_new_state == BOND_LINK_NOCHANGE) in bond_commit_link_state()
544 slave->link = slave->link_new_state; in bond_commit_link_state()
546 bond_queue_slave_event(slave); in bond_commit_link_state()
547 bond_lower_state_changed(slave); in bond_commit_link_state()
548 slave->should_notify_link = 0; in bond_commit_link_state()
550 if (slave->should_notify_link) in bond_commit_link_state()
551 slave->should_notify_link = 0; in bond_commit_link_state()
553 slave->should_notify_link = 1; in bond_commit_link_state()
557 static inline void bond_set_slave_link_state(struct slave *slave, int state, in bond_set_slave_link_state() argument
560 bond_propose_link_state(slave, state); in bond_set_slave_link_state()
561 bond_commit_link_state(slave, notify); in bond_set_slave_link_state()
567 struct slave *tmp; in bond_slave_link_notify()
602 int bond_arp_rcv(const struct sk_buff *skb, struct bonding *bond, struct slave *slave);
608 int bond_sysfs_slave_add(struct slave *slave);
609 void bond_sysfs_slave_del(struct slave *slave);
616 void bond_change_active_slave(struct bonding *bond, struct slave *new_active);
632 int bond_update_slave_arr(struct bonding *bond, struct slave *skipslave);
659 static inline struct slave *bond_slave_has_mac(struct bonding *bond, in bond_slave_has_mac()
663 struct slave *tmp; in bond_slave_has_mac()
673 static inline struct slave *bond_slave_has_mac_rcu(struct bonding *bond, in bond_slave_has_mac_rcu()
677 struct slave *tmp; in bond_slave_has_mac_rcu()
690 struct slave *tmp; in bond_slave_has_mac_rx()