| @@ -203,6 +203,8 @@ static int nsim_dev_debugfs_init(struct nsim_dev *nsim_dev) · 202 unmodified lines |
| 203 | return PTR_ERR(nsim_dev->ports_ddir); | 203 | return PTR_ERR(nsim_dev->ports_ddir); |
| 204 | debugfs_create_bool("fw_update_status", 0600, nsim_dev->ddir, | 204 | debugfs_create_bool("fw_update_status", 0600, nsim_dev->ddir, |
| 205 | &nsim_dev->fw_update_status); | 205 | &nsim_dev->fw_update_status); |
| | 206 | debugfs_create_u32("fw_update_overwrite_mask", 0600, nsim_dev->ddir, |
| | 207 | &nsim_dev->fw_update_overwrite_mask); |
| 206 | debugfs_create_u32("max_macs", 0600, nsim_dev->ddir, | 208 | debugfs_create_u32("max_macs", 0600, nsim_dev->ddir, |
| 207 | &nsim_dev->max_macs); | 209 | &nsim_dev->max_macs); |
| 208 | debugfs_create_bool("test1", 0600, nsim_dev->ddir, | 210 | debugfs_create_bool("test1", 0600, nsim_dev->ddir, |
| @@ -749,6 +751,9 @@ static int nsim_dev_flash_update(struct devlink *devlink, · 540 unmodified lines |
| 749 | struct nsim_dev *nsim_dev = devlink_priv(devlink); | 751 | struct nsim_dev *nsim_dev = devlink_priv(devlink); |
| 750 | int i; | 752 | int i; |
| 751 | | 753 | |
| | 754 | if ((params->overwrite_mask & ~nsim_dev->fw_update_overwrite_mask) != 0) |
| | 755 | return -EOPNOTSUPP; |
| | 756 | |
| 752 | if (nsim_dev->fw_update_status) { | 757 | if (nsim_dev->fw_update_status) { |
| 753 | devlink_flash_update_begin_notify(devlink); | 758 | devlink_flash_update_begin_notify(devlink); |
| 754 | devlink_flash_update_status_notify(devlink, | 759 | devlink_flash_update_status_notify(devlink, |
| @@ -879,7 +884,8 @@ nsim_dev_devlink_trap_policer_counter_get(struct devlink *devlink, · 124 unmodified lines |
| 879 | } | 884 | } |
| 880 | | 885 | |
| 881 | static const struct devlink_ops nsim_dev_devlink_ops = { | 886 | static const struct devlink_ops nsim_dev_devlink_ops = { |
| 882 | .supported_flash_update_params = DEVLINK_SUPPORT_FLASH_UPDATE_COMPONENT, | 887 | .supported_flash_update_params = DEVLINK_SUPPORT_FLASH_UPDATE_COMPONENT | |
| | 888 | DEVLINK_SUPPORT_FLASH_UPDATE_OVERWRITE_MASK, |
| 883 | .reload_down = nsim_dev_reload_down, | 889 | .reload_down = nsim_dev_reload_down, |
| 884 | .reload_up = nsim_dev_reload_up, | 890 | .reload_up = nsim_dev_reload_up, |
| 885 | .info_get = nsim_dev_info_get, | 891 | .info_get = nsim_dev_info_get, |
| @@ -994,6 +1000,7 @@ static int nsim_dev_reload_create(struct nsim_dev *nsim_dev, · 108 unmodified lines |
| 994 | INIT_LIST_HEAD(&nsim_dev->port_list); | 1000 | INIT_LIST_HEAD(&nsim_dev->port_list); |
| 995 | mutex_init(&nsim_dev->port_list_lock); | 1001 | mutex_init(&nsim_dev->port_list_lock); |
| 996 | nsim_dev->fw_update_status = true; | 1002 | nsim_dev->fw_update_status = true; |
| | 1003 | nsim_dev->fw_update_overwrite_mask = 0; |
| 997 | | 1004 | |
| 998 | nsim_dev->fib_data = nsim_fib_create(devlink, extack); | 1005 | nsim_dev->fib_data = nsim_fib_create(devlink, extack); |
| 999 | if (IS_ERR(nsim_dev->fib_data)) | 1006 | if (IS_ERR(nsim_dev->fib_data)) |
| @@ -1052,6 +1059,7 @@ int nsim_dev_probe(struct nsim_bus_dev *nsim_bus_dev) · 52 unmodified lines |
| 1052 | INIT_LIST_HEAD(&nsim_dev->port_list); | 1059 | INIT_LIST_HEAD(&nsim_dev->port_list); |
| 1053 | mutex_init(&nsim_dev->port_list_lock); | 1060 | mutex_init(&nsim_dev->port_list_lock); |
| 1054 | nsim_dev->fw_update_status = true; | 1061 | nsim_dev->fw_update_status = true; |
| | 1062 | nsim_dev->fw_update_overwrite_mask = 0; |
| 1055 | nsim_dev->max_macs = NSIM_DEV_MAX_MACS_DEFAULT; | 1063 | nsim_dev->max_macs = NSIM_DEV_MAX_MACS_DEFAULT; |
| 1056 | nsim_dev->test1 = NSIM_DEV_TEST1_DEFAULT; | 1064 | nsim_dev->test1 = NSIM_DEV_TEST1_DEFAULT; |
| 1057 | spin_lock_init(&nsim_dev->fa_cookie_lock); | 1065 | spin_lock_init(&nsim_dev->fa_cookie_lock); |