Lines Matching refs:slave
152 struct slave { struct
184 struct slave *arr[0]; argument
198 struct slave __rcu *curr_active_slave;
199 struct slave __rcu *current_arp_slave;
200 struct slave __rcu *primary_slave;
205 struct slave *);
240 ((struct slave *) rcu_dereference(dev->rx_handler_data))
243 ((struct slave *) rtnl_dereference(dev->rx_handler_data))
245 void bond_queue_slave_event(struct slave *slave);
257 static inline struct slave *bond_get_slave_by_dev(struct bonding *bond, in bond_get_slave_by_dev()
263 static inline struct bonding *bond_get_bond_by_slave(struct slave *slave) in bond_get_bond_by_slave() argument
265 return slave->bond; in bond_get_bond_by_slave()
310 static inline bool bond_slave_is_up(struct slave *slave) in bond_slave_is_up() argument
312 return netif_running(slave->dev) && netif_carrier_ok(slave->dev); in bond_slave_is_up()
315 static inline void bond_set_active_slave(struct slave *slave) in bond_set_active_slave() argument
317 if (slave->backup) { in bond_set_active_slave()
318 slave->backup = 0; in bond_set_active_slave()
319 bond_queue_slave_event(slave); in bond_set_active_slave()
320 rtmsg_ifinfo(RTM_NEWLINK, slave->dev, 0, GFP_ATOMIC); in bond_set_active_slave()
324 static inline void bond_set_backup_slave(struct slave *slave) in bond_set_backup_slave() argument
326 if (!slave->backup) { in bond_set_backup_slave()
327 slave->backup = 1; in bond_set_backup_slave()
328 bond_queue_slave_event(slave); in bond_set_backup_slave()
329 rtmsg_ifinfo(RTM_NEWLINK, slave->dev, 0, GFP_ATOMIC); in bond_set_backup_slave()
333 static inline void bond_set_slave_state(struct slave *slave, in bond_set_slave_state() argument
336 if (slave->backup == slave_state) in bond_set_slave_state()
339 slave->backup = slave_state; in bond_set_slave_state()
341 rtmsg_ifinfo(RTM_NEWLINK, slave->dev, 0, GFP_ATOMIC); in bond_set_slave_state()
342 bond_queue_slave_event(slave); in bond_set_slave_state()
343 slave->should_notify = 0; in bond_set_slave_state()
345 if (slave->should_notify) in bond_set_slave_state()
346 slave->should_notify = 0; in bond_set_slave_state()
348 slave->should_notify = 1; in bond_set_slave_state()
355 struct slave *tmp; in bond_slave_state_change()
368 struct slave *tmp; in bond_slave_state_notify()
378 static inline int bond_slave_state(struct slave *slave) in bond_slave_state() argument
380 return slave->backup; in bond_slave_state()
383 static inline bool bond_is_active_slave(struct slave *slave) in bond_is_active_slave() argument
385 return !bond_slave_state(slave); in bond_is_active_slave()
388 static inline bool bond_slave_can_tx(struct slave *slave) in bond_slave_can_tx() argument
390 return bond_slave_is_up(slave) && slave->link == BOND_LINK_UP && in bond_slave_can_tx()
391 bond_is_active_slave(slave); in bond_slave_can_tx()
420 struct slave *slave) in slave_do_arp_validate() argument
422 return bond->params.arp_validate & (1 << bond_slave_state(slave)); in slave_do_arp_validate()
439 struct slave *slave) in slave_oldest_target_arp_rx() argument
442 unsigned long ret = slave->target_last_arp_rx[0]; in slave_oldest_target_arp_rx()
445 if (time_before(slave->target_last_arp_rx[i], ret)) in slave_oldest_target_arp_rx()
446 ret = slave->target_last_arp_rx[i]; in slave_oldest_target_arp_rx()
452 struct slave *slave) in slave_last_rx() argument
455 return slave_oldest_target_arp_rx(bond, slave); in slave_last_rx()
457 return slave->last_rx; in slave_last_rx()
461 static inline void bond_netpoll_send_skb(const struct slave *slave, in bond_netpoll_send_skb() argument
464 struct netpoll *np = slave->np; in bond_netpoll_send_skb()
470 static inline void bond_netpoll_send_skb(const struct slave *slave, in bond_netpoll_send_skb() argument
476 static inline void bond_set_slave_inactive_flags(struct slave *slave, in bond_set_slave_inactive_flags() argument
479 if (!bond_is_lb(slave->bond)) in bond_set_slave_inactive_flags()
480 bond_set_slave_state(slave, BOND_STATE_BACKUP, notify); in bond_set_slave_inactive_flags()
481 if (!slave->bond->params.all_slaves_active) in bond_set_slave_inactive_flags()
482 slave->inactive = 1; in bond_set_slave_inactive_flags()
485 static inline void bond_set_slave_active_flags(struct slave *slave, in bond_set_slave_active_flags() argument
488 bond_set_slave_state(slave, BOND_STATE_ACTIVE, notify); in bond_set_slave_active_flags()
489 slave->inactive = 0; in bond_set_slave_active_flags()
492 static inline bool bond_is_slave_inactive(struct slave *slave) in bond_is_slave_inactive() argument
494 return slave->inactive; in bond_is_slave_inactive()
497 static inline void bond_set_slave_link_state(struct slave *slave, int state) in bond_set_slave_link_state() argument
499 slave->link = state; in bond_set_slave_link_state()
500 bond_queue_slave_event(slave); in bond_set_slave_link_state()
527 int bond_arp_rcv(const struct sk_buff *skb, struct bonding *bond, struct slave *slave);
533 int bond_sysfs_slave_add(struct slave *slave);
534 void bond_sysfs_slave_del(struct slave *slave);
540 void bond_change_active_slave(struct bonding *bond, struct slave *new_active);
556 int bond_update_slave_arr(struct bonding *bond, struct slave *skipslave);
582 static inline struct slave *bond_slave_has_mac(struct bonding *bond, in bond_slave_has_mac()
586 struct slave *tmp; in bond_slave_has_mac()
596 static inline struct slave *bond_slave_has_mac_rcu(struct bonding *bond, in bond_slave_has_mac_rcu()
600 struct slave *tmp; in bond_slave_has_mac_rcu()
613 struct slave *tmp; in bond_slave_has_mac_rx()