From: Ido Schimmel <idosch@nvidia.com>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com,
edumazet@kernel.org, jv@jvosburgh.net, andrew+netdev@lunn.ch,
petrm@nvidia.com, sridhar.samudrala@intel.com, jiri@resnulli.us,
horms@kernel.org, shuah@kernel.org,
linux-kselftest@vger.kernel.org, razor@blackwall.org,
Ido Schimmel <idosch@nvidia.com>
Subject: [PATCH net-next 3/6] mlxsw: Enable LAG collector independently of distributor
Date: Wed, 18 Nov 2026 10:34:39 +0200 [thread overview]
Message-ID: <20261118083442.1061289-4-idosch@nvidia.com> (raw)
In-Reply-To: <20261118083442.1061289-1-idosch@nvidia.com>
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
next prev parent reply other threads:[~2026-11-18 8:36 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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-18 8:34 ` [PATCH net-next 6/6] selftests: bonding: Test that Collecting is advertised after notification Ido Schimmel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261118083442.1061289-4-idosch@nvidia.com \
--to=idosch@nvidia.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=jiri@resnulli.us \
--cc=jv@jvosburgh.net \
--cc=kuba@kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=petrm@nvidia.com \
--cc=razor@blackwall.org \
--cc=shuah@kernel.org \
--cc=sridhar.samudrala@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox