Lines Matching refs: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 {
165 u8 backup:1, /* indicates backup slave. Value corresponds with
167 inactive:1, /* indicates inactive slave */
186 static inline struct slave *to_slave(struct kobject *kobj)
188 return container_of(kobj, struct slave, kobj);
194 struct slave *arr[];
209 * Get rcu_read_lock when reading or RTNL when writing slave list.
213 struct slave __rcu *curr_active_slave;
214 struct slave __rcu *current_arp_slave;
215 struct slave __rcu *primary_slave;
222 struct slave *);
263 ((struct slave *) rcu_dereference(dev->rx_handler_data))
266 ((struct slave *) rtnl_dereference(dev->rx_handler_data))
268 void bond_queue_slave_event(struct slave *slave);
269 void bond_lower_state_changed(struct slave *slave);
281 static inline struct slave *bond_get_slave_by_dev(struct bonding *bond,
287 static inline struct bonding *bond_get_bond_by_slave(struct slave *slave)
289 return slave->bond;
348 struct slave *slave = rcu_dereference(bond->curr_active_slave);
350 return bond_uses_primary(bond) && slave ? slave->dev : NULL;
353 static inline bool bond_slave_is_up(struct slave *slave)
355 return netif_running(slave->dev) && netif_carrier_ok(slave->dev);
358 static inline void bond_set_active_slave(struct slave *slave)
360 if (slave->backup) {
361 slave->backup = 0;
362 bond_queue_slave_event(slave);
363 bond_lower_state_changed(slave);
367 static inline void bond_set_backup_slave(struct slave *slave)
369 if (!slave->backup) {
370 slave->backup = 1;
371 bond_queue_slave_event(slave);
372 bond_lower_state_changed(slave);
376 static inline void bond_set_slave_state(struct slave *slave,
379 if (slave->backup == slave_state)
382 slave->backup = slave_state;
384 bond_lower_state_changed(slave);
385 bond_queue_slave_event(slave);
386 slave->should_notify = 0;
388 if (slave->should_notify)
389 slave->should_notify = 0;
391 slave->should_notify = 1;
398 struct slave *tmp;
411 struct slave *tmp;
421 static inline int bond_slave_state(struct slave *slave)
423 return slave->backup;
426 static inline bool bond_is_active_slave(struct slave *slave)
428 return !bond_slave_state(slave);
431 static inline bool bond_slave_can_tx(struct slave *slave)
433 return bond_slave_is_up(slave) && slave->link == BOND_LINK_UP &&
434 bond_is_active_slave(slave);
439 struct slave *slave;
443 slave = bond_slave_get_rcu(slave_dev);
444 active = bond_is_active_slave(slave);
486 struct slave *slave)
488 return bond->params.arp_validate & (1 << bond_slave_state(slave));
501 /* Get the oldest arp which we've received on this slave for bond's
505 struct slave *slave)
508 unsigned long ret = slave->target_last_arp_rx[0];
511 if (time_before(slave->target_last_arp_rx[i], ret))
512 ret = slave->target_last_arp_rx[i];
518 struct slave *slave)
521 return slave_oldest_target_arp_rx(bond, slave);
523 return slave->last_rx;
527 static inline netdev_tx_t bond_netpoll_send_skb(const struct slave *slave,
530 return netpoll_send_skb(slave->np, skb);
533 static inline netdev_tx_t bond_netpoll_send_skb(const struct slave *slave,
541 static inline void bond_set_slave_inactive_flags(struct slave *slave,
544 if (!bond_is_lb(slave->bond))
545 bond_set_slave_state(slave, BOND_STATE_BACKUP, notify);
546 if (!slave->bond->params.all_slaves_active)
547 slave->inactive = 1;
550 static inline void bond_set_slave_active_flags(struct slave *slave,
553 bond_set_slave_state(slave, BOND_STATE_ACTIVE, notify);
554 slave->inactive = 0;
557 static inline bool bond_is_slave_inactive(struct slave *slave)
559 return slave->inactive;
562 static inline void bond_propose_link_state(struct slave *slave, int state)
564 slave->link_new_state = state;
567 static inline void bond_commit_link_state(struct slave *slave, bool notify)
569 if (slave->link_new_state == BOND_LINK_NOCHANGE)
572 slave->link = slave->link_new_state;
574 bond_queue_slave_event(slave);
575 bond_lower_state_changed(slave);
576 slave->should_notify_link = 0;
578 if (slave->should_notify_link)
579 slave->should_notify_link = 0;
581 slave->should_notify_link = 1;
585 static inline void bond_set_slave_link_state(struct slave *slave, int state,
588 bond_propose_link_state(slave, state);
589 bond_commit_link_state(slave, notify);
595 struct slave *tmp;
630 int bond_arp_rcv(const struct sk_buff *skb, struct bonding *bond, struct slave *slave);
636 int bond_sysfs_slave_add(struct slave *slave);
637 void bond_sysfs_slave_del(struct slave *slave);
644 void bond_change_active_slave(struct bonding *bond, struct slave *new_active);
660 int bond_update_slave_arr(struct bonding *bond, struct slave *skipslave);
687 static inline struct slave *bond_slave_has_mac(struct bonding *bond,
691 struct slave *tmp;
704 struct slave *tmp;