Subject: Re: [question] bond_set_slave_inactive_flags

From: Jay Vosburgh <[email-masked]>
Date: Wed, 02 Mar 2011 13:41:29 -0800

Jiri Pirko <[email-masked]> wrote:

>Jay,
>
>Looking at function bond_set_slave_inactive_flags:
>
>static inline void bond_set_slave_inactive_flags(struct slave *slave)
>{
>        struct bonding *bond = netdev_priv(slave->dev->master);
>        if (!bond_is_lb(bond))
>                slave->state = BOND_STATE_BACKUP;
>        if (!bond->params.all_slaves_active)
>                slave->dev->priv_flags |= IFF_SLAVE_INACTIVE;
>        if (slave_do_arp_validate(bond, slave))
>                slave->dev->priv_flags |= IFF_SLAVE_NEEDARP;
>}
>
>Why BOND_STATE_BACKUP is set only for non-lb bonds?
>This was introduced by 8f903c708fcc2b579ebf16542bf6109bad593a1d but
>I do not see why.

	It broke something to have slaves in alb or tlb mode (what
"bond_is_lb" means) set to state == BACKUP; I'm trying to remember what
it was.  I know it would mess up some text messages (calling alb/tlb
slaves "backup", for example), but I think also broke the alb/tlb modes
themselves because SLAVE_IS_OK returns false if state != ACTIVE.

	For alb/tlb, there is an "active" slave, and that's the one that
handles multicast and broadcast.  The others are "inactive," but not
really; they still send and receive regular traffic, but not bcast /
mcast.  The IFF_SLAVE_INACTIVE flag is used to exclude the bcast / mcast
traffic from the "inactive" slaves.

	-J

---
	-Jay Vosburgh, IBM Linux Technology Center, [email-masked]