mlxsw: Remove ndo_get_phys_port_name implementation
Rely on the previously introduced fallback and let the core call devlink directly in order to get the physical port name. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
011d325602
commit
59a6b35a1c
@ -1796,16 +1796,6 @@ enum devlink_port_type mlxsw_core_port_type_get(struct mlxsw_core *mlxsw_core,
|
||||
}
|
||||
EXPORT_SYMBOL(mlxsw_core_port_type_get);
|
||||
|
||||
int mlxsw_core_port_get_phys_port_name(struct mlxsw_core *mlxsw_core,
|
||||
u8 local_port, char *name, size_t len)
|
||||
{
|
||||
struct mlxsw_core_port *mlxsw_core_port =
|
||||
&mlxsw_core->ports[local_port];
|
||||
struct devlink_port *devlink_port = &mlxsw_core_port->devlink_port;
|
||||
|
||||
return devlink_port_get_phys_port_name(devlink_port, name, len);
|
||||
}
|
||||
EXPORT_SYMBOL(mlxsw_core_port_get_phys_port_name);
|
||||
|
||||
struct devlink_port *
|
||||
mlxsw_core_port_devlink_port_get(struct mlxsw_core *mlxsw_core,
|
||||
|
@ -176,8 +176,6 @@ void mlxsw_core_port_clear(struct mlxsw_core *mlxsw_core, u8 local_port,
|
||||
void *port_driver_priv);
|
||||
enum devlink_port_type mlxsw_core_port_type_get(struct mlxsw_core *mlxsw_core,
|
||||
u8 local_port);
|
||||
int mlxsw_core_port_get_phys_port_name(struct mlxsw_core *mlxsw_core,
|
||||
u8 local_port, char *name, size_t len);
|
||||
struct devlink_port *
|
||||
mlxsw_core_port_devlink_port_get(struct mlxsw_core *mlxsw_core,
|
||||
u8 local_port);
|
||||
|
@ -51,16 +51,6 @@ static int mlxsw_m_port_dummy_open_stop(struct net_device *dev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
mlxsw_m_port_get_phys_port_name(struct net_device *dev, char *name, size_t len)
|
||||
{
|
||||
struct mlxsw_m_port *mlxsw_m_port = netdev_priv(dev);
|
||||
struct mlxsw_core *core = mlxsw_m_port->mlxsw_m->core;
|
||||
u8 local_port = mlxsw_m_port->local_port;
|
||||
|
||||
return mlxsw_core_port_get_phys_port_name(core, local_port, name, len);
|
||||
}
|
||||
|
||||
static int mlxsw_m_port_get_port_parent_id(struct net_device *dev,
|
||||
struct netdev_phys_item_id *ppid)
|
||||
{
|
||||
@ -86,7 +76,6 @@ mlxsw_m_port_get_devlink_port(struct net_device *dev)
|
||||
static const struct net_device_ops mlxsw_m_port_netdev_ops = {
|
||||
.ndo_open = mlxsw_m_port_dummy_open_stop,
|
||||
.ndo_stop = mlxsw_m_port_dummy_open_stop,
|
||||
.ndo_get_phys_port_name = mlxsw_m_port_get_phys_port_name,
|
||||
.ndo_get_port_parent_id = mlxsw_m_port_get_port_parent_id,
|
||||
.ndo_get_devlink_port = mlxsw_m_port_get_devlink_port,
|
||||
};
|
||||
|
@ -1254,16 +1254,6 @@ static int mlxsw_sp_port_kill_vid(struct net_device *dev,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int mlxsw_sp_port_get_phys_port_name(struct net_device *dev, char *name,
|
||||
size_t len)
|
||||
{
|
||||
struct mlxsw_sp_port *mlxsw_sp_port = netdev_priv(dev);
|
||||
|
||||
return mlxsw_core_port_get_phys_port_name(mlxsw_sp_port->mlxsw_sp->core,
|
||||
mlxsw_sp_port->local_port,
|
||||
name, len);
|
||||
}
|
||||
|
||||
static struct mlxsw_sp_port_mall_tc_entry *
|
||||
mlxsw_sp_port_mall_tc_entry_find(struct mlxsw_sp_port *port,
|
||||
unsigned long cookie) {
|
||||
@ -1749,7 +1739,6 @@ static const struct net_device_ops mlxsw_sp_port_netdev_ops = {
|
||||
.ndo_get_offload_stats = mlxsw_sp_port_get_offload_stats,
|
||||
.ndo_vlan_rx_add_vid = mlxsw_sp_port_add_vid,
|
||||
.ndo_vlan_rx_kill_vid = mlxsw_sp_port_kill_vid,
|
||||
.ndo_get_phys_port_name = mlxsw_sp_port_get_phys_port_name,
|
||||
.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,
|
||||
|
@ -379,16 +379,6 @@ mlxsw_sx_port_get_stats64(struct net_device *dev,
|
||||
stats->tx_dropped = tx_dropped;
|
||||
}
|
||||
|
||||
static int mlxsw_sx_port_get_phys_port_name(struct net_device *dev, char *name,
|
||||
size_t len)
|
||||
{
|
||||
struct mlxsw_sx_port *mlxsw_sx_port = netdev_priv(dev);
|
||||
|
||||
return mlxsw_core_port_get_phys_port_name(mlxsw_sx_port->mlxsw_sx->core,
|
||||
mlxsw_sx_port->local_port,
|
||||
name, len);
|
||||
}
|
||||
|
||||
static int mlxsw_sx_port_get_port_parent_id(struct net_device *dev,
|
||||
struct netdev_phys_item_id *ppid)
|
||||
{
|
||||
@ -417,7 +407,6 @@ static const struct net_device_ops mlxsw_sx_port_netdev_ops = {
|
||||
.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_phys_port_name = mlxsw_sx_port_get_phys_port_name,
|
||||
.ndo_get_port_parent_id = mlxsw_sx_port_get_port_parent_id,
|
||||
.ndo_get_devlink_port = mlxsw_sx_port_get_devlink_port,
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user