diff options
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/net/ethernet/mellanox/mlx4/main.c | 19 | ||||
| -rw-r--r-- | drivers/net/ethernet/mellanox/mlxsw/core.c | 19 | ||||
| -rw-r--r-- | drivers/net/netdevsim/dev.c | 13 |
3 files changed, 40 insertions, 11 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c index a39c647c12dc..ef3f3d06ff1e 100644 --- a/drivers/net/ethernet/mellanox/mlx4/main.c +++ b/drivers/net/ethernet/mellanox/mlx4/main.c | |||
| @@ -3935,17 +3935,27 @@ static void mlx4_restart_one_down(struct pci_dev *pdev); | |||
| 3935 | static int mlx4_restart_one_up(struct pci_dev *pdev, bool reload, | 3935 | static int mlx4_restart_one_up(struct pci_dev *pdev, bool reload, |
| 3936 | struct devlink *devlink); | 3936 | struct devlink *devlink); |
| 3937 | 3937 | ||
| 3938 | static int mlx4_devlink_reload(struct devlink *devlink, | 3938 | static int mlx4_devlink_reload_down(struct devlink *devlink, |
| 3939 | struct netlink_ext_ack *extack) | 3939 | struct netlink_ext_ack *extack) |
| 3940 | { | 3940 | { |
| 3941 | struct mlx4_priv *priv = devlink_priv(devlink); | 3941 | struct mlx4_priv *priv = devlink_priv(devlink); |
| 3942 | struct mlx4_dev *dev = &priv->dev; | 3942 | struct mlx4_dev *dev = &priv->dev; |
| 3943 | struct mlx4_dev_persistent *persist = dev->persist; | 3943 | struct mlx4_dev_persistent *persist = dev->persist; |
| 3944 | int err; | ||
| 3945 | 3944 | ||
| 3946 | if (persist->num_vfs) | 3945 | if (persist->num_vfs) |
| 3947 | mlx4_warn(persist->dev, "Reload performed on PF, will cause reset on operating Virtual Functions\n"); | 3946 | mlx4_warn(persist->dev, "Reload performed on PF, will cause reset on operating Virtual Functions\n"); |
| 3948 | mlx4_restart_one_down(persist->pdev); | 3947 | mlx4_restart_one_down(persist->pdev); |
| 3948 | return 0; | ||
| 3949 | } | ||
| 3950 | |||
| 3951 | static int mlx4_devlink_reload_up(struct devlink *devlink, | ||
| 3952 | struct netlink_ext_ack *extack) | ||
| 3953 | { | ||
| 3954 | struct mlx4_priv *priv = devlink_priv(devlink); | ||
| 3955 | struct mlx4_dev *dev = &priv->dev; | ||
| 3956 | struct mlx4_dev_persistent *persist = dev->persist; | ||
| 3957 | int err; | ||
| 3958 | |||
| 3949 | err = mlx4_restart_one_up(persist->pdev, true, devlink); | 3959 | err = mlx4_restart_one_up(persist->pdev, true, devlink); |
| 3950 | if (err) | 3960 | if (err) |
| 3951 | mlx4_err(persist->dev, "mlx4_restart_one_up failed, ret=%d\n", | 3961 | mlx4_err(persist->dev, "mlx4_restart_one_up failed, ret=%d\n", |
| @@ -3956,7 +3966,8 @@ static int mlx4_devlink_reload(struct devlink *devlink, | |||
| 3956 | 3966 | ||
| 3957 | static const struct devlink_ops mlx4_devlink_ops = { | 3967 | static const struct devlink_ops mlx4_devlink_ops = { |
| 3958 | .port_type_set = mlx4_devlink_port_type_set, | 3968 | .port_type_set = mlx4_devlink_port_type_set, |
| 3959 | .reload = mlx4_devlink_reload, | 3969 | .reload_down = mlx4_devlink_reload_down, |
| 3970 | .reload_up = mlx4_devlink_reload_up, | ||
| 3960 | }; | 3971 | }; |
| 3961 | 3972 | ||
| 3962 | static int mlx4_init_one(struct pci_dev *pdev, const struct pci_device_id *id) | 3973 | static int mlx4_init_one(struct pci_dev *pdev, const struct pci_device_id *id) |
diff --git a/drivers/net/ethernet/mellanox/mlxsw/core.c b/drivers/net/ethernet/mellanox/mlxsw/core.c index 963a2b4b61b1..c71a1d9ea17b 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/core.c +++ b/drivers/net/ethernet/mellanox/mlxsw/core.c | |||
| @@ -984,16 +984,26 @@ mlxsw_devlink_info_get(struct devlink *devlink, struct devlink_info_req *req, | |||
| 984 | return 0; | 984 | return 0; |
| 985 | } | 985 | } |
| 986 | 986 | ||
| 987 | static int mlxsw_devlink_core_bus_device_reload(struct devlink *devlink, | 987 | static int |
| 988 | struct netlink_ext_ack *extack) | 988 | mlxsw_devlink_core_bus_device_reload_down(struct devlink *devlink, |
| 989 | struct netlink_ext_ack *extack) | ||
| 989 | { | 990 | { |
| 990 | struct mlxsw_core *mlxsw_core = devlink_priv(devlink); | 991 | struct mlxsw_core *mlxsw_core = devlink_priv(devlink); |
| 991 | int err; | ||
| 992 | 992 | ||
| 993 | if (!(mlxsw_core->bus->features & MLXSW_BUS_F_RESET)) | 993 | if (!(mlxsw_core->bus->features & MLXSW_BUS_F_RESET)) |
| 994 | return -EOPNOTSUPP; | 994 | return -EOPNOTSUPP; |
| 995 | 995 | ||
| 996 | mlxsw_core_bus_device_unregister(mlxsw_core, true); | 996 | mlxsw_core_bus_device_unregister(mlxsw_core, true); |
| 997 | return 0; | ||
| 998 | } | ||
| 999 | |||
| 1000 | static int | ||
| 1001 | mlxsw_devlink_core_bus_device_reload_up(struct devlink *devlink, | ||
| 1002 | struct netlink_ext_ack *extack) | ||
| 1003 | { | ||
| 1004 | struct mlxsw_core *mlxsw_core = devlink_priv(devlink); | ||
| 1005 | int err; | ||
| 1006 | |||
| 997 | err = mlxsw_core_bus_device_register(mlxsw_core->bus_info, | 1007 | err = mlxsw_core_bus_device_register(mlxsw_core->bus_info, |
| 998 | mlxsw_core->bus, | 1008 | mlxsw_core->bus, |
| 999 | mlxsw_core->bus_priv, true, | 1009 | mlxsw_core->bus_priv, true, |
| @@ -1066,7 +1076,8 @@ mlxsw_devlink_trap_group_init(struct devlink *devlink, | |||
| 1066 | } | 1076 | } |
| 1067 | 1077 | ||
| 1068 | static const struct devlink_ops mlxsw_devlink_ops = { | 1078 | static const struct devlink_ops mlxsw_devlink_ops = { |
| 1069 | .reload = mlxsw_devlink_core_bus_device_reload, | 1079 | .reload_down = mlxsw_devlink_core_bus_device_reload_down, |
| 1080 | .reload_up = mlxsw_devlink_core_bus_device_reload_up, | ||
| 1070 | .port_type_set = mlxsw_devlink_port_type_set, | 1081 | .port_type_set = mlxsw_devlink_port_type_set, |
| 1071 | .port_split = mlxsw_devlink_port_split, | 1082 | .port_split = mlxsw_devlink_port_split, |
| 1072 | .port_unsplit = mlxsw_devlink_port_unsplit, | 1083 | .port_unsplit = mlxsw_devlink_port_unsplit, |
diff --git a/drivers/net/netdevsim/dev.c b/drivers/net/netdevsim/dev.c index 39cdb6c18ec0..7fba7b271a57 100644 --- a/drivers/net/netdevsim/dev.c +++ b/drivers/net/netdevsim/dev.c | |||
| @@ -521,8 +521,14 @@ static void nsim_dev_traps_exit(struct devlink *devlink) | |||
| 521 | kfree(nsim_dev->trap_data); | 521 | kfree(nsim_dev->trap_data); |
| 522 | } | 522 | } |
| 523 | 523 | ||
| 524 | static int nsim_dev_reload(struct devlink *devlink, | 524 | static int nsim_dev_reload_down(struct devlink *devlink, |
| 525 | struct netlink_ext_ack *extack) | 525 | struct netlink_ext_ack *extack) |
| 526 | { | ||
| 527 | return 0; | ||
| 528 | } | ||
| 529 | |||
| 530 | static int nsim_dev_reload_up(struct devlink *devlink, | ||
| 531 | struct netlink_ext_ack *extack) | ||
| 526 | { | 532 | { |
| 527 | enum nsim_resource_id res_ids[] = { | 533 | enum nsim_resource_id res_ids[] = { |
| 528 | NSIM_RESOURCE_IPV4_FIB, NSIM_RESOURCE_IPV4_FIB_RULES, | 534 | NSIM_RESOURCE_IPV4_FIB, NSIM_RESOURCE_IPV4_FIB_RULES, |
| @@ -638,7 +644,8 @@ nsim_dev_devlink_trap_action_set(struct devlink *devlink, | |||
| 638 | } | 644 | } |
| 639 | 645 | ||
| 640 | static const struct devlink_ops nsim_dev_devlink_ops = { | 646 | static const struct devlink_ops nsim_dev_devlink_ops = { |
| 641 | .reload = nsim_dev_reload, | 647 | .reload_down = nsim_dev_reload_down, |
| 648 | .reload_up = nsim_dev_reload_up, | ||
| 642 | .flash_update = nsim_dev_flash_update, | 649 | .flash_update = nsim_dev_flash_update, |
| 643 | .trap_init = nsim_dev_devlink_trap_init, | 650 | .trap_init = nsim_dev_devlink_trap_init, |
| 644 | .trap_action_set = nsim_dev_devlink_trap_action_set, | 651 | .trap_action_set = nsim_dev_devlink_trap_action_set, |
