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