aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/netdevsim/dev.c
diff options
context:
space:
mode:
authorJiri Pirko <jiri@mellanox.com>2019-09-12 04:49:45 -0400
committerDavid S. Miller <davem@davemloft.net>2019-09-13 16:11:14 -0400
commit97691069dc5a4135e413d3d92200d70b46df9fe5 (patch)
tree2f4e2610bb8dc72be3affba651b57d10b73f9a6e /drivers/net/netdevsim/dev.c
parent35c7ff349a2d1df1b59909f67ba4ddcd84ad934e (diff)
net: devlink: split reload op into two
In order to properly implement failure indication during reload, split the reload op into two ops, one for down phase and one for up phase. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/netdevsim/dev.c')
-rw-r--r--drivers/net/netdevsim/dev.c13
1 files changed, 10 insertions, 3 deletions
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
524static int nsim_dev_reload(struct devlink *devlink, 524static 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
530static 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
640static const struct devlink_ops nsim_dev_devlink_ops = { 646static 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,