From: Hangbin Liu <liuhangbin@gmail.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: netdev@vger.kernel.org, Jay Vosburgh <j.vosburgh@gmail.com>,
Veaceslav Falico <vfalico@gmail.com>,
Andy Gospodarek <andy@greyhouse.net>,
"David S . Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
Jonathan Toppins <jtoppins@redhat.com>,
Paolo Abeni <pabeni@redhat.com>, David Ahern <dsahern@gmail.com>
Subject: Re: [PATCHv2 net-next] Bonding: add per-port priority for failover re-selection
Date: Wed, 15 Jun 2022 14:04:13 +0800 [thread overview]
Message-ID: <Yql2XVNxJ0VyLoCK@Laptop-X1> (raw)
In-Reply-To: <20220614205258.500bade8@hermes.local>
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@gmail.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
next prev parent reply other threads:[~2022-06-15 6:04 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-15 3:29 [PATCHv2 net-next] Bonding: add per-port priority for failover re-selection Hangbin Liu
2022-06-15 3:30 ` [PATCHv2 iproute2-next] iplink: bond_slave: add per port prio support Hangbin Liu
2022-06-15 3:52 ` [PATCHv2 net-next] Bonding: add per-port priority for failover re-selection Stephen Hemminger
2022-06-15 6:04 ` Hangbin Liu [this message]
2022-06-15 17:44 ` Jonathan Toppins
2022-06-16 2:58 ` Hangbin Liu
2022-06-17 8:04 ` Hangbin Liu
2022-06-17 18:12 ` Jonathan Toppins
2022-06-16 14:48 ` kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Yql2XVNxJ0VyLoCK@Laptop-X1 \
--to=liuhangbin@gmail.com \
--cc=andy@greyhouse.net \
--cc=davem@davemloft.net \
--cc=dsahern@gmail.com \
--cc=j.vosburgh@gmail.com \
--cc=jtoppins@redhat.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=stephen@networkplumber.org \
--cc=vfalico@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox