public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Jiri Pirko <jiri@resnulli.us>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, idosch@mellanox.com, eladr@mellanox.com,
	yotamg@mellanox.com, ogerlitz@mellanox.com, j.vosburgh@gmail.com,
	vfalico@gmail.com, gospo@cumulusnetworks.com,
	dsa@cumulusnetworks.com, nikolay@cumulusnetworks.com,
	pjonnala@broadcom.com, f.fainelli@gmail.com, sfeldma@gmail.com,
	john.fastabend@gmail.com, roopa@cumulusnetworks.com,
	andrew@lunn.ch
Subject: [patch net-next v3 16/28] team: implement lower state change propagation
Date: Thu,  3 Dec 2015 12:12:18 +0100	[thread overview]
Message-ID: <1449141150-8172-17-git-send-email-jiri@resnulli.us> (raw)
In-Reply-To: <1449141150-8172-1-git-send-email-jiri@resnulli.us>

From: Jiri Pirko <jiri@mellanox.com>

Let netdev notifier listeners know about link-up and port-enable state
changes.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
 drivers/net/team/team.c | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c
index 9814133..059c0f6 100644
--- a/drivers/net/team/team.c
+++ b/drivers/net/team/team.c
@@ -91,10 +91,24 @@ void team_modeop_port_change_dev_addr(struct team *team,
 }
 EXPORT_SYMBOL(team_modeop_port_change_dev_addr);
 
+static void team_lower_state_changed(struct team_port *port)
+{
+	struct netdev_lag_lower_state_info info;
+
+	info.link_up = port->linkup;
+	info.tx_enabled = team_port_enabled(port);
+	netdev_lower_state_changed(port->dev, &info);
+}
+
 static void team_refresh_port_linkup(struct team_port *port)
 {
-	port->linkup = port->user.linkup_enabled ? port->user.linkup :
-						   port->state.linkup;
+	bool new_linkup = port->user.linkup_enabled ? port->user.linkup :
+						      port->state.linkup;
+
+	if (port->linkup != new_linkup) {
+		port->linkup = new_linkup;
+		team_lower_state_changed(port);
+	}
 }
 
 
@@ -932,6 +946,7 @@ static void team_port_enable(struct team *team,
 		team->ops.port_enabled(team, port);
 	team_notify_peers(team);
 	team_mcast_rejoin(team);
+	team_lower_state_changed(port);
 }
 
 static void __reconstruct_port_hlist(struct team *team, int rm_index)
@@ -963,6 +978,7 @@ static void team_port_disable(struct team *team,
 	team_adjust_ops(team);
 	team_notify_peers(team);
 	team_mcast_rejoin(team);
+	team_lower_state_changed(port);
 }
 
 #define TEAM_VLAN_FEATURES (NETIF_F_ALL_CSUM | NETIF_F_SG | \
