Netdev List
 help / color / mirror / Atom feed
* [PATCH net-next 0/6] bonding: 3ad: Support independent control with LAG offload
@ 2026-11-18  8:34 Ido Schimmel
  2026-11-18  8:34 ` [PATCH net-next 1/6] net: Add Rx enabled state to LAG lower state information Ido Schimmel
                   ` (5 more replies)
  0 siblings, 6 replies; 15+ messages in thread
From: Ido Schimmel @ 2026-11-18  8:34 UTC (permalink / raw)
  To: netdev
  Cc: davem, kuba, pabeni, edumazet, jv, andrew+netdev, petrm,
	sridhar.samudrala, jiri, horms, shuah, linux-kselftest, razor,
	Ido Schimmel

When coupled control is disabled (i.e., independent control is enabled),
an 802.3ad port can be in COLLECTING state where it is enabled for
collection, but not for distribution. This is useful in deployments that
want to avoid packet loss caused by a port starting to distribute before
its partner starts collecting.

Drivers that offload LAG are not aware of this Rx-only state since the
LAG lower state information only indicates whether the port is enabled
for transmission and the bond does not notify about Rx state changes.
Instead, these drivers enable or disable both collection and
distribution on the port according to its Tx state. As a result, packets
received by a port in COLLECTING state are dropped by the hardware.

In addition, a port that enters COLLECTING state advertises the
Collecting bit in its LACPDUs before offloading drivers are notified
about the Rx state change. The partner can therefore start distributing
packets to the port before collection is enabled, which defeats the
purpose of independent control.

Patch #1 adds an Rx enabled state to the LAG lower state information and
sets it according to the existing Tx enabled state.

Patch #2 sets this state in the bond driver according to the port's Rx
state and notifies about Rx state changes. The team driver keeps setting
it according to the Tx state.

Patch #3 changes mlxsw to enable collection independently of
distribution. Other drivers keep using the Tx enabled state, so their
behavior does not change.

Patch #4 adds a selftest for the Rx notifications (i.e., entering /
leaving COLLECTING state).

Patch #5 masks the Collecting bit in transmitted LACPDUs until the
notification about the Rx state change has been delivered.

Patch #6 adds a selftest for the previous patch.

Ido Schimmel (6):
  net: Add Rx enabled state to LAG lower state information
  bonding: 3ad: Notify Rx state changes
  mlxsw: Enable LAG collector independently of distributor
  selftests: bonding: Test notifications in COLLECTING state
  bonding: 3ad: Advertise Collecting only after collection is enabled
  selftests: bonding: Test that Collecting is advertised after
    notification

 drivers/net/bonding/bond_3ad.c                | 24 ++++-
 drivers/net/bonding/bond_main.c               |  4 +
 .../net/ethernet/mellanox/mlxsw/spectrum.c    | 15 +++
 drivers/net/net_failover.c                    |  1 +
 drivers/net/team/team_core.c                  |  1 +
 include/linux/netdevice.h                     |  3 +-
 include/net/bonding.h                         | 25 ++++-
 .../bonding/bond_lacp_independent_control.sh  | 94 ++++++++++++++++++-
 8 files changed, 159 insertions(+), 8 deletions(-)

-- 
2.56.0


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH net-next 1/6] net: Add Rx enabled state to LAG lower state information
  2026-11-18  8:34 [PATCH net-next 0/6] bonding: 3ad: Support independent control with LAG offload Ido Schimmel
@ 2026-11-18  8:34 ` Ido Schimmel
  2026-11-18  8:34 ` [PATCH net-next 2/6] bonding: 3ad: Notify Rx state changes Ido Schimmel
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 15+ messages in thread
From: Ido Schimmel @ 2026-11-18  8:34 UTC (permalink / raw)
  To: netdev
  Cc: davem, kuba, pabeni, edumazet, jv, andrew+netdev, petrm,
	sridhar.samudrala, jiri, horms, shuah, linux-kselftest, razor,
	Ido Schimmel

The LAG lower state information that is passed to drivers via the
NETDEV_CHANGELOWERSTATE notifier only indicates whether the lower device
is enabled for transmission ('tx_enabled'). Drivers such as mlxsw use
it to enable or disable both collection and distribution on the port.

This is not enough for an 802.3ad bond with coupled control disabled,
where a port can be enabled for collection, but not for distribution.

Add an 'rx_enabled' field that indicates whether the lower device is
enabled for reception. For now, set it to the value of 'tx_enabled' in
all the LAG drivers. A subsequent patch will set it differently in the
bond driver.

Reviewed-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
---
 drivers/net/bonding/bond_main.c | 1 +
 drivers/net/net_failover.c      | 1 +
 drivers/net/team/team_core.c    | 1 +
 include/linux/netdevice.h       | 3 ++-
 4 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 167503d1fd15..7eb3ff82ec96 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1831,6 +1831,7 @@ void bond_lower_state_changed(struct slave *slave)
 	info.link_up = slave->link == BOND_LINK_UP ||
 		       slave->link == BOND_LINK_FAIL;
 	info.tx_enabled = bond_is_active_slave(slave);
+	info.rx_enabled = info.tx_enabled;
 	netdev_lower_state_changed(slave->dev, &info);
 }
 
diff --git a/drivers/net/net_failover.c b/drivers/net/net_failover.c
index 1b5213e87070..c4d39f8b8802 100644
--- a/drivers/net/net_failover.c
+++ b/drivers/net/net_failover.c
@@ -451,6 +451,7 @@ static void net_failover_lower_state_changed(struct net_device *slave_dev,
 		else
 			info.tx_enabled = true;
 	}
+	info.rx_enabled = info.tx_enabled;
 
 	netdev_lower_state_changed(slave_dev, &info);
 }
diff --git a/drivers/net/team/team_core.c b/drivers/net/team/team_core.c
index cfb833c307c1..def94cbc8384 100644
--- a/drivers/net/team/team_core.c
+++ b/drivers/net/team/team_core.c
@@ -88,6 +88,7 @@ static void team_lower_state_changed(struct team_port *port)
 
 	info.link_up = port->linkup;
 	info.tx_enabled = team_port_tx_enabled(port);
+	info.rx_enabled = info.tx_enabled;
 	netdev_lower_state_changed(port->dev, &info);
 }
 
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 0325c6f2a7d1..694b6d29f680 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -3239,7 +3239,8 @@ struct netdev_lag_upper_info {
 
 struct netdev_lag_lower_state_info {
 	u8 link_up : 1,
-	   tx_enabled : 1;
+	   tx_enabled : 1,
+	   rx_enabled : 1;
 };
 
 #include <linux/notifier.h>
-- 
2.56.0


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH net-next 2/6] bonding: 3ad: Notify Rx state changes
  2026-11-18  8:34 [PATCH net-next 0/6] bonding: 3ad: Support independent control with LAG offload Ido Schimmel
  2026-11-18  8:34 ` [PATCH net-next 1/6] net: Add Rx enabled state to LAG lower state information Ido Schimmel
@ 2026-11-18  8:34 ` Ido Schimmel
  2026-11-18 20:00   ` Jay Vosburgh
  2026-11-18  8:34 ` [PATCH net-next 3/6] mlxsw: Enable LAG collector independently of distributor Ido Schimmel
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 15+ messages in thread
From: Ido Schimmel @ 2026-11-18  8:34 UTC (permalink / raw)
  To: netdev
  Cc: davem, kuba, pabeni, edumazet, jv, andrew+netdev, petrm,
	sridhar.samudrala, jiri, horms, shuah, linux-kselftest, razor,
	Ido Schimmel

When coupled control is disabled, a port in COLLECTING state is enabled
for collection, but not for distribution. However, drivers that offload
LAG are not notified when a port enters or leaves this state since the
bond only notifies them when the port's 'backup' flag changes.

Fix by setting 'rx_enabled' in the LAG lower state information according
to the slave's 'rx_disabled' flag in 802.3ad mode and by notifying when
this flag changes. Track pending notifications using a separate bit
since 'should_notify' is toggled when the 'backup' flag changes.

Reviewed-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
---

Notes:
    Known issues that this patch does not address:
    
    1. The new 'should_notify_rx' bit shares a bitfield with other slave
       flags. The 802.3ad state machine writes them under the mode lock, while
       a few other paths (e.g., the 'all_slaves_active' handler) write them
       under RTNL only. This is not new.
    
    2. When a port is disabled with BOND_SLAVE_NOTIFY_NOW, two notifications
       are sent: one after the Tx state change and one after the Rx state
       change. This is harmless.

 drivers/net/bonding/bond_3ad.c  |  2 +-
 drivers/net/bonding/bond_main.c |  5 ++++-
 include/net/bonding.h           | 25 +++++++++++++++++++++----
 3 files changed, 26 insertions(+), 6 deletions(-)

diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
index d91533b80996..d2a55f4d8979 100644
--- a/drivers/net/bonding/bond_3ad.c
+++ b/drivers/net/bonding/bond_3ad.c
@@ -2608,7 +2608,7 @@ void bond_3ad_state_machine_handler(struct work_struct *work)
 
 re_arm:
 	bond_for_each_slave_rcu(bond, slave, iter) {
-		if (slave->should_notify) {
+		if (slave->should_notify || slave->should_notify_rx) {
 			should_notify_rtnl = BOND_SLAVE_NOTIFY_NOW;
 			break;
 		}
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 7eb3ff82ec96..4ba1f5c33251 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1831,7 +1831,10 @@ void bond_lower_state_changed(struct slave *slave)
 	info.link_up = slave->link == BOND_LINK_UP ||
 		       slave->link == BOND_LINK_FAIL;
 	info.tx_enabled = bond_is_active_slave(slave);
-	info.rx_enabled = info.tx_enabled;
+	if (BOND_MODE(slave->bond) == BOND_MODE_8023AD)
+		info.rx_enabled = !bond_is_slave_rx_disabled(slave);
+	else
+		info.rx_enabled = info.tx_enabled;
 	netdev_lower_state_changed(slave->dev, &info);
 }
 
diff --git a/include/net/bonding.h b/include/net/bonding.h
index cb89aff437f4..5980df71a358 100644
--- a/include/net/bonding.h
+++ b/include/net/bonding.h
@@ -170,6 +170,7 @@ struct slave {
 	       inactive:1, /* indicates inactive slave */
 	       rx_disabled:1, /* indicates whether slave's Rx is disabled */
 	       should_notify:1, /* indicates whether the state changed */
+	       should_notify_rx:1, /* indicates whether the Rx state changed */
 	       should_notify_link:1; /* indicates whether the link changed */
 	u8     duplex;
 	u32    original_mtu;
@@ -399,6 +400,21 @@ static inline void bond_set_slave_state(struct slave *slave,
 	}
 }
 
+static inline void bond_set_slave_rx_disabled(struct slave *slave,
+					      bool rx_disabled, bool notify)
+{
+	if (slave->rx_disabled == rx_disabled)
+		return;
+
+	slave->rx_disabled = rx_disabled;
+	if (notify) {
+		bond_lower_state_changed(slave);
+		slave->should_notify_rx = 0;
+	} else {
+		slave->should_notify_rx = 1;
+	}
+}
+
 static inline void bond_slave_state_change(struct bonding *bond)
 {
 	struct list_head *iter;
@@ -418,9 +434,10 @@ static inline void bond_slave_state_notify(struct bonding *bond)
 	struct slave *tmp;
 
 	bond_for_each_slave(bond, tmp, iter) {
-		if (tmp->should_notify) {
+		if (tmp->should_notify || tmp->should_notify_rx) {
 			bond_lower_state_changed(tmp);
 			tmp->should_notify = 0;
+			tmp->should_notify_rx = 0;
 		}
 	}
 }
@@ -573,7 +590,7 @@ static inline void bond_set_slave_inactive_flags(struct slave *slave,
 	if (!slave->bond->params.all_slaves_active)
 		slave->inactive = 1;
 	if (BOND_MODE(slave->bond) == BOND_MODE_8023AD)
-		slave->rx_disabled = 1;
+		bond_set_slave_rx_disabled(slave, true, notify);
 }
 
 static inline void bond_set_slave_tx_disabled_flags(struct slave *slave,
@@ -588,14 +605,14 @@ static inline void bond_set_slave_active_flags(struct slave *slave,
 	bond_set_slave_state(slave, BOND_STATE_ACTIVE, notify);
 	slave->inactive = 0;
 	if (BOND_MODE(slave->bond) == BOND_MODE_8023AD)
-		slave->rx_disabled = 0;
+		bond_set_slave_rx_disabled(slave, false, notify);
 }
 
 static inline void bond_set_slave_rx_enabled_flags(struct slave *slave,
 					       bool notify)
 {
 	slave->inactive = 0;
-	slave->rx_disabled = 0;
+	bond_set_slave_rx_disabled(slave, false, notify);
 }
 
 static inline bool bond_is_slave_inactive(struct slave *slave)
-- 
2.56.0


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH net-next 3/6] mlxsw: Enable LAG collector independently of distributor
  2026-11-18  8:34 [PATCH net-next 0/6] bonding: 3ad: Support independent control with LAG offload Ido Schimmel
  2026-11-18  8:34 ` [PATCH net-next 1/6] net: Add Rx enabled state to LAG lower state information Ido Schimmel
  2026-11-18  8:34 ` [PATCH net-next 2/6] bonding: 3ad: Notify Rx state changes Ido Schimmel
@ 2026-11-18  8:34 ` Ido Schimmel
  2026-11-19  9:19   ` netdev-bot+sashiko
  2026-11-18  8:34 ` [PATCH net-next 4/6] selftests: bonding: Test notifications in COLLECTING state Ido Schimmel
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 15+ messages in thread
From: Ido Schimmel @ 2026-11-18  8:34 UTC (permalink / raw)
  To: netdev
  Cc: davem, kuba, pabeni, edumazet, jv, andrew+netdev, petrm,
	sridhar.samudrala, jiri, horms, shuah, linux-kselftest, razor,
	Ido Schimmel

The driver enables or disables both the collector and the distributor of
a LAG port according to 'tx_enabled'. As a result, when coupled control
is disabled in an 802.3ad bond, a port in COLLECTING state does not
receive packets.

Fix by enabling the collector and removing the port from the distributor
when 'rx_enabled' is set, but 'tx_enabled' is not.

The port is not necessarily in the distributor list when it is removed
from it (e.g., when it moves from ATTACHED to COLLECTING state). This is
fine since the device allows removing a port that was already removed
and returns success.

Do not add the port back to the distributor list if enabling the
collector fails. The port should not be in the list when 'tx_enabled' is
not set and it might not have been in the list to begin with.

Reviewed-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
---

Notes:
    The error paths of mlxsw_sp_port_lag_col_dist_enable() and
    mlxsw_sp_port_lag_col_dist_disable() do not take the new collection-only
    state into account and might not restore the previous state. I do not
    think it is worth handling. These errors are only logged and not
    propagated to the LAG driver, so the hardware and the LAG driver are out
    of sync regardless of what the rollback does. In addition, these
    register writes are not expected to fail and I have never seen them
    fail.

 drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
index 815e8d8e3185..5a6dc033084d 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
@@ -4515,11 +4515,26 @@ mlxsw_sp_port_lag_col_dist_disable(struct mlxsw_sp_port *mlxsw_sp_port)
 	return err;
 }
 
+static int mlxsw_sp_port_lag_col_enable(struct mlxsw_sp_port *mlxsw_sp_port)
+{
+	int err;
+
+	err = mlxsw_sp_lag_dist_port_remove(mlxsw_sp_port,
+					    mlxsw_sp_port->lag_id);
+	if (err)
+		return err;
+
+	return mlxsw_sp_lag_col_port_enable(mlxsw_sp_port,
+					    mlxsw_sp_port->lag_id);
+}
+
 static int mlxsw_sp_port_lag_changed(struct mlxsw_sp_port *mlxsw_sp_port,
 				     struct netdev_lag_lower_state_info *info)
 {
 	if (info->tx_enabled)
 		return mlxsw_sp_port_lag_col_dist_enable(mlxsw_sp_port);
+	else if (info->rx_enabled)
+		return mlxsw_sp_port_lag_col_enable(mlxsw_sp_port);
 	else
 		return mlxsw_sp_port_lag_col_dist_disable(mlxsw_sp_port);
 }
-- 
2.56.0


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH net-next 4/6] selftests: bonding: Test notifications in COLLECTING state
  2026-11-18  8:34 [PATCH net-next 0/6] bonding: 3ad: Support independent control with LAG offload Ido Schimmel
                   ` (2 preceding siblings ...)
  2026-11-18  8:34 ` [PATCH net-next 3/6] mlxsw: Enable LAG collector independently of distributor Ido Schimmel
@ 2026-11-18  8:34 ` Ido Schimmel
  2026-11-18  8:34 ` [PATCH net-next 5/6] bonding: 3ad: Advertise Collecting only after collection is enabled Ido Schimmel
  2026-11-18  8:34 ` [PATCH net-next 6/6] selftests: bonding: Test that Collecting is advertised after notification Ido Schimmel
  5 siblings, 0 replies; 15+ messages in thread
From: Ido Schimmel @ 2026-11-18  8:34 UTC (permalink / raw)
  To: netdev
  Cc: davem, kuba, pabeni, edumazet, jv, andrew+netdev, petrm,
	sridhar.samudrala, jiri, horms, shuah, linux-kselftest, razor,
	Ido Schimmel

Test that with coupled control disabled, a notification is emitted when
a port enters or leaves COLLECTING state.

Output without "bonding: 3ad: Notify Rx state changes":

 # ./bond_lacp_independent_control.sh
 TEST: Receive in COLLECTING state                                   [ OK ]
 TEST: Notifications in COLLECTING state                             [FAIL]
         No notification upon entering COLLECTING state
 TEST: Ping in DISTRIBUTING state                                    [ OK ]

Output with the fix:

 # ./bond_lacp_independent_control.sh
 TEST: Receive in COLLECTING state                                   [ OK ]
 TEST: Notifications in COLLECTING state                             [ OK ]
 TEST: Ping in DISTRIBUTING state                                    [ OK ]

Reviewed-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
---
 .../bonding/bond_lacp_independent_control.sh  | 41 +++++++++++++++++++
 1 file changed, 41 insertions(+)

diff --git a/tools/testing/selftests/drivers/net/bonding/bond_lacp_independent_control.sh b/tools/testing/selftests/drivers/net/bonding/bond_lacp_independent_control.sh
index c29712e01e49..a2b83b581e40 100755
--- a/tools/testing/selftests/drivers/net/bonding/bond_lacp_independent_control.sh
+++ b/tools/testing/selftests/drivers/net/bonding/bond_lacp_independent_control.sh
@@ -15,6 +15,7 @@
 # shellcheck disable=SC2034,SC2329
 ALL_TESTS="
 	collecting
+	collecting_notify
 	distributing
 "
 NUM_NETIFS=2
@@ -121,6 +122,46 @@ collecting()
 	log_test "Receive in COLLECTING state"
 }
 
+collecting_notify()
+{
+	local tmp_file
+
+	RET=0
+
+	partner_state_clear 0x18
+	defer tc filter del dev "$h1" ingress pref 1 handle 101 flower
+	lacp_state_wait "$h1" 0x0f
+	check_err $? "Port did not reach ATTACHED state"
+
+	tmp_file=$(mktemp)
+	defer rm "$tmp_file"
+	ip -d monitor link dev "$h1" >> "$tmp_file" &
+	defer kill_process $!
+	sleep 1
+
+	partner_state_clear 0x10
+	lacp_state_wait "$h1" 0x1f
+	check_err $? "Port did not reach COLLECTING state"
+
+	slowwait "$WAIT_TIMEOUT" grep -qw \
+		"ad_actor_oper_port_state $((0x1f))" "$tmp_file"
+	check_err $? "No notification upon entering COLLECTING state"
+
+	# Discard previous notifications so that only a notification upon
+	# leaving COLLECTING state can match below. The monitor appends to
+	# the file, so truncating it is safe.
+	: > "$tmp_file"
+	partner_state_clear 0x18
+	lacp_state_wait "$h1" 0x0f
+	check_err $? "Port did not reach ATTACHED state"
+
+	slowwait "$WAIT_TIMEOUT" grep -qw \
+		"ad_actor_oper_port_state $((0x0f))" "$tmp_file"
+	check_err $? "No notification upon leaving COLLECTING state"
+
+	log_test "Notifications in COLLECTING state"
+}
+
 distributing()
 {
 	RET=0
-- 
2.56.0


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH net-next 5/6] bonding: 3ad: Advertise Collecting only after collection is enabled
  2026-11-18  8:34 [PATCH net-next 0/6] bonding: 3ad: Support independent control with LAG offload Ido Schimmel
                   ` (3 preceding siblings ...)
  2026-11-18  8:34 ` [PATCH net-next 4/6] selftests: bonding: Test notifications in COLLECTING state Ido Schimmel
@ 2026-11-18  8:34 ` Ido Schimmel
  2026-11-19  9:19   ` netdev-bot+sashiko
  2026-11-18  8:34 ` [PATCH net-next 6/6] selftests: bonding: Test that Collecting is advertised after notification Ido Schimmel
  5 siblings, 1 reply; 15+ messages in thread
From: Ido Schimmel @ 2026-11-18  8:34 UTC (permalink / raw)
  To: netdev
  Cc: davem, kuba, pabeni, edumazet, jv, andrew+netdev, petrm,
	sridhar.samudrala, jiri, horms, shuah, linux-kselftest, razor,
	Ido Schimmel

When coupled control is disabled, a port that enters COLLECTING state
advertises the Collecting bit in the LACPDU that is transmitted in the
same state machine run. However, drivers that offload LAG only enable
collection on the port when they are notified about its Rx state change,
which happens at the end of the run or later if RTNL could not be
acquired. The partner can therefore start distributing packets to the
port before collection is enabled in hardware, resulting in packet loss.

This contradicts IEEE 802.1AX-2020 6.4.13: "In the COLLECTING state,
collection of frames from the Aggregation Port is enabled, then
Actor_Oper_Port_State.Collecting is set to TRUE".

Solve this by masking the Collecting bit in transmitted LACPDUs as long
as the notification is pending and by transmitting a new LACPDU once it
was delivered.

Reviewed-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
---
 drivers/net/bonding/bond_3ad.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
index d2a55f4d8979..61f6de803b66 100644
--- a/drivers/net/bonding/bond_3ad.c
+++ b/drivers/net/bonding/bond_3ad.c
@@ -250,6 +250,19 @@ static int __port_is_collecting_distributing(struct port *port)
 	return bond_is_active_slave(port->slave);
 }
 
+/**
+ * __port_rx_notify_pending - check if the port's Rx state change was not
+ * notified yet when coupled control is disabled
+ * @port: the port we're looking at
+ *
+ * Return: true if the notification is pending, false otherwise.
+ */
+static bool __port_rx_notify_pending(struct port *port)
+{
+	return !port->slave->bond->params.coupled_control &&
+	       port->slave->should_notify_rx;
+}
+
 /**
  * __get_agg_selection_mode - get the aggregator selection mode
  * @port: the port we're looking at
@@ -903,6 +916,9 @@ static inline void __update_lacpdu_from_port(struct port *port)
 	lacpdu->actor_port_priority = htons(port->actor_port_priority);
 	lacpdu->actor_port = htons(port->actor_port_number);
 	lacpdu->actor_state = port->actor_oper_port_state;
+	/* Collection is only enabled once the Rx state change is notified */
+	if (__port_rx_notify_pending(port))
+		lacpdu->actor_state &= ~LACP_STATE_COLLECTING;
 	slave_dbg(port->slave->bond->dev, port->slave->dev,
 		  "update lacpdu: actor port state %x\n",
 		  port->actor_oper_port_state);
@@ -1440,6 +1456,12 @@ static void ad_churn_machine(struct port *port)
  */
 static void ad_tx_machine(struct port *port)
 {
+	/* Advertise Collecting if it was masked in the last LACPDU */
+	if ((port->actor_oper_port_state & LACP_STATE_COLLECTING) &&
+	    !(port->lacpdu.actor_state & LACP_STATE_COLLECTING) &&
+	    !__port_rx_notify_pending(port))
+		port->ntt = true;
+
 	/* check if tx timer expired, to verify that we do not send more than
 	 * 3 packets per second
 	 */
-- 
2.56.0


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH net-next 6/6] selftests: bonding: Test that Collecting is advertised after notification
  2026-11-18  8:34 [PATCH net-next 0/6] bonding: 3ad: Support independent control with LAG offload Ido Schimmel
                   ` (4 preceding siblings ...)
  2026-11-18  8:34 ` [PATCH net-next 5/6] bonding: 3ad: Advertise Collecting only after collection is enabled Ido Schimmel
@ 2026-11-18  8:34 ` Ido Schimmel
  2026-11-19  9:19   ` netdev-bot+sashiko
  5 siblings, 1 reply; 15+ messages in thread
From: Ido Schimmel @ 2026-11-18  8:34 UTC (permalink / raw)
  To: netdev
  Cc: davem, kuba, pabeni, edumazet, jv, andrew+netdev, petrm,
	sridhar.samudrala, jiri, horms, shuah, linux-kselftest, razor,
	Ido Schimmel

Test that with coupled control disabled, a port only advertises the
Collecting bit after a notification about its Rx state change was
emitted.

Use a slow LACP rate on the partner so that the port only transmits
periodic LACPDUs every 30 seconds and is therefore not rate limited when
entering COLLECTING state.

Output without "bonding: 3ad: Advertise Collecting only after collection
is enabled":

 # ./bond_lacp_independent_control.sh
 TEST: Receive in COLLECTING state                                   [ OK ]
 TEST: Notifications in COLLECTING state                             [ OK ]
 TEST: Collecting advertised after notification                      [FAIL]
         Collecting bit advertised before notification
 TEST: Ping in DISTRIBUTING state                                    [ OK ]

Output with the fix:

 # ./bond_lacp_independent_control.sh
 TEST: Receive in COLLECTING state                                   [ OK ]
 TEST: Notifications in COLLECTING state                             [ OK ]
 TEST: Collecting advertised after notification                      [ OK ]
 TEST: Ping in DISTRIBUTING state                                    [ OK ]

Reviewed-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
---

Notes:
    The test compares a user space timestamp (ip monitor) with a kernel
    timestamp (tcpdump). This cannot hide a bug since a delay in ip can only
    make the notification appear later. A false failure requires ip to stall
    for longer than the gap between the notification and the LACPDU, which
    is at least one state machine tick (100 ms). Did not observe such a
    failure with normal or debug kernels.

 .../bonding/bond_lacp_independent_control.sh  | 53 ++++++++++++++++++-
 1 file changed, 51 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/drivers/net/bonding/bond_lacp_independent_control.sh b/tools/testing/selftests/drivers/net/bonding/bond_lacp_independent_control.sh
index a2b83b581e40..b86f39f31d0c 100755
--- a/tools/testing/selftests/drivers/net/bonding/bond_lacp_independent_control.sh
+++ b/tools/testing/selftests/drivers/net/bonding/bond_lacp_independent_control.sh
@@ -4,7 +4,7 @@
 # +-------------------------+ +-------------------------+
 # | H1 (vrf)                | | H2 (vrf)                |
 # |  + bond1 (802.3ad)      | |  + bond2 (802.3ad)      |
-# |  | coupled_control off  | |  |                      |
+# |  | coupled_control off  | |  | lacp_rate slow       |
 # |  | 192.0.2.1/28         | |  | 192.0.2.2/28         |
 # |  |                      | |  |                      |
 # |  + $h1                  | |  + $h2                  |
@@ -16,6 +16,7 @@
 ALL_TESTS="
 	collecting
 	collecting_notify
+	collecting_advertise
 	distributing
 "
 NUM_NETIFS=2
@@ -24,6 +25,8 @@ lib_dir=$(dirname "$0")
 # shellcheck disable=SC1091
 source "$lib_dir"/../../../net/forwarding/lib.sh
 
+require_command tcpdump
+
 lacp_state_get()
 {
 	local dev=$1; shift
@@ -75,7 +78,9 @@ h1_create()
 
 h2_create()
 {
-	adf_ip_link_add bond2 type bond mode 802.3ad lacp_rate fast
+	# Slow rate makes $h1 transmit periodic LACPDUs every 30 seconds, so
+	# that it is not rate limited when entering COLLECTING state.
+	adf_ip_link_add bond2 type bond mode 802.3ad lacp_rate slow
 	adf_ip_link_set_master "$h2" bond2
 	adf_simple_if_init bond2 192.0.2.2/28
 }
@@ -162,6 +167,50 @@ collecting_notify()
 	log_test "Notifications in COLLECTING state"
 }
 
+collecting_advertise()
+{
+	local lacpdu_ts notify_ts tmp_dir
+
+	RET=0
+
+	partner_state_clear 0x18
+	defer tc filter del dev "$h1" ingress pref 1 handle 101 flower
+	lacp_state_wait "$h1" 0x0f
+	check_err $? "Port did not reach ATTACHED state"
+
+	tmp_dir=$(mktemp -d)
+	defer rm -rf "$tmp_dir"
+	ip -ts -o -d monitor link dev "$h1" > "$tmp_dir"/notify &
+	defer kill_process $!
+	# Capture transmitted LACPDUs with the Collecting (0x10) bit set in
+	# the actor state.
+	tcpdump -tt -n -l -p -Q out -i "$h1" \
+		"ether proto 0x8809 and ether[32] & 0x10 != 0" \
+		> "$tmp_dir"/lacpdu 2> /dev/null &
+	defer kill_process $!
+	sleep 1
+
+	partner_state_clear 0x10
+	lacp_state_wait "$h1" 0x1f
+	check_err $? "Port did not reach COLLECTING state"
+
+	slowwait "$WAIT_TIMEOUT" grep -qw \
+		"ad_actor_oper_port_state $((0x1f))" "$tmp_dir"/notify
+	check_err $? "No notification upon entering COLLECTING state"
+
+	slowwait "$WAIT_TIMEOUT" grep -q . "$tmp_dir"/lacpdu
+	check_err $? "Collecting bit not advertised"
+
+	notify_ts=$(grep -m1 -w "ad_actor_oper_port_state $((0x1f))" \
+		    "$tmp_dir"/notify | sed 's/^\[\([^]]*\)\].*/\1/')
+	notify_ts=$(date -d "$notify_ts" +%s%6N)
+	lacpdu_ts=$(head -n1 "$tmp_dir"/lacpdu | cut -d' ' -f1 | tr -d .)
+	((lacpdu_ts > notify_ts))
+	check_err $? "Collecting bit advertised before notification"
+
+	log_test "Collecting advertised after notification"
+}
+
 distributing()
 {
 	RET=0
-- 
2.56.0


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH net-next 2/6] bonding: 3ad: Notify Rx state changes
  2026-11-18  8:34 ` [PATCH net-next 2/6] bonding: 3ad: Notify Rx state changes Ido Schimmel
@ 2026-11-18 20:00   ` Jay Vosburgh
  2026-11-19  9:03     ` Ido Schimmel
  0 siblings, 1 reply; 15+ messages in thread
From: Jay Vosburgh @ 2026-11-18 20:00 UTC (permalink / raw)
  To: Ido Schimmel
  Cc: netdev, davem, kuba, pabeni, edumazet, andrew+netdev, petrm,
	sridhar.samudrala, jiri, horms, shuah, linux-kselftest, razor

Ido Schimmel <idosch@nvidia.com> wrote:

>When coupled control is disabled, a port in COLLECTING state is enabled
>for collection, but not for distribution. However, drivers that offload
>LAG are not notified when a port enters or leaves this state since the
>bond only notifies them when the port's 'backup' flag changes.
>
>Fix by setting 'rx_enabled' in the LAG lower state information according
>to the slave's 'rx_disabled' flag in 802.3ad mode and by notifying when
>this flag changes. Track pending notifications using a separate bit
>since 'should_notify' is toggled when the 'backup' flag changes.
>
>Reviewed-by: Petr Machata <petrm@nvidia.com>
>Signed-off-by: Ido Schimmel <idosch@nvidia.com>
>---
>
>Notes:
>    Known issues that this patch does not address:
>    
>    1. The new 'should_notify_rx' bit shares a bitfield with other slave
>       flags. The 802.3ad state machine writes them under the mode lock, while
>       a few other paths (e.g., the 'all_slaves_active' handler) write them
>       under RTNL only. This is not new.
>    
>    2. When a port is disabled with BOND_SLAVE_NOTIFY_NOW, two notifications
>       are sent: one after the Tx state change and one after the Rx state
>       change. This is harmless.

	How do we know this is harmless?  Isn't this a change of
behavior that's visible to user space?

	-J

> drivers/net/bonding/bond_3ad.c  |  2 +-
> drivers/net/bonding/bond_main.c |  5 ++++-
> include/net/bonding.h           | 25 +++++++++++++++++++++----
> 3 files changed, 26 insertions(+), 6 deletions(-)
>
>diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
>index d91533b80996..d2a55f4d8979 100644
>--- a/drivers/net/bonding/bond_3ad.c
>+++ b/drivers/net/bonding/bond_3ad.c
>@@ -2608,7 +2608,7 @@ void bond_3ad_state_machine_handler(struct work_struct *work)
> 
> re_arm:
> 	bond_for_each_slave_rcu(bond, slave, iter) {
>-		if (slave->should_notify) {
>+		if (slave->should_notify || slave->should_notify_rx) {
> 			should_notify_rtnl = BOND_SLAVE_NOTIFY_NOW;
> 			break;
> 		}
>diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
>index 7eb3ff82ec96..4ba1f5c33251 100644
>--- a/drivers/net/bonding/bond_main.c
>+++ b/drivers/net/bonding/bond_main.c
>@@ -1831,7 +1831,10 @@ void bond_lower_state_changed(struct slave *slave)
> 	info.link_up = slave->link == BOND_LINK_UP ||
> 		       slave->link == BOND_LINK_FAIL;
> 	info.tx_enabled = bond_is_active_slave(slave);
>-	info.rx_enabled = info.tx_enabled;
>+	if (BOND_MODE(slave->bond) == BOND_MODE_8023AD)
>+		info.rx_enabled = !bond_is_slave_rx_disabled(slave);
>+	else
>+		info.rx_enabled = info.tx_enabled;
> 	netdev_lower_state_changed(slave->dev, &info);
> }
> 
>diff --git a/include/net/bonding.h b/include/net/bonding.h
>index cb89aff437f4..5980df71a358 100644
>--- a/include/net/bonding.h
>+++ b/include/net/bonding.h
>@@ -170,6 +170,7 @@ struct slave {
> 	       inactive:1, /* indicates inactive slave */
> 	       rx_disabled:1, /* indicates whether slave's Rx is disabled */
> 	       should_notify:1, /* indicates whether the state changed */
>+	       should_notify_rx:1, /* indicates whether the Rx state changed */
> 	       should_notify_link:1; /* indicates whether the link changed */
> 	u8     duplex;
> 	u32    original_mtu;
>@@ -399,6 +400,21 @@ static inline void bond_set_slave_state(struct slave *slave,
> 	}
> }
> 
>+static inline void bond_set_slave_rx_disabled(struct slave *slave,
>+					      bool rx_disabled, bool notify)
>+{
>+	if (slave->rx_disabled == rx_disabled)
>+		return;
>+
>+	slave->rx_disabled = rx_disabled;
>+	if (notify) {
>+		bond_lower_state_changed(slave);
>+		slave->should_notify_rx = 0;
>+	} else {
>+		slave->should_notify_rx = 1;
>+	}
>+}
>+
> static inline void bond_slave_state_change(struct bonding *bond)
> {
> 	struct list_head *iter;
>@@ -418,9 +434,10 @@ static inline void bond_slave_state_notify(struct bonding *bond)
> 	struct slave *tmp;
> 
> 	bond_for_each_slave(bond, tmp, iter) {
>-		if (tmp->should_notify) {
>+		if (tmp->should_notify || tmp->should_notify_rx) {
> 			bond_lower_state_changed(tmp);
> 			tmp->should_notify = 0;
>+			tmp->should_notify_rx = 0;
> 		}
> 	}
> }
>@@ -573,7 +590,7 @@ static inline void bond_set_slave_inactive_flags(struct slave *slave,
> 	if (!slave->bond->params.all_slaves_active)
> 		slave->inactive = 1;
> 	if (BOND_MODE(slave->bond) == BOND_MODE_8023AD)
>-		slave->rx_disabled = 1;
>+		bond_set_slave_rx_disabled(slave, true, notify);
> }
> 
> static inline void bond_set_slave_tx_disabled_flags(struct slave *slave,
>@@ -588,14 +605,14 @@ static inline void bond_set_slave_active_flags(struct slave *slave,
> 	bond_set_slave_state(slave, BOND_STATE_ACTIVE, notify);
> 	slave->inactive = 0;
> 	if (BOND_MODE(slave->bond) == BOND_MODE_8023AD)
>-		slave->rx_disabled = 0;
>+		bond_set_slave_rx_disabled(slave, false, notify);
> }
> 
> static inline void bond_set_slave_rx_enabled_flags(struct slave *slave,
> 					       bool notify)
> {
> 	slave->inactive = 0;
>-	slave->rx_disabled = 0;
>+	bond_set_slave_rx_disabled(slave, false, notify);
> }
> 
> static inline bool bond_is_slave_inactive(struct slave *slave)
>-- 
>2.56.0
>

---
	-Jay Vosburgh, jv@jvosburgh.net

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH net-next 2/6] bonding: 3ad: Notify Rx state changes
  2026-11-18 20:00   ` Jay Vosburgh
@ 2026-11-19  9:03     ` Ido Schimmel
  0 siblings, 0 replies; 15+ messages in thread
From: Ido Schimmel @ 2026-11-19  9:03 UTC (permalink / raw)
  To: Jay Vosburgh
  Cc: netdev, davem, kuba, pabeni, edumazet, andrew+netdev, petrm,
	sridhar.samudrala, jiri, horms, shuah, linux-kselftest, razor

On Wed, Nov 18, 2026 at 12:00:15PM -0800, Jay Vosburgh wrote:
> Ido Schimmel <idosch@nvidia.com> wrote:
> 
> >When coupled control is disabled, a port in COLLECTING state is enabled
> >for collection, but not for distribution. However, drivers that offload
> >LAG are not notified when a port enters or leaves this state since the
> >bond only notifies them when the port's 'backup' flag changes.
> >
> >Fix by setting 'rx_enabled' in the LAG lower state information according
> >to the slave's 'rx_disabled' flag in 802.3ad mode and by notifying when
> >this flag changes. Track pending notifications using a separate bit
> >since 'should_notify' is toggled when the 'backup' flag changes.
> >
> >Reviewed-by: Petr Machata <petrm@nvidia.com>
> >Signed-off-by: Ido Schimmel <idosch@nvidia.com>
> >---
> >
> >Notes:
> >    Known issues that this patch does not address:
> >    
> >    1. The new 'should_notify_rx' bit shares a bitfield with other slave
> >       flags. The 802.3ad state machine writes them under the mode lock, while
> >       a few other paths (e.g., the 'all_slaves_active' handler) write them
> >       under RTNL only. This is not new.
> >    
> >    2. When a port is disabled with BOND_SLAVE_NOTIFY_NOW, two notifications
> >       are sent: one after the Tx state change and one after the Rx state
> >       change. This is harmless.
> 
> 	How do we know this is harmless?  Isn't this a change of
> behavior that's visible to user space?

The change in behavior is one additional RTM_NEWLINK notification that
is identical to the previous one in a path that already generates
multiple such notifications. I don't see how it can be harmful.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH net-next 3/6] mlxsw: Enable LAG collector independently of distributor
  2026-11-18  8:34 ` [PATCH net-next 3/6] mlxsw: Enable LAG collector independently of distributor Ido Schimmel
@ 2026-11-19  9:19   ` netdev-bot+sashiko
  2026-11-19 10:28     ` Ido Schimmel
  0 siblings, 1 reply; 15+ messages in thread
From: netdev-bot+sashiko @ 2026-11-19  9:19 UTC (permalink / raw)
  To: idosch
  Cc: netdev, davem, kuba, pabeni, edumazet, jv, andrew+netdev, petrm,
	sridhar.samudrala, jiri, horms, shuah, linux-kselftest, razor

Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] The new collection-only state (SLCOR collector on, port not in
  the SLDR distributor list), reached through…

--

mlxsw: Enable LAG collector independently of distributor

This patch adds a collection-only state for LAG ports. When rx_enabled is
set and tx_enabled is not, mlxsw_sp_port_lag_changed() now enables the
SLCOR collector and removes the port from the SLDR distributor list.
Without this, a port in COLLECTING state in an 802.3ad bond with coupled
control disabled did not receive packets.

> diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
> index 815e8d8e31856..5a6dc033084d8 100644
> --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
> +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
> @@ -4515,11 +4515,26 @@ mlxsw_sp_port_lag_col_dist_disable(struct mlxsw_sp_port *mlxsw_sp_port)
>  	return err;
>  }
>  
> +static int mlxsw_sp_port_lag_col_enable(struct mlxsw_sp_port *mlxsw_sp_port)
> +{
> +	int err;
> +
> +	err = mlxsw_sp_lag_dist_port_remove(mlxsw_sp_port,
> +					    mlxsw_sp_port->lag_id);
> +	if (err)
> +		return err;
> +
> +	return mlxsw_sp_lag_col_port_enable(mlxsw_sp_port,
> +					    mlxsw_sp_port->lag_id);
> +}
> +
>  static int mlxsw_sp_port_lag_changed(struct mlxsw_sp_port *mlxsw_sp_port,
>  				     struct netdev_lag_lower_state_info *info)
>  {
>  	if (info->tx_enabled)
>  		return mlxsw_sp_port_lag_col_dist_enable(mlxsw_sp_port);
> +	else if (info->rx_enabled)
> +		return mlxsw_sp_port_lag_col_enable(mlxsw_sp_port);

[Severity: Low]
With the new collection-only state (collector on, port not in the
distributor list), do the error paths in the two existing helpers still
do the right thing? Both cases need a register write to fail.

A move from COLLECTING to COLLECTING_DISTRIBUTING calls
mlxsw_sp_port_lag_col_dist_enable(). If the SLDR add fails, the error path
turns off a collector that was already correctly enabled:

mlxsw_sp_port_lag_col_dist_enable() {
    ...
err_dist_port_add:
	mlxsw_sp_lag_col_port_disable(mlxsw_sp_port, mlxsw_sp_port->lag_id);
	return err;
}

Would this drop ingress on a link that both partners negotiated as
COLLECTING?

A move from COLLECTING to ATTACHED or DETACHED calls
mlxsw_sp_port_lag_col_dist_disable(). The SLDR remove succeeds even though
the port was never in the list. If the SLCOR disable then fails, the error
path adds the port to the distributor list:

mlxsw_sp_port_lag_col_dist_disable() {
    ...
err_col_port_disable:
	mlxsw_sp_lag_dist_port_add(mlxsw_sp_port, mlxsw_sp_port->lag_id);
	return err;
}

Could the device then hash LAG egress onto a port that LACP never moved to
DISTRIBUTING, while bonding has tx disabled for it? That state matches
neither the old LAG state nor the new one.

mlxsw_sp_netdevice_port_lower_event() only logs "Failed to reflect link
aggregation lower state change", so the hardware stays in that state until
the next lower state event.

The patch notes say the hardware and the LAG driver are out of sync
"regardless of what the rollback does". In the second case, though, the
rollback turns on tx distribution that neither state wants. The notes are
also not in the commit message or in a code comment.

Could the re-add be skipped when the port was in collection-only state, or
could this limitation be documented in the commit message?

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261118083442.1061289-1-idosch%40nvidia.com

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH net-next 5/6] bonding: 3ad: Advertise Collecting only after collection is enabled
  2026-11-18  8:34 ` [PATCH net-next 5/6] bonding: 3ad: Advertise Collecting only after collection is enabled Ido Schimmel
@ 2026-11-19  9:19   ` netdev-bot+sashiko
  2026-11-19 11:36     ` Ido Schimmel
  0 siblings, 1 reply; 15+ messages in thread
From: netdev-bot+sashiko @ 2026-11-19  9:19 UTC (permalink / raw)
  To: idosch
  Cc: netdev, davem, kuba, pabeni, edumazet, jv, andrew+netdev, petrm,
	sridhar.samudrala, jiri, horms, shuah, linux-kselftest, razor

Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] In __update_lacpdu_from_port() (drivers/net/bonding/bond_3ad.c),
  the patch clears LACP_STATE_COLLECTING in lacpdu->actor_state when…
- [Low] While the Rx notification is pending, procfs ("details actor lacp
  pdu: port state"), sysfs ad_actor_oper_port_state and netlink…
- [Low] __update_lacpdu_from_port() masks only LACP_STATE_COLLECTING
  while the Rx notification is pending.

--

bonding: 3ad: Advertise Collecting only after collection is enabled

When coupled control is disabled, this commit clears the Collecting bit in
transmitted LACPDUs while the port's Rx state change notification is still
pending. Once the notification is delivered, ad_tx_machine() sets ntt so
that a new LACPDU advertising Collecting goes out.

> diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
> index d2a55f4d89791..61f6de803b667 100644
> --- a/drivers/net/bonding/bond_3ad.c
> +++ b/drivers/net/bonding/bond_3ad.c

[ ... ]

> @@ -903,6 +916,9 @@ static inline void __update_lacpdu_from_port(struct port *port)
>  	lacpdu->actor_port_priority = htons(port->actor_port_priority);
>  	lacpdu->actor_port = htons(port->actor_port_number);
>  	lacpdu->actor_state = port->actor_oper_port_state;
> +	/* Collection is only enabled once the Rx state change is notified */
> +	if (__port_rx_notify_pending(port))
> +		lacpdu->actor_state &= ~LACP_STATE_COLLECTING;

[Severity: Low]
This masks only Collecting. Can the transmitted actor_state have
Distributing set while Collecting is cleared?

Suppose rtnl_trylock() fails in bond_3ad_state_machine_handler() at the end
of the run that entered AD_MUX_COLLECTING. Then should_notify_rx stays set.
On the next tick, ad_mux_machine() can move to AD_MUX_DISTRIBUTING based
only on the partner's state:

	case AD_MUX_COLLECTING:
		if (!__port_move_to_attached_state(port)) {
			if ((port->sm_vars & AD_PORT_SELECTED) &&
			    (port->partner_oper.port_state & LACP_STATE_SYNCHRONIZATION) &&
			    (port->partner_oper.port_state & LACP_STATE_COLLECTING)) {
				port->sm_mux_state = AD_MUX_DISTRIBUTING;

Entering that state then does:

	case AD_MUX_DISTRIBUTING:
		port->actor_oper_port_state |= LACP_STATE_DISTRIBUTING;
		port->actor_oper_port_state |= LACP_STATE_SYNCHRONIZATION;
		ad_enable_collecting_distributing(port,
						  update_slave_arr);

As far as I can tell, the __enable_port() path does not clear
should_notify_rx, because the slave's Rx state is already enabled.

Any LACPDU sent before RTNL is obtained, such as the periodic one, would
then carry Distributing=1 and Collecting=0. The 802.1AX mux machine never
produces that combination.

Would it make sense to also mask LACP_STATE_DISTRIBUTING while the
notification is pending?

[Severity: Low]
Only the transmitted copy is masked here. While the notification is
pending, procfs, sysfs and netlink still report port->actor_oper_port_state
with Collecting set. For example, bond_info_show_slave() in bond_procfs.c
does:

	seq_puts(seq, "details actor lacp pdu:\n");
	...
	seq_printf(seq, "    port state: %d\n",
		   port->actor_oper_port_state);

The sysfs ad_actor_oper_port_state file and the netlink
IFLA_BOND_SLAVE_AD_ACTOR_OPER_PORT_STATE attribute are named after
actor_oper_port_state, so they report what their names say. The procfs
block, however, is labelled as the actor LACP PDU, and for a short time it
now shows a different value from the one on the wire.

Is this difference intended? If so, should the procfs label be adjusted or
the difference documented?

Later in this series, "selftests: bonding: Test that Collecting is
advertised after notification" adds test coverage for the transmitted
LACPDU. Its collecting_advertise() captures LACPDUs and checks that
Collecting is only advertised after the 0x1f notification. That test also
suggests the notification is meant to carry the unmasked state.

>  	slave_dbg(port->slave->bond->dev, port->slave->dev,
>  		  "update lacpdu: actor port state %x\n",
>  		  port->actor_oper_port_state);

[Severity: Low]
Should this debug message print lacpdu->actor_state now?

While the Rx notification is pending, the message prints
port->actor_oper_port_state with Collecting set (for example 0x1f). The
LACPDU on the wire carries 0x0f. Before this patch the two values were
always the same.

Printing lacpdu->actor_state, or both values, would keep the message in
line with what is sent.

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261118083442.1061289-1-idosch%40nvidia.com

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH net-next 6/6] selftests: bonding: Test that Collecting is advertised after notification
  2026-11-18  8:34 ` [PATCH net-next 6/6] selftests: bonding: Test that Collecting is advertised after notification Ido Schimmel
@ 2026-11-19  9:19   ` netdev-bot+sashiko
  2026-11-19 10:01     ` Ido Schimmel
  0 siblings, 1 reply; 15+ messages in thread
From: netdev-bot+sashiko @ 2026-11-19  9:19 UTC (permalink / raw)
  To: idosch
  Cc: netdev, davem, kuba, pabeni, edumazet, jv, andrew+netdev, petrm,
	sridhar.samudrala, jiri, horms, shuah, linux-kselftest, razor

Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.

Critical: 0 · High: 0 · Medium: 1 · Low: 0

If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).

- [Medium] collecting_advertise() in tools/testing/selftests/drivers/net/
  bonding/bond_lacp_independent_control.sh can take the wrong…

--

selftests: bonding: Test that Collecting is advertised after notification

This patch adds a collecting_advertise test to
bond_lacp_independent_control.sh. With coupled control disabled, the test
checks that the Collecting bit is only advertised in a transmitted LACPDU
after the Rx state change notification was emitted. It also switches the
partner to a slow LACP rate so that the port is not rate limited when it
enters COLLECTING state.

> diff --git a/tools/testing/selftests/drivers/net/bonding/bond_lacp_independent_control.sh b/tools/testing/selftests/drivers/net/bonding/bond_lacp_independent_control.sh
> index a2b83b581e403..b86f39f31d0c3 100755
> --- a/tools/testing/selftests/drivers/net/bonding/bond_lacp_independent_control.sh
> +++ b/tools/testing/selftests/drivers/net/bonding/bond_lacp_independent_control.sh

[ ... ]

> @@ -162,6 +167,50 @@ collecting_notify()
>  	log_test "Notifications in COLLECTING state"
>  }
>  
> +collecting_advertise()
> +{
> +	local lacpdu_ts notify_ts tmp_dir
> +
> +	RET=0
> +
> +	partner_state_clear 0x18
> +	defer tc filter del dev "$h1" ingress pref 1 handle 101 flower
> +	lacp_state_wait "$h1" 0x0f
> +	check_err $? "Port did not reach ATTACHED state"
> +
> +	tmp_dir=$(mktemp -d)
> +	defer rm -rf "$tmp_dir"
> +	ip -ts -o -d monitor link dev "$h1" > "$tmp_dir"/notify &
> +	defer kill_process $!

[ ... ]

> +	notify_ts=$(grep -m1 -w "ad_actor_oper_port_state $((0x1f))" \
> +		    "$tmp_dir"/notify | sed 's/^\[\([^]]*\)\].*/\1/')
> +	notify_ts=$(date -d "$notify_ts" +%s%6N)
> +	lacpdu_ts=$(head -n1 "$tmp_dir"/lacpdu | cut -d' ' -f1 | tr -d .)
> +	((lacpdu_ts > notify_ts))
> +	check_err $? "Collecting bit advertised before notification"

[Severity: Medium]

Can notify_ts in collecting_advertise() pick up the timestamp of an
unrelated link notification instead of the $h1 one?

The monitor runs as "ip -ts -o -d monitor link dev $h1". In iproute2,
accept_msg() in ipmonitor calls print_headers() for every RTM_NEWLINK.
With -ts, that prints "[<time>] " with no newline.

print_linkinfo() then returns early and prints nothing when
filter.ifindex is set and ifi->ifi_index != filter.ifindex, which is the
case for any device other than $h1. The timestamp of the filtered message
is therefore left at the start of the next printed line.

With -o, the matching line can then look like this:

    [ts_other] [ts_h1] N: $h1: ... ad_actor_oper_port_state 31 ...

The sed above takes the first bracket, ts_other. That timestamp is older
than the real $h1 notification.

Without "bonding: 3ad: Advertise Collecting only after collection is
enabled", the Collecting LACPDU goes out only a short time (at most about
one tick) before the notification. So any RTM_NEWLINK for another device
between the monitor start and the $h1 0x1f notification would make
notify_ts smaller than lacpdu_ts. In that case the check below passes even
though the bug is present:

    ((lacpdu_ts > notify_ts))

That window covers the sleep 1 plus the wait for the partner's next
LACPDU.

The test runs in the init netns, so link events on other host interfaces
can land in that window. Examples are NetworkManager or docker veths,
carrier changes, and IPv6 ifinfo notifications.

One option is to drop the dev filter and grep for the "$h1:" line, so
every printed line has its own timestamp. Another is to take the last
bracketed timestamp on the line instead of the first. Would either of
these make the check more robust?

> +
> +	log_test "Collecting advertised after notification"
> +}

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261118083442.1061289-1-idosch%40nvidia.com

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH net-next 6/6] selftests: bonding: Test that Collecting is advertised after notification
  2026-11-19  9:19   ` netdev-bot+sashiko
@ 2026-11-19 10:01     ` Ido Schimmel
  0 siblings, 0 replies; 15+ messages in thread
From: Ido Schimmel @ 2026-11-19 10:01 UTC (permalink / raw)
  To: netdev-bot+sashiko
  Cc: netdev, davem, kuba, pabeni, edumazet, jv, andrew+netdev, petrm,
	sridhar.samudrala, jiri, horms, shuah, linux-kselftest, razor

tl;dr - I believe the patch is fine as-is.

On Thu, Nov 19, 2026 at 09:19:43AM +0000, netdev-bot+sashiko@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential
> issue(s) to consider.
> 
> Critical: 0 · High: 0 · Medium: 1 · Low: 0
> 
> If you believe none of the issues are legitimate, please reply to each
> issue of Medium severity or higher and explain why the AI is wrong.
> If any of them are legitimate and you plan to respin, please let patchwork
> know by including "pw-bot: cr" as a separate line at the end of your reply
> (one such reply per series is enough).
> 
> - [Medium] collecting_advertise() in tools/testing/selftests/drivers/net/
>   bonding/bond_lacp_independent_control.sh can take the wrong…
> 
> --
> 
> selftests: bonding: Test that Collecting is advertised after notification
> 
> This patch adds a collecting_advertise test to
> bond_lacp_independent_control.sh. With coupled control disabled, the test
> checks that the Collecting bit is only advertised in a transmitted LACPDU
> after the Rx state change notification was emitted. It also switches the
> partner to a slow LACP rate so that the port is not rate limited when it
> enters COLLECTING state.
> 
> > diff --git a/tools/testing/selftests/drivers/net/bonding/bond_lacp_independent_control.sh b/tools/testing/selftests/drivers/net/bonding/bond_lacp_independent_control.sh
> > index a2b83b581e403..b86f39f31d0c3 100755
> > --- a/tools/testing/selftests/drivers/net/bonding/bond_lacp_independent_control.sh
> > +++ b/tools/testing/selftests/drivers/net/bonding/bond_lacp_independent_control.sh
> 
> [ ... ]
> 
> > @@ -162,6 +167,50 @@ collecting_notify()
> >  	log_test "Notifications in COLLECTING state"
> >  }
> >  
> > +collecting_advertise()
> > +{
> > +	local lacpdu_ts notify_ts tmp_dir
> > +
> > +	RET=0
> > +
> > +	partner_state_clear 0x18
> > +	defer tc filter del dev "$h1" ingress pref 1 handle 101 flower
> > +	lacp_state_wait "$h1" 0x0f
> > +	check_err $? "Port did not reach ATTACHED state"
> > +
> > +	tmp_dir=$(mktemp -d)
> > +	defer rm -rf "$tmp_dir"
> > +	ip -ts -o -d monitor link dev "$h1" > "$tmp_dir"/notify &
> > +	defer kill_process $!
> 
> [ ... ]
> 
> > +	notify_ts=$(grep -m1 -w "ad_actor_oper_port_state $((0x1f))" \
> > +		    "$tmp_dir"/notify | sed 's/^\[\([^]]*\)\].*/\1/')
> > +	notify_ts=$(date -d "$notify_ts" +%s%6N)
> > +	lacpdu_ts=$(head -n1 "$tmp_dir"/lacpdu | cut -d' ' -f1 | tr -d .)
> > +	((lacpdu_ts > notify_ts))
> > +	check_err $? "Collecting bit advertised before notification"
> 
> [Severity: Medium]
> 
> Can notify_ts in collecting_advertise() pick up the timestamp of an
> unrelated link notification instead of the $h1 one?
> 
> The monitor runs as "ip -ts -o -d monitor link dev $h1". In iproute2,
> accept_msg() in ipmonitor calls print_headers() for every RTM_NEWLINK.
> With -ts, that prints "[<time>] " with no newline.
> 
> print_linkinfo() then returns early and prints nothing when
> filter.ifindex is set and ifi->ifi_index != filter.ifindex, which is the
> case for any device other than $h1. The timestamp of the filtered message
> is therefore left at the start of the next printed line.
> 
> With -o, the matching line can then look like this:
> 
>     [ts_other] [ts_h1] N: $h1: ... ad_actor_oper_port_state 31 ...

This was fixed over two years ago by iproute2 commit 554ea3649dd1 ("ip:
do not print stray prefixes in monitor mode") in v6.11.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH net-next 3/6] mlxsw: Enable LAG collector independently of distributor
  2026-11-19  9:19   ` netdev-bot+sashiko
@ 2026-11-19 10:28     ` Ido Schimmel
  0 siblings, 0 replies; 15+ messages in thread
From: Ido Schimmel @ 2026-11-19 10:28 UTC (permalink / raw)
  To: netdev-bot+sashiko
  Cc: netdev, davem, kuba, pabeni, edumazet, jv, andrew+netdev, petrm,
	sridhar.samudrala, jiri, horms, shuah, linux-kselftest, razor

tl;dr - I believe the patch is fine as-is.

On Thu, Nov 19, 2026 at 09:19:41AM +0000, netdev-bot+sashiko@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found more severe
> issue(s) in other patches of this series. This mail is only an FYI, in case
> you want to address the nit picks below when you respin.
> 
> Low priority / nit picks for your consideration:
> 
> - [Low] The new collection-only state (SLCOR collector on, port not in
>   the SLDR distributor list), reached through…
> 
> --
> 
> mlxsw: Enable LAG collector independently of distributor
> 
> This patch adds a collection-only state for LAG ports. When rx_enabled is
> set and tx_enabled is not, mlxsw_sp_port_lag_changed() now enables the
> SLCOR collector and removes the port from the SLDR distributor list.
> Without this, a port in COLLECTING state in an 802.3ad bond with coupled
> control disabled did not receive packets.
> 
> > diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
> > index 815e8d8e31856..5a6dc033084d8 100644
> > --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
> > +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
> > @@ -4515,11 +4515,26 @@ mlxsw_sp_port_lag_col_dist_disable(struct mlxsw_sp_port *mlxsw_sp_port)
> >  	return err;
> >  }
> >  
> > +static int mlxsw_sp_port_lag_col_enable(struct mlxsw_sp_port *mlxsw_sp_port)
> > +{
> > +	int err;
> > +
> > +	err = mlxsw_sp_lag_dist_port_remove(mlxsw_sp_port,
> > +					    mlxsw_sp_port->lag_id);
> > +	if (err)
> > +		return err;
> > +
> > +	return mlxsw_sp_lag_col_port_enable(mlxsw_sp_port,
> > +					    mlxsw_sp_port->lag_id);
> > +}
> > +
> >  static int mlxsw_sp_port_lag_changed(struct mlxsw_sp_port *mlxsw_sp_port,
> >  				     struct netdev_lag_lower_state_info *info)
> >  {
> >  	if (info->tx_enabled)
> >  		return mlxsw_sp_port_lag_col_dist_enable(mlxsw_sp_port);
> > +	else if (info->rx_enabled)
> > +		return mlxsw_sp_port_lag_col_enable(mlxsw_sp_port);
> 
> [Severity: Low]
> With the new collection-only state (collector on, port not in the
> distributor list), do the error paths in the two existing helpers still
> do the right thing? Both cases need a register write to fail.
> 
> A move from COLLECTING to COLLECTING_DISTRIBUTING calls
> mlxsw_sp_port_lag_col_dist_enable(). If the SLDR add fails, the error path
> turns off a collector that was already correctly enabled:
> 
> mlxsw_sp_port_lag_col_dist_enable() {
>     ...
> err_dist_port_add:
> 	mlxsw_sp_lag_col_port_disable(mlxsw_sp_port, mlxsw_sp_port->lag_id);
> 	return err;
> }
> 
> Would this drop ingress on a link that both partners negotiated as
> COLLECTING?
> 
> A move from COLLECTING to ATTACHED or DETACHED calls
> mlxsw_sp_port_lag_col_dist_disable(). The SLDR remove succeeds even though
> the port was never in the list. If the SLCOR disable then fails, the error
> path adds the port to the distributor list:
> 
> mlxsw_sp_port_lag_col_dist_disable() {
>     ...
> err_col_port_disable:
> 	mlxsw_sp_lag_dist_port_add(mlxsw_sp_port, mlxsw_sp_port->lag_id);
> 	return err;
> }
> 
> Could the device then hash LAG egress onto a port that LACP never moved to
> DISTRIBUTING, while bonding has tx disabled for it? That state matches
> neither the old LAG state nor the new one.
> 
> mlxsw_sp_netdevice_port_lower_event() only logs "Failed to reflect link
> aggregation lower state change", so the hardware stays in that state until
> the next lower state event.
> 
> The patch notes say the hardware and the LAG driver are out of sync
> "regardless of what the rollback does". In the second case, though, the
> rollback turns on tx distribution that neither state wants. The notes are
> also not in the commit message or in a code comment.
> 
> Could the re-add be skipped when the port was in collection-only state, or
> could this limitation be documented in the commit message?

These registers don't allocate new resources, they don't have a reason
to fail and I've never seen them fail. If they failed, then the system
is in a very bad state where the state of a LAG is largely irrelevant.

I put this info under the '---' because I am trying to keep commit
messages readable for humans and not to overload them with irrelevant
info whose sole purpose is pleasing an LLM.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH net-next 5/6] bonding: 3ad: Advertise Collecting only after collection is enabled
  2026-11-19  9:19   ` netdev-bot+sashiko
@ 2026-11-19 11:36     ` Ido Schimmel
  0 siblings, 0 replies; 15+ messages in thread
From: Ido Schimmel @ 2026-11-19 11:36 UTC (permalink / raw)
  To: netdev-bot+sashiko
  Cc: netdev, davem, kuba, pabeni, edumazet, jv, andrew+netdev, petrm,
	sridhar.samudrala, jiri, horms, shuah, linux-kselftest, razor

tl;dr - I believe the patch is fine as-is.

On Thu, Nov 19, 2026 at 09:19:42AM +0000, netdev-bot+sashiko@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found more severe
> issue(s) in other patches of this series. This mail is only an FYI, in case
> you want to address the nit picks below when you respin.
> 
> Low priority / nit picks for your consideration:
> 
> - [Low] In __update_lacpdu_from_port() (drivers/net/bonding/bond_3ad.c),
>   the patch clears LACP_STATE_COLLECTING in lacpdu->actor_state when…
> - [Low] While the Rx notification is pending, procfs ("details actor lacp
>   pdu: port state"), sysfs ad_actor_oper_port_state and netlink…
> - [Low] __update_lacpdu_from_port() masks only LACP_STATE_COLLECTING
>   while the Rx notification is pending.
> 
> --
> 
> bonding: 3ad: Advertise Collecting only after collection is enabled
> 
> When coupled control is disabled, this commit clears the Collecting bit in
> transmitted LACPDUs while the port's Rx state change notification is still
> pending. Once the notification is delivered, ad_tx_machine() sets ntt so
> that a new LACPDU advertising Collecting goes out.
> 
> > diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
> > index d2a55f4d89791..61f6de803b667 100644
> > --- a/drivers/net/bonding/bond_3ad.c
> > +++ b/drivers/net/bonding/bond_3ad.c
> 
> [ ... ]
> 
> > @@ -903,6 +916,9 @@ static inline void __update_lacpdu_from_port(struct port *port)
> >  	lacpdu->actor_port_priority = htons(port->actor_port_priority);
> >  	lacpdu->actor_port = htons(port->actor_port_number);
> >  	lacpdu->actor_state = port->actor_oper_port_state;
> > +	/* Collection is only enabled once the Rx state change is notified */
> > +	if (__port_rx_notify_pending(port))
> > +		lacpdu->actor_state &= ~LACP_STATE_COLLECTING;
> 
> [Severity: Low]
> This masks only Collecting. Can the transmitted actor_state have
> Distributing set while Collecting is cleared?
> 
> Suppose rtnl_trylock() fails in bond_3ad_state_machine_handler() at the end
> of the run that entered AD_MUX_COLLECTING. Then should_notify_rx stays set.
> On the next tick, ad_mux_machine() can move to AD_MUX_DISTRIBUTING based
> only on the partner's state:
> 
> 	case AD_MUX_COLLECTING:
> 		if (!__port_move_to_attached_state(port)) {
> 			if ((port->sm_vars & AD_PORT_SELECTED) &&
> 			    (port->partner_oper.port_state & LACP_STATE_SYNCHRONIZATION) &&
> 			    (port->partner_oper.port_state & LACP_STATE_COLLECTING)) {
> 				port->sm_mux_state = AD_MUX_DISTRIBUTING;
> 
> Entering that state then does:
> 
> 	case AD_MUX_DISTRIBUTING:
> 		port->actor_oper_port_state |= LACP_STATE_DISTRIBUTING;
> 		port->actor_oper_port_state |= LACP_STATE_SYNCHRONIZATION;
> 		ad_enable_collecting_distributing(port,
> 						  update_slave_arr);
> 
> As far as I can tell, the __enable_port() path does not clear
> should_notify_rx, because the slave's Rx state is already enabled.
> 
> Any LACPDU sent before RTNL is obtained, such as the periodic one, would
> then carry Distributing=1 and Collecting=0. The 802.1AX mux machine never
> produces that combination.
> 
> Would it make sense to also mask LACP_STATE_DISTRIBUTING while the
> notification is pending?

Looking at 802.1AX, I can't find where it says that transmitting
"Distributing=1 and Collecting=0" is invalid and it also shouldn't
matter for our partner because the partner never looks at our
Distributing bit. It's only looking at our Synchronization and
Collecting bits and the latter is correctly turned off until collection
is enabled in both software and hardware, which is what matters here.

And I don't think that it makes sense to mask LACP_STATE_DISTRIBUTING in
our LACPDUs when in practice the port is already transmitting (from the
software data path, not the hardware data path).

If anything, it makes more sense to keep the mux machine at
AD_MUX_COLLECTING when the Rx notification is still pending, but I don't
understand what it buys us and I would rather follow up on this than
send the entire series again.

> 
> [Severity: Low]
> Only the transmitted copy is masked here. While the notification is
> pending, procfs, sysfs and netlink still report port->actor_oper_port_state
> with Collecting set. For example, bond_info_show_slave() in bond_procfs.c
> does:
> 
> 	seq_puts(seq, "details actor lacp pdu:\n");
> 	...
> 	seq_printf(seq, "    port state: %d\n",
> 		   port->actor_oper_port_state);
> 
> The sysfs ad_actor_oper_port_state file and the netlink
> IFLA_BOND_SLAVE_AD_ACTOR_OPER_PORT_STATE attribute are named after
> actor_oper_port_state, so they report what their names say. The procfs
> block, however, is labelled as the actor LACP PDU, and for a short time it
> now shows a different value from the one on the wire.

This could happen even before the patch. LACPDUs are sent at a rate of
at most three per second. First the actor state changes and only later
it's visible on the wire.

> 
> Is this difference intended? If so, should the procfs label be adjusted or
> the difference documented?

No, it shouldn't be adjusted. It always reported the actor state rather
than what was encoded in the State byte of the last LACPDU.

> 
> Later in this series, "selftests: bonding: Test that Collecting is
> advertised after notification" adds test coverage for the transmitted
> LACPDU. Its collecting_advertise() captures LACPDUs and checks that
> Collecting is only advertised after the 0x1f notification. That test also
> suggests the notification is meant to carry the unmasked state.
> 
> >  	slave_dbg(port->slave->bond->dev, port->slave->dev,
> >  		  "update lacpdu: actor port state %x\n",
> >  		  port->actor_oper_port_state);
> 
> [Severity: Low]
> Should this debug message print lacpdu->actor_state now?
> 
> While the Rx notification is pending, the message prints
> port->actor_oper_port_state with Collecting set (for example 0x1f). The
> LACPDU on the wire carries 0x0f. Before this patch the two values were
> always the same.
> 
> Printing lacpdu->actor_state, or both values, would keep the message in
> line with what is sent.

The message prints the port's state, as it did before this patch. The
difference is transient and only happens when coupled control is
disabled, so I don't think it's worth changing.

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2026-11-19 11:37 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-18  8:34 [PATCH net-next 0/6] bonding: 3ad: Support independent control with LAG offload Ido Schimmel
2026-11-18  8:34 ` [PATCH net-next 1/6] net: Add Rx enabled state to LAG lower state information Ido Schimmel
2026-11-18  8:34 ` [PATCH net-next 2/6] bonding: 3ad: Notify Rx state changes Ido Schimmel
2026-11-18 20:00   ` Jay Vosburgh
2026-11-19  9:03     ` Ido Schimmel
2026-11-18  8:34 ` [PATCH net-next 3/6] mlxsw: Enable LAG collector independently of distributor Ido Schimmel
2026-11-19  9:19   ` netdev-bot+sashiko
2026-11-19 10:28     ` Ido Schimmel
2026-11-18  8:34 ` [PATCH net-next 4/6] selftests: bonding: Test notifications in COLLECTING state Ido Schimmel
2026-11-18  8:34 ` [PATCH net-next 5/6] bonding: 3ad: Advertise Collecting only after collection is enabled Ido Schimmel
2026-11-19  9:19   ` netdev-bot+sashiko
2026-11-19 11:36     ` Ido Schimmel
2026-11-18  8:34 ` [PATCH net-next 6/6] selftests: bonding: Test that Collecting is advertised after notification Ido Schimmel
2026-11-19  9:19   ` netdev-bot+sashiko
2026-11-19 10:01     ` Ido Schimmel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox