Subject: Re: [Bonding-devel] [PATCH net-next-2.6] bonding: introduce primary_lazy option

From: Jay Vosburgh <[email-masked]>
Date: Mon, 24 Aug 2009 10:35:17 -0700

Jiri Pirko <[email-masked]> wrote:

>Mon, Aug 24, 2009 at 05:07:18PM CEST, [email-masked] wrote:
>> Jiri Pirko wrote:
>>> Thu, Aug 20, 2009 at 02:40:07PM CEST, [email-masked] wrote:
>> [--cut--]
>>>> I suggest that instead of having a per bond "primary_lazy" option, we
>>>> define a per slave option, describing whether this particular slave is
>>>> "sticky when active" or not.
>>>>
>>>> The above setup would become :
>>>>
>>>> echo 1 > /sys/class/net/eth0/bonding/sticky_active
>>>> echo 1 > /sys/class/net/eth1/bonding/sticky_active
>>>> echo 0 > /sys/class/net/eth2/bonding/sticky_active
>>>> echo eth0 > /sys/class/net/bond0/bonding/primary
>>>>
>>>> Or may be better, keeping the "weight" idea in mind, a per slave option
>>>> "active_weight" that gives the weight of the slave, *when active*.
>>>>
>>>> The effective weight of a slave would become :
>>>>
>>>> effective_slave =
>>>> (is_active ? user_supplied_active_weight ? user_supplied_weight) *
>>>> natural_weight
>>>>
>>>> # Prefer eth0, then one of eth1 or eth2, then eth3.
>>>> echo 1000 > /sys/class/net/eth0/bonding/weight
>>>> echo 999 > /sys/class/net/eth1/bonding/weight
>>>> echo 999 > /sys/class/net/eth2/bonding/weight
>>>> echo 10 > /sys/class/net/eth3/bonding/weight
>>>>
>>>> # Do not switch back to primary eth0 if eth1 or eth2 is active.
>>>> echo 1000 > /sys/class/net/eth1/bonding/active_weight
>>>> echo 1000 > /sys/class/net/eth2/bonding/active_weight
>>>>
>>>> Every time one changes the user_supplied_weight, then
>>>> user_supplied_active_weight must be reset to the same value. This 
>>>> way,  if no special setup is done on active_weight, then the current 
>>>> normal
>>>> behavior is achieved.
>>>
>>> I must say I like this approach. But it would be not trivial to implement this.
>>> Therefore I would stick with your propose of extending primary lazy to 3 values
>>> until the weight option is implemented.
>>
>> It sounds good for me. Later, if I eventually implement the weight 
>> option, it shouldn't be that hard to convert internally the primary_lazy 
>> setup to active_weight, the same way we plan to convert internally 
>> primary setup to weight setup.
>>
>> primary and primary_lazy are convenient for simple - two slaves only -  
>> configurations. weight and active_weight are for more advanced 
>> configurations. Keeping both configuration interface does sound user 
>> friendly.
>
>Ok, I agree.
>
>>
>>> I'm going to implement your propose below.
>>
>> By the way, even if I'm not a native English speaker, I think that 
>> primary_lazy option should be named lazy_primary instead.
>
>Well I've intentionally put "primary" as a first word to amplify it's linked
>with primary option... But...

	I'm still unclear as to why it's better to add another special
case option to bonding instead of changing this in user space, other
than it'd be a change to user space (initscripts / sysconfig).

	The way I see it, this patch is adding a mechanism that says,
effectively, "make slave X the active slave, but do it only once."
There is already a way to do that in bonding (sysfs, as above, or
ifenslave -c); I am reluctant to add another without good reason.

	I'm not necessarily against the "weight" business in general.
For the purposes of this discussion, however, it's a big complex
solution to a pretty simple problem, and the "weight" system still has
to have special sauce added it to to handle this special case.

	Last, presuming for the moment that this goes forward as an
option to bonding, I think this should be named something along the
lines of "make_active" (or perhaps "make_active_once", but that's a bit
long).  The option has the effect of making the specified slave the
active slave one time, then the option setting is cleared.

	-J

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