Lines Matching refs:slave

43 	netdev_info(bond_dev, "(slave %s): " fmt, (slave_dev)->name, ##__VA_ARGS__)
45 netdev_warn(bond_dev, "(slave %s): " fmt, (slave_dev)->name, ##__VA_ARGS__)
47 netdev_dbg(bond_dev, "(slave %s): " fmt, (slave_dev)->name, ##__VA_ARGS__)
49 netdev_err(bond_dev, "(slave %s): " fmt, (slave_dev)->name, ##__VA_ARGS__)
53 /* slave list primitives */
78 * @pos: current slave
156 struct slave {
167 u8 backup:1, /* indicates backup slave. Value corresponds with
169 inactive:1, /* indicates inactive slave */
189 static inline struct slave *to_slave(struct kobject *kobj)
191 return container_of(kobj, struct slave, kobj);
197 struct slave *arr[];
212 * Get rcu_read_lock when reading or RTNL when writing slave list.
216 struct slave __rcu *curr_active_slave;
217 struct slave __rcu *current_arp_slave;
218 struct slave __rcu *primary_slave;
225 struct slave *);
267 ((struct slave *) rcu_dereference(dev->rx_handler_data))
270 ((struct slave *) rtnl_dereference(dev->rx_handler_data))
272 void bond_queue_slave_event(struct slave *slave);
273 void bond_lower_state_changed(struct slave *slave);
285 static inline struct slave *bond_get_slave_by_dev(struct bonding *bond,
291 static inline struct bonding *bond_get_bond_by_slave(struct slave *slave)
293 return slave->bond;
352 struct slave *slave = rcu_dereference_rtnl(bond->curr_active_slave);
354 return bond_uses_primary(bond) && slave ? slave->dev : NULL;
357 static inline bool bond_slave_is_up(struct slave *slave)
359 return netif_running(slave->dev) && netif_carrier_ok(slave->dev);
362 static inline void bond_set_active_slave(struct slave *slave)
364 if (slave->backup) {
365 slave->backup = 0;
366 bond_queue_slave_event(slave);
367 bond_lower_state_changed(slave);
371 static inline void bond_set_backup_slave(struct slave *slave)
373 if (!slave->backup) {
374 slave->backup = 1;
375 bond_queue_slave_event(slave);
376 bond_lower_state_changed(slave);
380 static inline void bond_set_slave_state(struct slave *slave,
383 if (slave->backup == slave_state)
386 slave->backup = slave_state;
388 bond_lower_state_changed(slave);
389 bond_queue_slave_event(slave);
390 slave->should_notify = 0;
392 if (slave->should_notify)
393 slave->should_notify = 0;
395 slave->should_notify = 1;
402 struct slave *tmp;
415 struct slave *tmp;
425 static inline int bond_slave_state(struct slave *slave)
427 return slave->backup;
430 static inline bool bond_is_active_slave(struct slave *slave)
432 return !bond_slave_state(slave);
435 static inline bool bond_slave_can_tx(struct slave *slave)
437 return bond_slave_is_up(slave) && slave->link == BOND_LINK_UP &&
438 bond_is_active_slave(slave);
443 struct slave *slave;
447 slave = bond_slave_get_rcu(slave_dev);
448 active = bond_is_active_slave(slave);
490 struct slave *slave)
492 return bond->params.arp_validate & (1 << bond_slave_state(slave));
514 /* Get the oldest arp which we've received on this slave for bond's
518 struct slave *slave)
521 unsigned long ret = slave->target_last_arp_rx[0];
524 if (time_before(slave->target_last_arp_rx[i], ret))
525 ret = slave->target_last_arp_rx[i];
531 struct slave *slave)
534 return slave_oldest_target_arp_rx(bond, slave);
536 return slave->last_rx;
539 static inline void slave_update_last_tx(struct slave *slave)
541 WRITE_ONCE(slave->last_tx, jiffies);
544 static inline unsigned long slave_last_tx(struct slave *slave)
546 return READ_ONCE(slave->last_tx);
550 static inline netdev_tx_t bond_netpoll_send_skb(const struct slave *slave,
553 return netpoll_send_skb(slave->np, skb);
556 static inline netdev_tx_t bond_netpoll_send_skb(const struct slave *slave,
564 static inline void bond_set_slave_inactive_flags(struct slave *slave,
567 if (!bond_is_lb(slave->bond))
568 bond_set_slave_state(slave, BOND_STATE_BACKUP, notify);
569 if (!slave->bond->params.all_slaves_active)
570 slave->inactive = 1;
573 static inline void bond_set_slave_active_flags(struct slave *slave,
576 bond_set_slave_state(slave, BOND_STATE_ACTIVE, notify);
577 slave->inactive = 0;
580 static inline bool bond_is_slave_inactive(struct slave *slave)
582 return slave->inactive;
585 static inline void bond_propose_link_state(struct slave *slave, int state)
587 slave->link_new_state = state;
590 static inline void bond_commit_link_state(struct slave *slave, bool notify)
592 if (slave->link_new_state == BOND_LINK_NOCHANGE)
595 slave->link = slave->link_new_state;
597 bond_queue_slave_event(slave);
598 bond_lower_state_changed(slave);
599 slave->should_notify_link = 0;
601 if (slave->should_notify_link)
602 slave->should_notify_link = 0;
604 slave->should_notify_link = 1;
608 static inline void bond_set_slave_link_state(struct slave *slave, int state,
611 bond_propose_link_state(slave, state);
612 bond_commit_link_state(slave, notify);
618 struct slave *tmp;
653 int bond_rcv_validate(const struct sk_buff *skb, struct bonding *bond, struct slave *slave);
659 int bond_sysfs_slave_add(struct slave *slave);
660 void bond_sysfs_slave_del(struct slave *slave);
668 void bond_change_active_slave(struct bonding *bond, struct slave *new_active);
684 int bond_update_slave_arr(struct bonding *bond, struct slave *skipslave);
711 static inline struct slave *bond_slave_has_mac(struct bonding *bond,
715 struct slave *tmp;
728 struct slave *tmp;