mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-16 03:37:18 +07:00
mlxsw: Register port netdevices into net of core
When creating netdevices for ports, put them under network namespace that the core/parent devlink belongs to. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
053e92aa3c
commit
6b2a880f9d
@ -172,6 +172,7 @@ mlxsw_m_port_create(struct mlxsw_m *mlxsw_m, u8 local_port, u8 module)
|
||||
}
|
||||
|
||||
SET_NETDEV_DEV(dev, mlxsw_m->bus_info->dev);
|
||||
dev_net_set(dev, mlxsw_core_net(mlxsw_m->core));
|
||||
mlxsw_m_port = netdev_priv(dev);
|
||||
mlxsw_m_port->dev = dev;
|
||||
mlxsw_m_port->mlxsw_m = mlxsw_m;
|
||||
|
@ -3635,6 +3635,7 @@ static int mlxsw_sp_port_create(struct mlxsw_sp *mlxsw_sp, u8 local_port,
|
||||
goto err_alloc_etherdev;
|
||||
}
|
||||
SET_NETDEV_DEV(dev, mlxsw_sp->bus_info->dev);
|
||||
dev_net_set(dev, mlxsw_sp_net(mlxsw_sp));
|
||||
mlxsw_sp_port = netdev_priv(dev);
|
||||
mlxsw_sp_port->dev = dev;
|
||||
mlxsw_sp_port->mlxsw_sp = mlxsw_sp;
|
||||
|
@ -992,6 +992,7 @@ static int __mlxsw_sx_port_eth_create(struct mlxsw_sx *mlxsw_sx, u8 local_port,
|
||||
if (!dev)
|
||||
return -ENOMEM;
|
||||
SET_NETDEV_DEV(dev, mlxsw_sx->bus_info->dev);
|
||||
dev_net_set(dev, mlxsw_core_net(mlxsw_sx->core));
|
||||
mlxsw_sx_port = netdev_priv(dev);
|
||||
mlxsw_sx_port->dev = dev;
|
||||
mlxsw_sx_port->mlxsw_sx = mlxsw_sx;
|
||||
|
Loading…
Reference in New Issue
Block a user