Commit 5bcfb6a4 authored by Jiri Pirko's avatar Jiri Pirko Committed by David S. Miller

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: default avatarJiri Pirko <jiri@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6b2a880f
...@@ -1005,7 +1005,7 @@ mlxsw_devlink_core_bus_device_reload_up(struct devlink *devlink, ...@@ -1005,7 +1005,7 @@ mlxsw_devlink_core_bus_device_reload_up(struct devlink *devlink,
return mlxsw_core_bus_device_register(mlxsw_core->bus_info, return mlxsw_core_bus_device_register(mlxsw_core->bus_info,
mlxsw_core->bus, mlxsw_core->bus,
mlxsw_core->bus_priv, true, mlxsw_core->bus_priv, true,
devlink); devlink, extack);
} }
static int mlxsw_devlink_flash_update(struct devlink *devlink, static int mlxsw_devlink_flash_update(struct devlink *devlink,
...@@ -1098,7 +1098,8 @@ static int ...@@ -1098,7 +1098,8 @@ static int
__mlxsw_core_bus_device_register(const struct mlxsw_bus_info *mlxsw_bus_info, __mlxsw_core_bus_device_register(const struct mlxsw_bus_info *mlxsw_bus_info,
const struct mlxsw_bus *mlxsw_bus, const struct mlxsw_bus *mlxsw_bus,
void *bus_priv, bool reload, 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; const char *device_kind = mlxsw_bus_info->device_kind;
struct mlxsw_core *mlxsw_core; struct mlxsw_core *mlxsw_core;
...@@ -1172,7 +1173,7 @@ __mlxsw_core_bus_device_register(const struct mlxsw_bus_info *mlxsw_bus_info, ...@@ -1172,7 +1173,7 @@ __mlxsw_core_bus_device_register(const struct mlxsw_bus_info *mlxsw_bus_info,
} }
if (mlxsw_driver->init) { 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) if (err)
goto err_driver_init; goto err_driver_init;
} }
...@@ -1223,14 +1224,16 @@ __mlxsw_core_bus_device_register(const struct mlxsw_bus_info *mlxsw_bus_info, ...@@ -1223,14 +1224,16 @@ __mlxsw_core_bus_device_register(const struct mlxsw_bus_info *mlxsw_bus_info,
int mlxsw_core_bus_device_register(const struct mlxsw_bus_info *mlxsw_bus_info, int mlxsw_core_bus_device_register(const struct mlxsw_bus_info *mlxsw_bus_info,
const struct mlxsw_bus *mlxsw_bus, const struct mlxsw_bus *mlxsw_bus,
void *bus_priv, bool reload, void *bus_priv, bool reload,
struct devlink *devlink) struct devlink *devlink,
struct netlink_ext_ack *extack)
{ {
bool called_again = false; bool called_again = false;
int err; int err;
again: again:
err = __mlxsw_core_bus_device_register(mlxsw_bus_info, mlxsw_bus, 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 /* -EAGAIN is returned in case the FW was updated. FW needs
* a reset, so lets try to call __mlxsw_core_bus_device_register() * a reset, so lets try to call __mlxsw_core_bus_device_register()
* again. * again.
......
...@@ -37,7 +37,8 @@ void mlxsw_core_driver_unregister(struct mlxsw_driver *mlxsw_driver); ...@@ -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, int mlxsw_core_bus_device_register(const struct mlxsw_bus_info *mlxsw_bus_info,
const struct mlxsw_bus *mlxsw_bus, const struct mlxsw_bus *mlxsw_bus,
void *bus_priv, bool reload, 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); void mlxsw_core_bus_device_unregister(struct mlxsw_core *mlxsw_core, bool reload);
struct mlxsw_tx_info { struct mlxsw_tx_info {
...@@ -253,7 +254,8 @@ struct mlxsw_driver { ...@@ -253,7 +254,8 @@ struct mlxsw_driver {
const char *kind; const char *kind;
size_t priv_size; size_t priv_size;
int (*init)(struct mlxsw_core *mlxsw_core, 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); void (*fini)(struct mlxsw_core *mlxsw_core);
int (*basic_trap_groups_set)(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, 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, ...@@ -640,7 +640,7 @@ static int mlxsw_i2c_probe(struct i2c_client *client,
err = mlxsw_core_bus_device_register(&mlxsw_i2c->bus_info, err = mlxsw_core_bus_device_register(&mlxsw_i2c->bus_info,
&mlxsw_i2c_bus, mlxsw_i2c, false, &mlxsw_i2c_bus, mlxsw_i2c, false,
NULL); NULL, NULL);
if (err) { if (err) {
dev_err(&client->dev, "Fail to register core bus\n"); dev_err(&client->dev, "Fail to register core bus\n");
return err; return err;
......
...@@ -327,7 +327,8 @@ static void mlxsw_m_ports_remove(struct mlxsw_m *mlxsw_m) ...@@ -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, 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); struct mlxsw_m *mlxsw_m = mlxsw_core_driver_priv(mlxsw_core);
int err; int err;
......
...@@ -1802,7 +1802,7 @@ static int mlxsw_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -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, err = mlxsw_core_bus_device_register(&mlxsw_pci->bus_info,
&mlxsw_pci_bus, mlxsw_pci, false, &mlxsw_pci_bus, mlxsw_pci, false,
NULL); NULL, NULL);
if (err) { if (err) {
dev_err(&pdev->dev, "cannot register bus device\n"); dev_err(&pdev->dev, "cannot register bus device\n");
goto err_bus_device_register; goto err_bus_device_register;
......
...@@ -4739,7 +4739,8 @@ static int mlxsw_sp_netdevice_event(struct notifier_block *unused, ...@@ -4739,7 +4739,8 @@ static int mlxsw_sp_netdevice_event(struct notifier_block *unused,
unsigned long event, void *ptr); unsigned long event, void *ptr);
static int mlxsw_sp_init(struct mlxsw_core *mlxsw_core, 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); struct mlxsw_sp *mlxsw_sp = mlxsw_core_driver_priv(mlxsw_core);
int err; int err;
...@@ -4832,7 +4833,7 @@ static int mlxsw_sp_init(struct mlxsw_core *mlxsw_core, ...@@ -4832,7 +4833,7 @@ static int mlxsw_sp_init(struct mlxsw_core *mlxsw_core,
goto err_acl_init; goto err_acl_init;
} }
err = mlxsw_sp_router_init(mlxsw_sp); err = mlxsw_sp_router_init(mlxsw_sp, extack);
if (err) { if (err) {
dev_err(mlxsw_sp->bus_info->dev, "Failed to initialize router\n"); dev_err(mlxsw_sp->bus_info->dev, "Failed to initialize router\n");
goto err_router_init; goto err_router_init;
...@@ -4927,7 +4928,8 @@ static int mlxsw_sp_init(struct mlxsw_core *mlxsw_core, ...@@ -4927,7 +4928,8 @@ static int mlxsw_sp_init(struct mlxsw_core *mlxsw_core,
} }
static int mlxsw_sp1_init(struct mlxsw_core *mlxsw_core, 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); 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, ...@@ -4947,11 +4949,12 @@ static int mlxsw_sp1_init(struct mlxsw_core *mlxsw_core,
mlxsw_sp->listeners = mlxsw_sp1_listener; mlxsw_sp->listeners = mlxsw_sp1_listener;
mlxsw_sp->listeners_count = ARRAY_SIZE(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, 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); 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, ...@@ -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->port_type_speed_ops = &mlxsw_sp2_port_type_speed_ops;
mlxsw_sp->ptp_ops = &mlxsw_sp2_ptp_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) static void mlxsw_sp_fini(struct mlxsw_core *mlxsw_core)
......
...@@ -525,7 +525,8 @@ union mlxsw_sp_l3addr { ...@@ -525,7 +525,8 @@ union mlxsw_sp_l3addr {
struct in6_addr addr6; 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); void mlxsw_sp_router_fini(struct mlxsw_sp *mlxsw_sp);
int mlxsw_sp_netdevice_router_port_event(struct net_device *dev, int mlxsw_sp_netdevice_router_port_event(struct net_device *dev,
unsigned long event, void *ptr); unsigned long event, void *ptr);
......
...@@ -8061,7 +8061,8 @@ static void __mlxsw_sp_router_fini(struct mlxsw_sp *mlxsw_sp) ...@@ -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); 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; struct mlxsw_sp_router *router;
int err; int err;
...@@ -8139,7 +8140,7 @@ int mlxsw_sp_router_init(struct mlxsw_sp *mlxsw_sp) ...@@ -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; mlxsw_sp->router->fib_nb.notifier_call = mlxsw_sp_router_fib_event;
err = register_fib_notifier(mlxsw_sp_net(mlxsw_sp), err = register_fib_notifier(mlxsw_sp_net(mlxsw_sp),
&mlxsw_sp->router->fib_nb, &mlxsw_sp->router->fib_nb,
mlxsw_sp_router_fib_dump_flush, NULL); mlxsw_sp_router_fib_dump_flush, extack);
if (err) if (err)
goto err_register_fib_notifier; goto err_register_fib_notifier;
......
...@@ -446,7 +446,8 @@ static int mlxsw_sib_basic_trap_groups_set(struct mlxsw_core *mlxsw_core) ...@@ -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, 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); struct mlxsw_sib *mlxsw_sib = mlxsw_core_driver_priv(mlxsw_core);
int err; int err;
......
...@@ -1564,7 +1564,8 @@ static int mlxsw_sx_basic_trap_groups_set(struct mlxsw_core *mlxsw_core) ...@@ -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, 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); struct mlxsw_sx *mlxsw_sx = mlxsw_core_driver_priv(mlxsw_core);
int err; int err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment