mlxsw: Disable LAG collector when requested

Started by Ido Schimmel on Nov 11, 2026 · 3 messages from 3 authors · Last reply Nov 12, 2026

Subsystems (3)

Maintainers (8)

Show 4 more
WARM1d IN NET-NEXT · 1 review, 1 by a maintainer

Status: Queued in net-next as 073d54dc3ccc on 2026-11-12.

1 review trailer (1 from subsystem maintainers).

open the first message on its own page

Message details and related content
mlxsw_reg_slcor_col_disable_pack() packs the "collector enabled" value
instead of "collector disabled". As a result, once a LAG port is enabled
for collection, it keeps receiving packets even after the LAG master
disables it (e.g., when the port loses link or the LACP partner falls
out of sync).

Fix by packing the correct value. Packets received on a disabled LAG
port are now dropped, as they are in the bond's software datapath.

Note that this does not fix a regression (always broken). Noticed this
while working on independent control support. See commit 240fd405528b
("bonding: Add independent control state machine").

Reviewed-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
---
 drivers/net/ethernet/mellanox/mlxsw/reg.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/mellanox/mlxsw/reg.h b/drivers/net/ethernet/mellanox/mlxsw/reg.h
index 01fcbd1c8d01..9dbeabf5536d 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/reg.h
+++ b/drivers/net/ethernet/mellanox/mlxsw/reg.h
@@ -1491,7 +1491,7 @@ static inline void mlxsw_reg_slcor_col_disable_pack(char *payload,
 						    u16 local_port, u16 lag_id)
 {
 	mlxsw_reg_slcor_pack(payload, local_port, lag_id,
-			     MLXSW_REG_SLCOR_COL_LAG_COLLECTOR_ENABLED);
+			     MLXSW_REG_SLCOR_COL_LAG_COLLECTOR_DISABLED);
 }
 
 /* SPMLR - Switch Port MAC Learning Register
-- 
2.56.0
Message details and related content
Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider.

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

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] Before this patch, mlxsw_reg_slcor_col_disable_pack() did
  nothing in practice.
- [Low] mlxsw: missing Fixes trailer for
  mlxsw_reg_slcor_col_disable_pack() bug fix

--

mlxsw: Disable LAG collector when requested

This commit changes mlxsw_reg_slcor_col_disable_pack() so that it packs
MLXSW_REG_SLCOR_COL_LAG_COLLECTOR_DISABLED instead of the "collector
enabled" value. A collector disable request now takes effect in the ASIC,
and packets received on a disabled LAG port are dropped in hardware.
quoted hunk
diff --git a/drivers/net/ethernet/mellanox/mlxsw/reg.h b/drivers/net/ethernet/mellanox/mlxsw/reg.h
index 01fcbd1c8d015..9dbeabf5536d1 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/reg.h
+++ b/drivers/net/ethernet/mellanox/mlxsw/reg.h
@@ -1491,7 +1491,7 @@ static inline void mlxsw_reg_slcor_col_disable_pack(char *payload,
 						    u16 local_port, u16 lag_id)
 {
 	mlxsw_reg_slcor_pack(payload, local_port, lag_id,
-			     MLXSW_REG_SLCOR_COL_LAG_COLLECTOR_ENABLED);
+			     MLXSW_REG_SLCOR_COL_LAG_COLLECTOR_DISABLED);
 }
[Severity: Low]
This fixes a real bug in mlxsw_reg_slcor_col_disable_pack(), but the
commit message has no Fixes: trailer. As far as I can tell the helper
has packed MLXSW_REG_SLCOR_COL_LAG_COLLECTOR_ENABLED since it was added
in commit d1d40be084c6 ("mlxsw: reg: Add link aggregation configuration
registers definitions"). The LAG code in spectrum.c has used it to
disable collection since commit 0d65fc13042f ("mlxsw: spectrum:
Implement LAG port join/leave").

The commit message says this is not a regression, and the patch is
aimed at net-next, so leaving the tag out may be deliberate. Without
it, though, stable tooling has nothing pointing at where the bug came
from. The same goes for anyone bisecting LAG ingress behaviour on
Spectrum.

Should this carry a Fixes: tag against d1d40be084c6? If the intent is
to keep it out of stable because it changes ingress behaviour on
existing LAG setups, could the commit message say so explicitly?

[Severity: Medium]

Now that this write takes effect, can mlxsw turn off the hardware
collector on an 802.3ad port that the bond still treats as collecting?

In drivers/net/ethernet/mellanox/mlxsw/spectrum.c, one tx_enabled bit
controls both the distributor and the collector:

mlxsw_sp_port_lag_changed() {
	if (info->tx_enabled)
		return mlxsw_sp_port_lag_col_dist_enable(mlxsw_sp_port);
	else
		return mlxsw_sp_port_lag_col_dist_disable(mlxsw_sp_port);
}

That bit comes from bond_lower_state_changed(), which only reports
whether the port is distributing:

	info.tx_enabled = bond_is_active_slave(slave);

57 more lines

Message details and related content
Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski [off-list ref]:

On Wed, 11 Nov 2026 19:09:25 +0200 you wrote:
mlxsw_reg_slcor_col_disable_pack() packs the "collector enabled" value
instead of "collector disabled". As a result, once a LAG port is enabled
for collection, it keeps receiving packets even after the LAG master
disables it (e.g., when the port loses link or the LACP partner falls
out of sync).

Fix by packing the correct value. Packets received on a disabled LAG
port are now dropped, as they are in the bond's software datapath.

[...]
Here is the summary with links:
  - [net-next] mlxsw: Disable LAG collector when requested
    https://git.kernel.org/netdev/net-next/c/073d54dc3ccc

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 / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help