diff mbox series

[v4,net-next,3/5] netdevsim: devlink flash timeout message

Message ID 20200917030204.50098-4-snelson@pensando.io
State New
Headers show
Series ionic: add devlink dev flash support | expand

Commit Message

Shannon Nelson Sept. 17, 2020, 3:02 a.m. UTC
Add a simple devlink flash timeout message to exercise
the message mechanism.

Signed-off-by: Shannon Nelson <snelson@pensando.io>
---
 drivers/net/netdevsim/dev.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Jakub Kicinski Sept. 17, 2020, 7:50 p.m. UTC | #1
On Wed, 16 Sep 2020 20:02:02 -0700 Shannon Nelson wrote:
> Add a simple devlink flash timeout message to exercise
> the message mechanism.
> 
> Signed-off-by: Shannon Nelson <snelson@pensando.io>
> ---
>  drivers/net/netdevsim/dev.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/net/netdevsim/dev.c b/drivers/net/netdevsim/dev.c
> index 32f339fedb21..4123550e3f6e 100644
> --- a/drivers/net/netdevsim/dev.c
> +++ b/drivers/net/netdevsim/dev.c
> @@ -768,6 +768,8 @@ static int nsim_dev_flash_update(struct devlink *devlink, const char *file_name,
>  						   component,
>  						   NSIM_DEV_FLASH_SIZE,
>  						   NSIM_DEV_FLASH_SIZE);
> +		devlink_flash_update_timeout_notify(devlink, "Flash timeout",
> +						    component, 81);
>  		devlink_flash_update_status_notify(devlink, "Flashing done",
>  						   component, 0, 0);
>  		devlink_flash_update_end_notify(devlink);

To mimic a more real scenario could we perhaps change the msg to "Flash
select" ?
Shannon Nelson Sept. 17, 2020, 8:47 p.m. UTC | #2
On 9/17/20 12:50 PM, Jakub Kicinski wrote:
> On Wed, 16 Sep 2020 20:02:02 -0700 Shannon Nelson wrote:
>> Add a simple devlink flash timeout message to exercise
>> the message mechanism.
>>
>> Signed-off-by: Shannon Nelson <snelson@pensando.io>
>> ---
>>   drivers/net/netdevsim/dev.c | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/net/netdevsim/dev.c b/drivers/net/netdevsim/dev.c
>> index 32f339fedb21..4123550e3f6e 100644
>> --- a/drivers/net/netdevsim/dev.c
>> +++ b/drivers/net/netdevsim/dev.c
>> @@ -768,6 +768,8 @@ static int nsim_dev_flash_update(struct devlink *devlink, const char *file_name,
>>   						   component,
>>   						   NSIM_DEV_FLASH_SIZE,
>>   						   NSIM_DEV_FLASH_SIZE);
>> +		devlink_flash_update_timeout_notify(devlink, "Flash timeout",
>> +						    component, 81);
>>   		devlink_flash_update_status_notify(devlink, "Flashing done",
>>   						   component, 0, 0);
>>   		devlink_flash_update_end_notify(devlink);
> To mimic a more real scenario could we perhaps change the msg to "Flash
> select" ?
Sure.

sln
diff mbox series

Patch

diff --git a/drivers/net/netdevsim/dev.c b/drivers/net/netdevsim/dev.c
index 32f339fedb21..4123550e3f6e 100644
--- a/drivers/net/netdevsim/dev.c
+++ b/drivers/net/netdevsim/dev.c
@@ -768,6 +768,8 @@  static int nsim_dev_flash_update(struct devlink *devlink, const char *file_name,
 						   component,
 						   NSIM_DEV_FLASH_SIZE,
 						   NSIM_DEV_FLASH_SIZE);
+		devlink_flash_update_timeout_notify(devlink, "Flash timeout",
+						    component, 81);
 		devlink_flash_update_status_notify(devlink, "Flashing done",
 						   component, 0, 0);
 		devlink_flash_update_end_notify(devlink);