Netdev List
 help / color / mirror / Atom feed
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 1/6] net: Add Rx enabled state to LAG lower state information
Date: Wed, 18 Nov 2026 10:34:37 +0200	[thread overview]
Message-ID: <20261118083442.1061289-2-idosch@nvidia.com> (raw)
In-Reply-To: <20261118083442.1061289-1-idosch@nvidia.com>

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


  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 ` Ido Schimmel [this message]
2026-11-18  8:34 ` [PATCH net-next 2/6] bonding: 3ad: Notify Rx state changes Ido Schimmel
2026-11-18  8:34 ` [PATCH net-next 3/6] mlxsw: Enable LAG collector independently of distributor 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-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-2-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