Lines Matching full:slave

42 	netdev_info(bond_dev, "(slave %s): " fmt, (slave_dev)->name, ##__VA_ARGS__)
44 netdev_warn(bond_dev, "(slave %s): " fmt, (slave_dev)->name, ##__VA_ARGS__)
46 netdev_dbg(bond_dev, "(slave %s): " fmt, (slave_dev)->name, ##__VA_ARGS__)
48 netdev_err(bond_dev, "(slave %s): " fmt, (slave_dev)->name, ##__VA_ARGS__)
52 /* slave list primitives */
77 * @pos: current slave
155 struct slave { struct
165 u8 backup:1, /* indicates backup slave. Value corresponds with argument
167 inactive:1, /* indicates inactive slave */ argument
186 static inline struct slave *to_slave(struct kobject *kobj) in to_slave() argument
188 return container_of(kobj, struct slave, kobj); in to_slave()
194 struct slave *arr[];
204 * Get rcu_read_lock when reading or RTNL when writing slave list.
208 struct slave __rcu *curr_active_slave;
209 struct slave __rcu *current_arp_slave;
210 struct slave __rcu *primary_slave;
216 struct slave *);
255 ((struct slave *) rcu_dereference(dev->rx_handler_data))
258 ((struct slave *) rtnl_dereference(dev->rx_handler_data))
260 void bond_queue_slave_event(struct slave *slave);
261 void bond_lower_state_changed(struct slave *slave);
273 static inline struct slave *bond_get_slave_by_dev(struct bonding *bond, in bond_get_slave_by_dev()
279 static inline struct bonding *bond_get_bond_by_slave(struct slave *slave) in bond_get_bond_by_slave() argument
281 return slave->bond; in bond_get_bond_by_slave()
340 struct slave *slave = rcu_dereference(bond->curr_active_slave); in bond_option_active_slave_get_rcu() local
342 return bond_uses_primary(bond) && slave ? slave->dev : NULL; in bond_option_active_slave_get_rcu()
345 static inline bool bond_slave_is_up(struct slave *slave) in bond_slave_is_up() argument
347 return netif_running(slave->dev) && netif_carrier_ok(slave->dev); in bond_slave_is_up()
350 static inline void bond_set_active_slave(struct slave *slave) in bond_set_active_slave() argument
352 if (slave->backup) { in bond_set_active_slave()
353 slave->backup = 0; in bond_set_active_slave()
354 bond_queue_slave_event(slave); in bond_set_active_slave()
355 bond_lower_state_changed(slave); in bond_set_active_slave()
359 static inline void bond_set_backup_slave(struct slave *slave) in bond_set_backup_slave() argument
361 if (!slave->backup) { in bond_set_backup_slave()
362 slave->backup = 1; in bond_set_backup_slave()
363 bond_queue_slave_event(slave); in bond_set_backup_slave()
364 bond_lower_state_changed(slave); in bond_set_backup_slave()
368 static inline void bond_set_slave_state(struct slave *slave, in bond_set_slave_state() argument
371 if (slave->backup == slave_state) in bond_set_slave_state()
374 slave->backup = slave_state; in bond_set_slave_state()
376 bond_lower_state_changed(slave); in bond_set_slave_state()
377 bond_queue_slave_event(slave); in bond_set_slave_state()
378 slave->should_notify = 0; in bond_set_slave_state()
380 if (slave->should_notify) in bond_set_slave_state()
381 slave->should_notify = 0; in bond_set_slave_state()
383 slave->should_notify = 1; in bond_set_slave_state()
390 struct slave *tmp; in bond_slave_state_change()
403 struct slave *tmp; in bond_slave_state_notify()
413 static inline int bond_slave_state(struct slave *slave) in bond_slave_state() argument
415 return slave->backup; in bond_slave_state()
418 static inline bool bond_is_active_slave(struct slave *slave) in bond_is_active_slave() argument
420 return !bond_slave_state(slave); in bond_is_active_slave()
423 static inline bool bond_slave_can_tx(struct slave *slave) in bond_slave_can_tx() argument
425 return bond_slave_is_up(slave) && slave->link == BOND_LINK_UP && in bond_slave_can_tx()
426 bond_is_active_slave(slave); in bond_slave_can_tx()
431 struct slave *slave; in bond_is_active_slave_dev() local
435 slave = bond_slave_get_rcu(slave_dev); in bond_is_active_slave_dev()
436 active = bond_is_active_slave(slave); in bond_is_active_slave_dev()
478 struct slave *slave) in slave_do_arp_validate() argument
480 return bond->params.arp_validate & (1 << bond_slave_state(slave)); in slave_do_arp_validate()
493 /* Get the oldest arp which we've received on this slave for bond's
497 struct slave *slave) in slave_oldest_target_arp_rx() argument
500 unsigned long ret = slave->target_last_arp_rx[0]; in slave_oldest_target_arp_rx()
503 if (time_before(slave->target_last_arp_rx[i], ret)) in slave_oldest_target_arp_rx()
504 ret = slave->target_last_arp_rx[i]; in slave_oldest_target_arp_rx()
510 struct slave *slave) in slave_last_rx() argument
513 return slave_oldest_target_arp_rx(bond, slave); in slave_last_rx()
515 return slave->last_rx; in slave_last_rx()
519 static inline netdev_tx_t bond_netpoll_send_skb(const struct slave *slave, in bond_netpoll_send_skb() argument
522 return netpoll_send_skb(slave->np, skb); in bond_netpoll_send_skb()
525 static inline netdev_tx_t bond_netpoll_send_skb(const struct slave *slave, in bond_netpoll_send_skb() argument
533 static inline void bond_set_slave_inactive_flags(struct slave *slave, in bond_set_slave_inactive_flags() argument
536 if (!bond_is_lb(slave->bond)) in bond_set_slave_inactive_flags()
537 bond_set_slave_state(slave, BOND_STATE_BACKUP, notify); in bond_set_slave_inactive_flags()
538 if (!slave->bond->params.all_slaves_active) in bond_set_slave_inactive_flags()
539 slave->inactive = 1; in bond_set_slave_inactive_flags()
542 static inline void bond_set_slave_active_flags(struct slave *slave, in bond_set_slave_active_flags() argument
545 bond_set_slave_state(slave, BOND_STATE_ACTIVE, notify); in bond_set_slave_active_flags()
546 slave->inactive = 0; in bond_set_slave_active_flags()
549 static inline bool bond_is_slave_inactive(struct slave *slave) in bond_is_slave_inactive() argument
551 return slave->inactive; in bond_is_slave_inactive()
554 static inline void bond_propose_link_state(struct slave *slave, int state) in bond_propose_link_state() argument
556 slave->link_new_state = state; in bond_propose_link_state()
559 static inline void bond_commit_link_state(struct slave *slave, bool notify) in bond_commit_link_state() argument
561 if (slave->link_new_state == BOND_LINK_NOCHANGE) in bond_commit_link_state()
564 slave->link = slave->link_new_state; in bond_commit_link_state()
566 bond_queue_slave_event(slave); in bond_commit_link_state()
567 bond_lower_state_changed(slave); in bond_commit_link_state()
568 slave->should_notify_link = 0; in bond_commit_link_state()
570 if (slave->should_notify_link) in bond_commit_link_state()
571 slave->should_notify_link = 0; in bond_commit_link_state()
573 slave->should_notify_link = 1; in bond_commit_link_state()
577 static inline void bond_set_slave_link_state(struct slave *slave, int state, in bond_set_slave_link_state() argument
580 bond_propose_link_state(slave, state); in bond_set_slave_link_state()
581 bond_commit_link_state(slave, notify); in bond_set_slave_link_state()
587 struct slave *tmp; in bond_slave_link_notify()
622 int bond_arp_rcv(const struct sk_buff *skb, struct bonding *bond, struct slave *slave);
628 int bond_sysfs_slave_add(struct slave *slave);
629 void bond_sysfs_slave_del(struct slave *slave);
636 void bond_change_active_slave(struct bonding *bond, struct slave *new_active);
652 int bond_update_slave_arr(struct bonding *bond, struct slave *skipslave);
679 static inline struct slave *bond_slave_has_mac(struct bonding *bond, in bond_slave_has_mac()
683 struct slave *tmp; in bond_slave_has_mac()
693 static inline struct slave *bond_slave_has_mac_rcu(struct bonding *bond, in bond_slave_has_mac_rcu()
697 struct slave *tmp; in bond_slave_has_mac_rcu()
710 struct slave *tmp; in bond_slave_has_mac_rx()