Re: [PATCHv2 net-next 1/3] bonding: add support for per-port LACP actor priority

From
Hangbin Liu <hidden>
Date
2025-08-15 06:34:55
Also in
linux-doc, linux-kselftest
Reply to
Jonas Gorski, 2025-08-14
On Thu, Aug 14, 2025 at 01:46:10PM +0200, Jonas Gorski wrote:
quoted
@@ -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.
quoted
@@ -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
Thread (9 messages) 9 messages, 3 authors, last reply 2025-08-18
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help