[PATCHv2 iproute2-next] iplink: bond_slave: print actor and partner churn state

Subsystems: the rest

2 messages, 2 authors, 2026-03-02 · open the first message on its own page

[PATCHv2 iproute2-next] iplink: bond_slave: print actor and partner churn state

From: Hangbin Liu <hidden>
Date: 2026-02-26 03:38:59

Add ability to print both actor and partner port churn states
(MONITOR/CHURN/NO_CHURN) via netlink attributes. This provides
visibility into the LACP churn detection state for bond slaves.

Signed-off-by: Hangbin Liu <redacted>
---

v2: use print_uint() for unsigned int variable (Stephen Hemminger)

---
 ip/iplink_bond_slave.c | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
diff --git a/ip/iplink_bond_slave.c b/ip/iplink_bond_slave.c
index c88100e248dd..f4b28fbca948 100644
--- a/ip/iplink_bond_slave.c
+++ b/ip/iplink_bond_slave.c
@@ -86,6 +86,12 @@ static void print_slave_oper_state(FILE *fp, const char *name, __u16 state)
 	close_json_array(PRINT_ANY, "> ");
 }
 
+static const char *port_churn_state[] = {
+	"MONITOR",
+	"CHURN",
+	"NO_CHURN",
+};
+
 static void bond_slave_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])
 {
 	SPRINT_BUF(b1);
@@ -148,6 +154,26 @@ static void bond_slave_print_opt(struct link_util *lu, FILE *f, struct rtattr *t
 		print_slave_oper_state(f, "ad_partner_oper_port_state_str", state);
 	}
 
+	if (tb[IFLA_BOND_SLAVE_AD_CHURN_ACTOR_STATE]) {
+		__u8 state = rta_getattr_u8(tb[IFLA_BOND_SLAVE_AD_CHURN_ACTOR_STATE]);
+
+		if (state >= ARRAY_SIZE(port_churn_state))
+			print_uint(PRINT_ANY, "churn_actor_state", "churn_actor_state %u ", state);
+		else
+			print_string(PRINT_ANY, "churn_actor_state", "churn_actor_state %s ",
+				     port_churn_state[state]);
+	}
+
+	if (tb[IFLA_BOND_SLAVE_AD_CHURN_PARTNER_STATE]) {
+		__u8 state = rta_getattr_u8(tb[IFLA_BOND_SLAVE_AD_CHURN_PARTNER_STATE]);
+
+		if (state >= ARRAY_SIZE(port_churn_state))
+			print_uint(PRINT_ANY, "churn_partner_state", "churn_partner_state %u ", state);
+		else
+			print_string(PRINT_ANY, "churn_partner_state", "churn_partner_state %s ",
+				     port_churn_state[state]);
+	}
+
 	if (tb[IFLA_BOND_SLAVE_ACTOR_PORT_PRIO])
 		print_int(PRINT_ANY,
 			  "actor_port_prio",
-- 
2.50.1

Re: [PATCHv2 iproute2-next] iplink: bond_slave: print actor and partner churn state

From: patchwork-bot+netdevbpf@kernel.org
Date: 2026-03-02 15:40:05

Hello:

This patch was applied to iproute2/iproute2-next.git (main)
by David Ahern [off-list ref]:

On Thu, 26 Feb 2026 03:38:44 +0000 you wrote:
Add ability to print both actor and partner port churn states
(MONITOR/CHURN/NO_CHURN) via netlink attributes. This provides
visibility into the LACP churn detection state for bond slaves.

Signed-off-by: Hangbin Liu <redacted>
---

[...]
Here is the summary with links:
  - [PATCHv2,iproute2-next] iplink: bond_slave: print actor and partner churn state
    https://git.kernel.org/pub/scm/network/iproute2/iproute2-next.git/commit/?id=e092ff4c9b1b

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help