netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Pirko <jiri@resnulli.us>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, idosch@mellanox.com, arkadis@mellanox.com,
	mlxsw@mellanox.com, roopa@cumulusnetworks.com,
	stephen@networkplumber.org, ivecera@redhat.com
Subject: [patch net-next 10/19] mlxsw: spectrum_switchdev: Change switchdev notifier API
Date: Mon,  5 Jun 2017 11:20:34 +0200	[thread overview]
Message-ID: <20170605092043.3523-11-jiri@resnulli.us> (raw)
In-Reply-To: <20170605092043.3523-1-jiri@resnulli.us>

From: Arkadi Sharshevsky <arkadis@mellanox.com>

The current API for sending switchdev notifications implies only FDB
add/del. In order to support notification about successful FDB offload
the API is changed.

Signed-off-by: Arkadi Sharshevsky <arkadis@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
 .../net/ethernet/mellanox/mlxsw/spectrum_switchdev.c  | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c
index 6257b0b..0b50d1d 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c
@@ -1819,17 +1819,16 @@ void mlxsw_sp_port_bridge_leave(struct mlxsw_sp_port *mlxsw_sp_port,
 	mlxsw_sp_bridge_port_put(mlxsw_sp->bridge, bridge_port);
 }
 
-static void mlxsw_sp_fdb_call_notifiers(bool adding,
-					char *mac, u16 vid,
-					struct net_device *dev)
+static void
+mlxsw_sp_fdb_call_notifiers(enum switchdev_notifier_type type,
+			    const char *mac, u16 vid,
+			    struct net_device *dev)
 {
 	struct switchdev_notifier_fdb_info info;
-	unsigned long notifier_type;
 
 	info.addr = mac;
 	info.vid = vid;
-	notifier_type = adding ? SWITCHDEV_FDB_ADD_TO_BRIDGE : SWITCHDEV_FDB_DEL_TO_BRIDGE;
-	call_switchdev_notifiers(notifier_type, dev, &info.info);
+	call_switchdev_notifiers(type, dev, &info.info);
 }
 
 static void mlxsw_sp_fdb_notify_mac_process(struct mlxsw_sp *mlxsw_sp,
@@ -1840,6 +1839,7 @@ static void mlxsw_sp_fdb_notify_mac_process(struct mlxsw_sp *mlxsw_sp,
 	struct mlxsw_sp_bridge_device *bridge_device;
 	struct mlxsw_sp_bridge_port *bridge_port;
 	struct mlxsw_sp_port *mlxsw_sp_port;
+	enum switchdev_notifier_type type;
 	char mac[ETH_ALEN];
 	u8 local_port;
 	u16 vid, fid;
@@ -1878,7 +1878,8 @@ static void mlxsw_sp_fdb_notify_mac_process(struct mlxsw_sp *mlxsw_sp,
 
 	if (!do_notification)
 		return;
-	mlxsw_sp_fdb_call_notifiers(adding, mac, vid, bridge_port->dev);
+	type = adding ? SWITCHDEV_FDB_ADD_TO_BRIDGE : SWITCHDEV_FDB_DEL_TO_BRIDGE;
+	mlxsw_sp_fdb_call_notifiers(type, mac, vid, bridge_port->dev);
 
 	return;
 
@@ -1896,6 +1897,7 @@ static void mlxsw_sp_fdb_notify_mac_lag_process(struct mlxsw_sp *mlxsw_sp,
 	struct mlxsw_sp_bridge_device *bridge_device;
 	struct mlxsw_sp_bridge_port *bridge_port;
 	struct mlxsw_sp_port *mlxsw_sp_port;
+	enum switchdev_notifier_type type;
 	char mac[ETH_ALEN];
 	u16 lag_vid = 0;
 	u16 lag_id;
@@ -1936,7 +1938,8 @@ static void mlxsw_sp_fdb_notify_mac_lag_process(struct mlxsw_sp *mlxsw_sp,
 
 	if (!do_notification)
 		return;
-	mlxsw_sp_fdb_call_notifiers(adding, mac, vid, bridge_port->dev);
+	type = adding ? SWITCHDEV_FDB_ADD_TO_BRIDGE : SWITCHDEV_FDB_DEL_TO_BRIDGE;
+	mlxsw_sp_fdb_call_notifiers(type, mac, vid, bridge_port->dev);
 
 	return;
 
-- 
2.9.3

  parent reply	other threads:[~2017-06-05  9:20 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-05  9:20 [patch net-next 00/19] Remove support from bridge bypass for mlxsw/rocker drivers Jiri Pirko
2017-06-05  9:20 ` [patch net-next 01/19] net: switchdev: Add support for querying supported bridge flags by hardware Jiri Pirko
2017-06-05 14:00   ` Ivan Vecera
2017-06-05  9:20 ` [patch net-next 02/19] net: bridge: Add support for offloading port attributes Jiri Pirko
2017-06-05 13:29   ` Nikolay Aleksandrov
2017-06-06 13:08     ` Arkadi Sharshevsky
2017-06-05  9:20 ` [patch net-next 03/19] net: bridge: Add support for calling FDB external learning under rcu Jiri Pirko
2017-06-05 13:36   ` Nikolay Aleksandrov
2017-06-05  9:20 ` [patch net-next 04/19] net: switchdev: Change notifier chain to be atomic Jiri Pirko
2017-06-05 13:59   ` Ivan Vecera
2017-06-05  9:20 ` [patch net-next 05/19] net: bridge: Add support for notifying devices about FDB add/del Jiri Pirko
2017-06-05 13:35   ` Nikolay Aleksandrov
2017-06-06 14:19     ` Arkadi Sharshevsky
2017-06-05  9:20 ` [patch net-next 06/19] net: bridge: Receive notification about successful FDB offload Jiri Pirko
2017-06-05 13:44   ` Nikolay Aleksandrov
2017-06-05  9:20 ` [patch net-next 07/19] mlxsw: spectrum: Remove support for bridge FDB learning sync Jiri Pirko
2017-06-05  9:20 ` [patch net-next 08/19] mlxsw: spectrum_switchdev: Add support for querying supported bridge flags Jiri Pirko
2017-06-05  9:20 ` [patch net-next 09/19] mlxsw: spectrum: Remove support for bypass bridge port attributes/vlan set Jiri Pirko
2017-06-05  9:20 ` Jiri Pirko [this message]
2017-06-05  9:20 ` [patch net-next 11/19] mlxsw: spectrum_switchdev: Add support for learning FDB through notification Jiri Pirko
2017-06-05  9:20 ` [patch net-next 12/19] mlxsw: spectrum: Remove support for bridge bypass FDB add/del Jiri Pirko
2017-06-05  9:20 ` [patch net-next 13/19] net: Remove support for bridge bypass ndos from stacked devices Jiri Pirko
2017-06-05  9:20 ` [patch net-next 14/19] rocker: Remove support for bridge FDB learning sync Jiri Pirko
2017-06-05  9:20 ` [patch net-next 15/19] rocker: Add support for querying supported bridge flags Jiri Pirko
2017-06-05  9:20 ` [patch net-next 16/19] rocker: Change world_ops API and implementation to be switchdev independant Jiri Pirko
2017-06-05  9:20 ` [patch net-next 17/19] rocker: Add support for learning FDB through notification Jiri Pirko
2017-06-05  9:20 ` [patch net-next 18/19] rocker: Remove support for bypass bridge port attributes/vlan set Jiri Pirko
2017-06-05  9:20 ` [patch net-next 19/19] rocker: Remove support bridge bypass FDB Jiri Pirko
2017-06-05 10:07 ` [patch iproute2] bridge: Distinguish between externally learned vs offloaded FDBs Jiri Pirko
2017-06-14 16:52   ` Stephen Hemminger

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=20170605092043.3523-11-jiri@resnulli.us \
    --to=jiri@resnulli.us \
    --cc=arkadis@mellanox.com \
    --cc=davem@davemloft.net \
    --cc=idosch@mellanox.com \
    --cc=ivecera@redhat.com \
    --cc=mlxsw@mellanox.com \
    --cc=netdev@vger.kernel.org \
    --cc=roopa@cumulusnetworks.com \
    --cc=stephen@networkplumber.org \
    /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;
as well as URLs for NNTP newsgroup(s).