-- 
1.9.3

  parent reply	other threads:[~2015-12-03 11:12 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-03 11:12 [patch net-next v3 00/28] bonding/team offload + mlxsw implementation Jiri Pirko
2015-12-03 11:12 ` [patch net-next v3 01/28] net: Check CHANGEUPPER notifier return value Jiri Pirko
2015-12-03 11:12 ` [patch net-next v3 02/28] net: Add support for CHANGEUPPER notifier error injection Jiri Pirko
2015-12-03 11:12 ` [patch net-next v3 03/28] bonding: add 802.3ad support for 100G speeds Jiri Pirko
2015-12-03 11:12 ` [patch net-next v3 04/28] net: add netif_is_team_master helper Jiri Pirko
2015-12-03 12:46   ` Eric Dumazet
2015-12-03 13:49     ` Jiri Pirko
2015-12-03 11:12 ` [patch net-next v3 05/28] net: add netif_is_team_port helper Jiri Pirko
2015-12-03 11:12 ` [patch net-next v3 06/28] net: add netif_is_lag_master helper Jiri Pirko
2015-12-03 11:12 ` [patch net-next v3 07/28] net: add netif_is_lag_port helper Jiri Pirko
2015-12-03 11:12 ` [patch net-next v3 08/28] net: propagate upper priv via netdev_master_upper_dev_link Jiri Pirko
2015-12-03 11:12 ` [patch net-next v3 09/28] net: add possibility to pass information about upper device via notifier Jiri Pirko
2015-12-03 11:12 ` [patch net-next v3 10/28] net: add info struct for LAG changeupper Jiri Pirko
2015-12-03 11:12 ` [patch net-next v3 11/28] team: fill-up LAG changeupper info struct and pass it along Jiri Pirko
2015-12-03 11:12 ` [patch net-next v3 12/28] bonding: " Jiri Pirko
2015-12-03 11:12 ` [patch net-next v3 13/28] net: introduce change lower state notifier Jiri Pirko
2015-12-03 11:12 ` [patch net-next v3 14/28] net: introduce lower state changed info structure for LAG lowers Jiri Pirko
2015-12-03 11:12 ` [patch net-next v3 15/28] team: rtnl_lock for options set Jiri Pirko
2015-12-03 11:12 ` Jiri Pirko [this message]
2015-12-03 11:12 ` [patch net-next v3 17/28] bonding: allow notifications for bond_set_slave_link_state Jiri Pirko
2015-12-03 11:12 ` [patch net-next v3 18/28] bonding: implement lower state change propagation Jiri Pirko
2015-12-03 11:12 ` [patch net-next v3 19/28] bonding: set inactive flags on release Jiri Pirko
2015-12-03 11:12 ` [patch net-next v3 20/28] mlxsw: spectrum: Add set_rx_mode ndo stub Jiri Pirko
2015-12-03 11:12 ` [patch net-next v3 21/28] mlxsw: core: Add support for packets received from LAG port Jiri Pirko
2015-12-03 11:12 ` [patch net-next v3 22/28] mlxsw: pci: Implement LAG processing for received packets Jiri Pirko
2015-12-03 11:12 ` [patch net-next v3 23/28] mlxsw: reg: Add link aggregation configuration registers definitions Jiri Pirko
2015-12-03 11:12 ` [patch net-next v3 24/28] mlxsw: reg: Add definition of LAG unicast record for SFD register Jiri Pirko
2015-12-03 11:12 ` [patch net-next v3 25/28] mlxsw: reg: Add definition of LAG unicast record for SFN register Jiri Pirko
2015-12-03 11:12 ` [patch net-next v3 26/28] mlxsw: spectrum: Implement LAG port join/leave Jiri Pirko
2015-12-03 11:12 ` [patch net-next v3 27/28] mlxsw: spectrum: Implement FDB add/remove/dump for LAG Jiri Pirko
2015-12-03 11:12 ` [patch net-next v3 28/28] mlxsw: spectrum: Implement LAG tx enabled lower state change Jiri Pirko
2015-12-03 16:51 ` [patch net-next v3 00/28] bonding/team offload + mlxsw implementation David Miller
2015-12-03 16:54   ` Jiri Pirko

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=1449141150-8172-17-git-send-email-jiri@resnulli.us \
    --to=jiri@resnulli.us \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=dsa@cumulusnetworks.com \
    --cc=eladr@mellanox.com \
    --cc=f.fainelli@gmail.com \
    --cc=gospo@cumulusnetworks.com \
    --cc=idosch@mellanox.com \
    --cc=j.vosburgh@gmail.com \
    --cc=john.fastabend@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=nikolay@cumulusnetworks.com \
    --cc=ogerlitz@mellanox.com \
    --cc=pjonnala@broadcom.com \
    --cc=roopa@cumulusnetworks.com \
    --cc=sfeldma@gmail.com \
    --cc=vfalico@gmail.com \
    --cc=yotamg@mellanox.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