mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-27 06:34:11 +08:00
mlxsw: Propagate extack down to register_fib_notifier()
During the devlink reaload the extack is present, so propagate it all the way down to register_fib_notifier() call in spectrum_router.c. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
6b2a880f9d
commit
5bcfb6a45a
@ -1005,7 +1005,7 @@ mlxsw_devlink_core_bus_device_reload_up(struct devlink *devlink,
|
||||
return mlxsw_core_bus_device_register(mlxsw_core->bus_info,
|
||||
mlxsw_core->bus,
|
||||
mlxsw_core->bus_priv, true,
|
||||
devlink);
|
||||
devlink, extack);
|
||||
}
|
||||
|
||||
static int mlxsw_devlink_flash_update(struct devlink *devlink,
|
||||
@ -1098,7 +1098,8 @@ static int
|
||||
__mlxsw_core_bus_device_register(const struct mlxsw_bus_info *mlxsw_bus_info,
|
||||
const struct mlxsw_bus *mlxsw_bus,
|
||||
void *bus_priv, bool reload,
|
||||
struct devlink *devlink)
|
||||
struct devlink *devlink,
|
||||
struct netlink_ext_ack *extack)
|
||||
{
|
||||
const char *device_kind = mlxsw_bus_info->device_kind;
|
||||
struct mlxsw_core *mlxsw_core;
|
||||
@ -1172,7 +1173,7 @@ __mlxsw_core_bus_device_register(const struct mlxsw_bus_info *mlxsw_bus_info,
|
||||
}
|
||||
|
||||
if (mlxsw_driver->init) {
|
||||
err = mlxsw_driver->init(mlxsw_core, mlxsw_bus_info);
|
||||
err = mlxsw_driver->init(mlxsw_core, mlxsw_bus_info, extack);
|
||||
if (err)
|
||||
goto err_driver_init;
|
||||
}
|
||||
@ -1223,14 +1224,16 @@ err_devlink_alloc:
|
||||
int mlxsw_core_bus_device_register(const struct mlxsw_bus_info *mlxsw_bus_info,
|
||||
const struct mlxsw_bus *mlxsw_bus,
|
||||
void *bus_priv, bool reload,
|
||||
struct devlink *devlink)
|
||||
struct devlink *devlink,
|
||||
struct netlink_ext_ack *extack)
|
||||
{
|
||||
bool called_again = false;
|
||||
int err;
|
||||
|
||||
again:
|
||||
err = __mlxsw_core_bus_device_register(mlxsw_bus_info, mlxsw_bus,
|
||||
bus_priv, reload, devlink);
|
||||
bus_priv, reload,
|
||||
devlink, extack);
|
||||
/* -EAGAIN is returned in case the FW was updated. FW needs
|
||||
* a reset, so lets try to call __mlxsw_core_bus_device_register()
|
||||
* again.
|
||||
|
@ -37,7 +37,8 @@ void mlxsw_core_driver_unregister(struct mlxsw_driver *mlxsw_driver);
|
||||
int mlxsw_core_bus_device_register(const struct mlxsw_bus_info *mlxsw_bus_info,
|
||||
const struct mlxsw_bus *mlxsw_bus,
|
||||
void *bus_priv, bool reload,
|
||||
struct devlink *devlink);
|
||||
struct devlink *devlink,
|
||||
struct netlink_ext_ack *extack);
|
||||
void mlxsw_core_bus_device_unregister(struct mlxsw_core *mlxsw_core, bool reload);
|
||||
|
||||
struct mlxsw_tx_info {
|
||||
@ -253,7 +254,8 @@ struct mlxsw_driver {
|
||||
const char *kind;
|
||||
size_t priv_size;
|
||||
int (*init)(struct mlxsw_core *mlxsw_core,
|
||||
const struct mlxsw_bus_info *mlxsw_bus_info);
|
||||
const struct mlxsw_bus_info *mlxsw_bus_info,
|
||||
struct netlink_ext_ack *extack);
|
||||
void (*fini)(struct mlxsw_core *mlxsw_core);
|
||||
int (*basic_trap_groups_set)(struct mlxsw_core *mlxsw_core);
|
||||
int (*port_type_set)(struct mlxsw_core *mlxsw_core, u8 local_port,
|
||||
|
@ -640,7 +640,7 @@ static int mlxsw_i2c_probe(struct i2c_client *client,
|
||||
|
||||
err = mlxsw_core_bus_device_register(&mlxsw_i2c->bus_info,
|
||||
&mlxsw_i2c_bus, mlxsw_i2c, false,
|
||||
NULL);
|
||||
NULL, NULL);
|
||||
if (err) {
|
||||
dev_err(&client->dev, "Fail to register core bus\n");
|
||||
return err;
|
||||
|
@ -327,7 +327,8 @@ static void mlxsw_m_ports_remove(struct mlxsw_m *mlxsw_m)
|
||||
}
|
||||
|
||||
static int mlxsw_m_init(struct mlxsw_core *mlxsw_core,
|
||||
const struct mlxsw_bus_info *mlxsw_bus_info)
|
||||
const struct mlxsw_bus_info *mlxsw_bus_info,
|
||||
struct netlink_ext_ack *extack)
|
||||
{
|
||||
struct mlxsw_m *mlxsw_m = mlxsw_core_driver_priv(mlxsw_core);
|
||||
int err;
|
||||
|
@ -1802,7 +1802,7 @@ static int mlxsw_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
|
||||
|
||||
err = mlxsw_core_bus_device_register(&mlxsw_pci->bus_info,
|
||||
&mlxsw_pci_bus, mlxsw_pci, false,
|
||||
NULL);
|
||||
NULL, NULL);
|
||||
if (err) {
|
||||
dev_err(&pdev->dev, "cannot register bus device\n");
|
||||
goto err_bus_device_register;
|
||||
|
@ -4739,7 +4739,8 @@ static int mlxsw_sp_netdevice_event(struct notifier_block *unused,
|
||||
unsigned long event, void *ptr);
|
||||
|
||||
static int mlxsw_sp_init(struct mlxsw_core *mlxsw_core,
|
||||
const struct mlxsw_bus_info *mlxsw_bus_info)
|
||||
const struct mlxsw_bus_info *mlxsw_bus_info,
|
||||
struct netlink_ext_ack *extack)
|
||||
{
|
||||
struct mlxsw_sp *mlxsw_sp = mlxsw_core_driver_priv(mlxsw_core);
|
||||
int err;
|
||||
@ -4832,7 +4833,7 @@ static int mlxsw_sp_init(struct mlxsw_core *mlxsw_core,
|
||||
goto err_acl_init;
|
||||
}
|
||||
|
||||
err = mlxsw_sp_router_init(mlxsw_sp);
|
||||
err = mlxsw_sp_router_init(mlxsw_sp, extack);
|
||||
if (err) {
|
||||
dev_err(mlxsw_sp->bus_info->dev, "Failed to initialize router\n");
|
||||
goto err_router_init;
|
||||
@ -4927,7 +4928,8 @@ err_fids_init:
|
||||
}
|
||||
|
||||
static int mlxsw_sp1_init(struct mlxsw_core *mlxsw_core,
|
||||
const struct mlxsw_bus_info *mlxsw_bus_info)
|
||||
const struct mlxsw_bus_info *mlxsw_bus_info,
|
||||
struct netlink_ext_ack *extack)
|
||||
{
|
||||
struct mlxsw_sp *mlxsw_sp = mlxsw_core_driver_priv(mlxsw_core);
|
||||
|
||||
@ -4947,11 +4949,12 @@ static int mlxsw_sp1_init(struct mlxsw_core *mlxsw_core,
|
||||
mlxsw_sp->listeners = mlxsw_sp1_listener;
|
||||
mlxsw_sp->listeners_count = ARRAY_SIZE(mlxsw_sp1_listener);
|
||||
|
||||
return mlxsw_sp_init(mlxsw_core, mlxsw_bus_info);
|
||||
return mlxsw_sp_init(mlxsw_core, mlxsw_bus_info, extack);
|
||||
}
|
||||
|
||||
static int mlxsw_sp2_init(struct mlxsw_core *mlxsw_core,
|
||||
const struct mlxsw_bus_info *mlxsw_bus_info)
|
||||
const struct mlxsw_bus_info *mlxsw_bus_info,
|
||||
struct netlink_ext_ack *extack)
|
||||
{
|
||||
struct mlxsw_sp *mlxsw_sp = mlxsw_core_driver_priv(mlxsw_core);
|
||||
|
||||
@ -4967,7 +4970,7 @@ static int mlxsw_sp2_init(struct mlxsw_core *mlxsw_core,
|
||||
mlxsw_sp->port_type_speed_ops = &mlxsw_sp2_port_type_speed_ops;
|
||||
mlxsw_sp->ptp_ops = &mlxsw_sp2_ptp_ops;
|
||||
|
||||
return mlxsw_sp_init(mlxsw_core, mlxsw_bus_info);
|
||||
return mlxsw_sp_init(mlxsw_core, mlxsw_bus_info, extack);
|
||||
}
|
||||
|
||||
static void mlxsw_sp_fini(struct mlxsw_core *mlxsw_core)
|
||||
|
@ -525,7 +525,8 @@ union mlxsw_sp_l3addr {
|
||||
struct in6_addr addr6;
|
||||
};
|
||||
|
||||
int mlxsw_sp_router_init(struct mlxsw_sp *mlxsw_sp);
|
||||
int mlxsw_sp_router_init(struct mlxsw_sp *mlxsw_sp,
|
||||
struct netlink_ext_ack *extack);
|
||||
void mlxsw_sp_router_fini(struct mlxsw_sp *mlxsw_sp);
|
||||
int mlxsw_sp_netdevice_router_port_event(struct net_device *dev,
|
||||
unsigned long event, void *ptr);
|
||||
|
@ -8061,7 +8061,8 @@ static void __mlxsw_sp_router_fini(struct mlxsw_sp *mlxsw_sp)
|
||||
mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(rgcr), rgcr_pl);
|
||||
}
|
||||
|
||||
int mlxsw_sp_router_init(struct mlxsw_sp *mlxsw_sp)
|
||||
int mlxsw_sp_router_init(struct mlxsw_sp *mlxsw_sp,
|
||||
struct netlink_ext_ack *extack)
|
||||
{
|
||||
struct mlxsw_sp_router *router;
|
||||
int err;
|
||||
@ -8139,7 +8140,7 @@ int mlxsw_sp_router_init(struct mlxsw_sp *mlxsw_sp)
|
||||
mlxsw_sp->router->fib_nb.notifier_call = mlxsw_sp_router_fib_event;
|
||||
err = register_fib_notifier(mlxsw_sp_net(mlxsw_sp),
|
||||
&mlxsw_sp->router->fib_nb,
|
||||
mlxsw_sp_router_fib_dump_flush, NULL);
|
||||
mlxsw_sp_router_fib_dump_flush, extack);
|
||||
if (err)
|
||||
goto err_register_fib_notifier;
|
||||
|
||||
|
@ -446,7 +446,8 @@ static int mlxsw_sib_basic_trap_groups_set(struct mlxsw_core *mlxsw_core)
|
||||
}
|
||||
|
||||
static int mlxsw_sib_init(struct mlxsw_core *mlxsw_core,
|
||||
const struct mlxsw_bus_info *mlxsw_bus_info)
|
||||
const struct mlxsw_bus_info *mlxsw_bus_info,
|
||||
struct netlink_ext_ack *extack)
|
||||
{
|
||||
struct mlxsw_sib *mlxsw_sib = mlxsw_core_driver_priv(mlxsw_core);
|
||||
int err;
|
||||
|
@ -1564,7 +1564,8 @@ static int mlxsw_sx_basic_trap_groups_set(struct mlxsw_core *mlxsw_core)
|
||||
}
|
||||
|
||||
static int mlxsw_sx_init(struct mlxsw_core *mlxsw_core,
|
||||
const struct mlxsw_bus_info *mlxsw_bus_info)
|
||||
const struct mlxsw_bus_info *mlxsw_bus_info,
|
||||
struct netlink_ext_ack *extack)
|
||||
{
|
||||
struct mlxsw_sx *mlxsw_sx = mlxsw_core_driver_priv(mlxsw_core);
|
||||
int err;
|
||||
|
Loading…
Reference in New Issue
Block a user