[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aJ7VBQaaajNeXhsP@fedora>
Date: Fri, 15 Aug 2025 06:34:45 +0000
From: Hangbin Liu <liuhangbin@...il.com>
To: Jonas Gorski <jonas.gorski@...il.com>
Cc: netdev@...r.kernel.org, Jay Vosburgh <jv@...sburgh.net>,
Andrew Lunn <andrew+netdev@...n.ch>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Nikolay Aleksandrov <razor@...ckwall.org>,
Simon Horman <horms@...nel.org>, Shuah Khan <shuah@...nel.org>,
Jonathan Corbet <corbet@....net>, Petr Machata <petrm@...dia.com>,
Amit Cohen <amcohen@...dia.com>,
Vladimir Oltean <vladimir.oltean@....com>,
Stephen Hemminger <stephen@...workplumber.org>,
David Ahern <dsahern@...il.com>, linux-doc@...r.kernel.org,
linux-kselftest@...r.kernel.org
Subject: Re: [PATCHv2 net-next 1/3] bonding: add support for per-port LACP
actor priority
On Thu, Aug 14, 2025 at 01:46:10PM +0200, Jonas Gorski wrote:
> > @@ -2211,6 +2212,7 @@ void bond_3ad_bind_slave(struct slave *slave)
> > port->actor_admin_port_key = bond->params.ad_user_port_key << 6;
> > ad_update_actor_keys(port, false);
> > /* actor system is the bond's system */
> > + SLAVE_AD_INFO(slave)->port_priority = port->actor_port_priority;
>
> I don't know the code flow well, but the assignment direction here is the
> opposite of other values, e.g.
>
> port->actor_port_number = SLAVE_AD_INFO(slave)->id;
>
> so I would have expected this to be
>
> port->actor_port_priority = SLAVE_AD_INFO(slave)->port_priority;
>
> Is this intentional?
The port priority is initialized in ad_initialize_port() a few lines before.
Here is intend to update the port_priority in slave info, so user could get
correct port priority via ip link, other wise the user will got 0 priority.
I can add a comment for this line.
> > @@ -77,6 +78,10 @@ static int bond_fill_slave_info(struct sk_buff *skb,
> > ad_port->partner_oper.port_state))
> > goto nla_put_failure;
> > }
> > +
> > + if (nla_put_u16(skb, IFLA_BOND_SLAVE_AD_ACTOR_PORT_PRIO,
> > + SLAVE_AD_INFO(slave)->port_priority))
> > + goto nla_put_failure;
>
>
> This is an 802.3ad (exclusive) setting, shouldn't this be in the
>
> if (BOND_MODE(slave->bond) == BOND_MODE_8023AD) { }
Hmm, the data in this blocks are read only values. I thought the actor priority
is changeable, so I put it outside the block.
But on the other hand, it makes sense to only show the value with 802.3ad
mode. I will update the code.
Thanks
Hangbin
Powered by blists - more mailing lists