diff mbox series

[net-next,RFC,5/8] mlxsw: Remove ndo_get_port_parent_id implementation

Message ID 20190301160542.6474-6-jiri@resnulli.us
State RFC
Delegated to: David Miller
Headers show
Series net: expose switch ID via devlink | expand

Commit Message

Jiri Pirko March 1, 2019, 4:05 p.m. UTC
From: Jiri Pirko <jiri@mellanox.com>

Remove implementation of get_port_parent_id ndo and rely on core calling
into devlink for the information directly.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 13 -------------
 drivers/net/ethernet/mellanox/mlxsw/switchx2.c | 13 -------------
 2 files changed, 26 deletions(-)

Comments

Florian Fainelli March 2, 2019, 2:57 a.m. UTC | #1
On 3/1/2019 8:05 AM, Jiri Pirko wrote:
> From: Jiri Pirko <jiri@mellanox.com>
> 
> Remove implementation of get_port_parent_id ndo and rely on core calling
> into devlink for the information directly.
> 
> Signed-off-by: Jiri Pirko <jiri@mellanox.com>

Don't you need a select/depends on DEVLINK for MLXSW_SWITCHX2 and
MLXSW_SPECTRUM otherwise you are going to get unexpected results from
net/bridge/br_switchdev.c while computing the offload_fwd_mark?
Jiri Pirko March 2, 2019, 7:36 a.m. UTC | #2
Sat, Mar 02, 2019 at 03:57:07AM CET, f.fainelli@gmail.com wrote:
>
>
>On 3/1/2019 8:05 AM, Jiri Pirko wrote:
>> From: Jiri Pirko <jiri@mellanox.com>
>> 
>> Remove implementation of get_port_parent_id ndo and rely on core calling
>> into devlink for the information directly.
>> 
>> Signed-off-by: Jiri Pirko <jiri@mellanox.com>
>
>Don't you need a select/depends on DEVLINK for MLXSW_SWITCHX2 and
>MLXSW_SPECTRUM otherwise you are going to get unexpected results from
>net/bridge/br_switchdev.c while computing the offload_fwd_mark?

You are probably right. That is what we loose after move to
devlink-buildin. I think that every driver using devlink should enforce
devlink=y

>-- 
>Florian
diff mbox series

Patch

diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
index 75c5b8f65912..f277c0eb6fc8 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
@@ -1703,18 +1703,6 @@  static int mlxsw_sp_set_features(struct net_device *dev,
 				       mlxsw_sp_feature_hw_tc);
 }
 
-static int mlxsw_sp_port_get_port_parent_id(struct net_device *dev,
-					    struct netdev_phys_item_id *ppid)
-{
-	struct mlxsw_sp_port *mlxsw_sp_port = netdev_priv(dev);
-	struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp;
-
-	ppid->id_len = sizeof(mlxsw_sp->base_mac);
-	memcpy(&ppid->id, &mlxsw_sp->base_mac, ppid->id_len);
-
-	return 0;
-}
-
 static struct devlink_port *
 mlxsw_sp_port_get_devlink_port(struct net_device *dev)
 {
@@ -1739,7 +1727,6 @@  static const struct net_device_ops mlxsw_sp_port_netdev_ops = {
 	.ndo_vlan_rx_add_vid	= mlxsw_sp_port_add_vid,
 	.ndo_vlan_rx_kill_vid	= mlxsw_sp_port_kill_vid,
 	.ndo_set_features	= mlxsw_sp_set_features,
-	.ndo_get_port_parent_id	= mlxsw_sp_port_get_port_parent_id,
 	.ndo_get_devlink_port	= mlxsw_sp_port_get_devlink_port,
 };
 
diff --git a/drivers/net/ethernet/mellanox/mlxsw/switchx2.c b/drivers/net/ethernet/mellanox/mlxsw/switchx2.c
index e6c7bf78f245..db54335032b4 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/switchx2.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/switchx2.c
@@ -379,25 +379,12 @@  mlxsw_sx_port_get_stats64(struct net_device *dev,
 	stats->tx_dropped	= tx_dropped;
 }
 
-static int mlxsw_sx_port_get_port_parent_id(struct net_device *dev,
-					    struct netdev_phys_item_id *ppid)
-{
-	struct mlxsw_sx_port *mlxsw_sx_port = netdev_priv(dev);
-	struct mlxsw_sx *mlxsw_sx = mlxsw_sx_port->mlxsw_sx;
-
-	ppid->id_len = sizeof(mlxsw_sx->hw_id);
-	memcpy(&ppid->id, &mlxsw_sx->hw_id, ppid->id_len);
-
-	return 0;
-}
-
 static const struct net_device_ops mlxsw_sx_port_netdev_ops = {
 	.ndo_open		= mlxsw_sx_port_open,
 	.ndo_stop		= mlxsw_sx_port_stop,
 	.ndo_start_xmit		= mlxsw_sx_port_xmit,
 	.ndo_change_mtu		= mlxsw_sx_port_change_mtu,
 	.ndo_get_stats64	= mlxsw_sx_port_get_stats64,
-	.ndo_get_port_parent_id	= mlxsw_sx_port_get_port_parent_id,
 };
 
 static void mlxsw_sx_port_get_drvinfo(struct net_device *dev,