🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.netdev
1 messages
1 total messages Started by netdev-bot+sashiko Thu, 19 Nov 2026 09:19
Re: [PATCH net-next 3/6] mlxsw: Enable LAG collector independently of distributor
#19063
Author: netdev-bot+sashiko
Date: Thu, 19 Nov 2026 09:19
98 lines
11632 bytes
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
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads