[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Yql2XVNxJ0VyLoCK@Laptop-X1>
Date: Wed, 15 Jun 2022 14:04:13 +0800
From: Hangbin Liu <liuhangbin@...il.com>
To: Stephen Hemminger <stephen@...workplumber.org>
Cc: netdev@...r.kernel.org, Jay Vosburgh <j.vosburgh@...il.com>,
Veaceslav Falico <vfalico@...il.com>,
Andy Gospodarek <andy@...yhouse.net>,
"David S . Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Jonathan Toppins <jtoppins@...hat.com>,
Paolo Abeni <pabeni@...hat.com>,
David Ahern <dsahern@...il.com>
Subject: Re: [PATCHv2 net-next] Bonding: add per-port priority for failover
re-selection
On Tue, Jun 14, 2022 at 08:52:58PM -0700, Stephen Hemminger wrote:
> On Wed, 15 Jun 2022 11:29:34 +0800
> Hangbin Liu <liuhangbin@...il.com> wrote:
>
> > diff --git a/drivers/net/bonding/bond_netlink.c b/drivers/net/bonding/bond_netlink.c
> > index 5a6f44455b95..41b3244747fa 100644
> > --- a/drivers/net/bonding/bond_netlink.c
> > +++ b/drivers/net/bonding/bond_netlink.c
> > @@ -27,6 +27,7 @@ static size_t bond_get_slave_size(const struct net_device *bond_dev,
> > nla_total_size(sizeof(u16)) + /* IFLA_BOND_SLAVE_AD_AGGREGATOR_ID */
> > nla_total_size(sizeof(u8)) + /* IFLA_BOND_SLAVE_AD_ACTOR_OPER_PORT_STATE */
> > nla_total_size(sizeof(u16)) + /* IFLA_BOND_SLAVE_AD_PARTNER_OPER_PORT_STATE */
> > + nla_total_size(sizeof(s32)) + /* IFLA_BOND_SLAVE_PRIO */
> > 0;
> > }
>
> Why the choice to make it signed? It would be clearer as unsigned value.
Let's say you have a bond with 10 slaves. You want to make 1 slave with
lowest priority. With singed value, you can just set it to -10 while other
slaves keep using the default value 0.
> Also, using full 32 bits seems like overkill.
Yes, it seems too much for just priority. This is to compatible with team
prio option[1].
[1] https://github.com/jpirko/libteam/blob/master/man/teamd.conf.5#L138
Thanks
Hangbin
Powered by blists - more mailing lists