Subject: Re: [PATCH net-next] Bonding: add per port priority support

From: Jay Vosburgh <[email-masked]>
Date: Tue, 12 Apr 2022 08:40:11 -0700

Hangbin Liu <[email-masked]> wrote:

>On Mon, Apr 11, 2022 at 09:55:45PM -0700, Jay Vosburgh wrote:
>> Hangbin Liu <[email-masked]> wrote:
>> 
>> >Add per port priority support for bonding. A higher number means higher
>> >priority. The primary slave still has the highest priority. This option
>> >also follows the primary_reselect rules.
>> 
>> 	The above description (and the Subject) should mention that this
>> apparently refers to priority in interface selection during failover
>> events.
>
>OK, will update it. How about:
>
>Bonding: add per port priority for current slave re-selection during failover

	That would be better, but something like "add per-port priority
for failover re-selection" would be a bit shorter.

>Add per port priority support for bonding current re-selection during failover.
>A higher number means higher priority in selection. The primary slave still
>has the highest priority. This option also follows the primary_reselect rules.

	This seems reasonable.

>> >@@ -117,6 +121,7 @@ static const struct nla_policy bond_policy[IFLA_BOND_MAX + 1] = {
>> > 
>> > static const struct nla_policy bond_slave_policy[IFLA_BOND_SLAVE_MAX + 1] = {
>> > 	[IFLA_BOND_SLAVE_QUEUE_ID]	= { .type = NLA_U16 },
>> >+	[IFLA_BOND_SLAVE_PRIO]		= { .type = NLA_S32 },
>> 
>> 	Why used signed instead of unsigned?
>> 
>> 	Regardless, the valid range for the prio value should be
>> documented.
>
>I did this in purpose as team also use singed number. User could use a
>negative number for a specific link while other links keep using default 0.

	Fair enough; I had been comparing to the LACP port priority and
route metric, both of which are unsigned.

>BTW, how to document the valid ranger for a int number, -2^31 ~ 2^31-1 or
>INT_MIN ~ INT_MAX.

	The documentation can simply state that the value is a signed 32
bit integer (rather than giving the specifics).

	-J

---
	-Jay Vosburgh, [email-masked]