| @@ -203,6 +203,8 @@ static int nsim_dev_debugfs_init(struct nsim_dev *nsim_dev) · 202 unmodified lines |
| 203 | 203 | return PTR_ERR(nsim_dev->ports_ddir); |
| 204 | 204 | debugfs_create_bool("fw_update_status", 0600, nsim_dev->ddir, |
| 205 | 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 | 208 | debugfs_create_u32("max_macs", 0600, nsim_dev->ddir, |
| 207 | 209 | &nsim_dev->max_macs); |
| 208 | 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 | 751 | struct nsim_dev *nsim_dev = devlink_priv(devlink); |
| 750 | 752 | int i; |
| 751 | 753 | |
| 754 | + if ((params->overwrite_mask & ~nsim_dev->fw_update_overwrite_mask) != 0) |
| 755 | + return -EOPNOTSUPP; |
| 756 | + |
| 752 | 757 | if (nsim_dev->fw_update_status) { |
| 753 | 758 | devlink_flash_update_begin_notify(devlink); |
| 754 | 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 | 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 | 889 | .reload_down = nsim_dev_reload_down, |
| 884 | 890 | .reload_up = nsim_dev_reload_up, |
| 885 | 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 | 1000 | INIT_LIST_HEAD(&nsim_dev->port_list); |
| 995 | 1001 | mutex_init(&nsim_dev->port_list_lock); |
| 996 | 1002 | nsim_dev->fw_update_status = true; |
| 1003 | + nsim_dev->fw_update_overwrite_mask = 0; |
| 997 | 1004 | |
| 998 | 1005 | nsim_dev->fib_data = nsim_fib_create(devlink, extack); |
| 999 | 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 | 1059 | INIT_LIST_HEAD(&nsim_dev->port_list); |
| 1053 | 1060 | mutex_init(&nsim_dev->port_list_lock); |
| 1054 | 1061 | nsim_dev->fw_update_status = true; |
| 1062 | + nsim_dev->fw_update_overwrite_mask = 0; |
| 1055 | 1063 | nsim_dev->max_macs = NSIM_DEV_MAX_MACS_DEFAULT; |
| 1056 | 1064 | nsim_dev->test1 = NSIM_DEV_TEST1_DEFAULT; |
| 1057 | 1065 | spin_lock_init(&nsim_dev->fa_cookie_lock); |