Subject: Re: [PATCH v2 net-next 1/4] devlink: Add new "allow_fw_live_reset" generic device parameter.

From: Jiri Pirko <[email-masked]>
Date: Sun, 24 May 2020 06:53:35 +0200

Sat, May 23, 2020 at 08:08:22AM CEST, [email-masked] wrote:
>Add a new "allow_fw_live_reset" generic device bool parameter. When
>parameter is set, user is allowed to reset the firmware in real time.
>
>This parameter is employed to communicate user consent or dissent for
>the live reset to happen. A separate command triggers the actual live
>reset.
>
>Cc: Jiri Pirko <[email-masked]>
>Signed-off-by: Vasundhara Volam <[email-masked]>
>Signed-off-by: Michael Chan <[email-masked]>
>---
>v2: Rename param name to "allow_fw_live_reset" from
>"enable_hot_fw_reset".
>Update documentation for the param in devlink-params.rst file.
>---
> Documentation/networking/devlink/devlink-params.rst | 6 ++++++
> include/net/devlink.h                               | 4 ++++
> net/core/devlink.c                                  | 5 +++++
> 3 files changed, 15 insertions(+)
>
>diff --git a/Documentation/networking/devlink/devlink-params.rst b/Documentation/networking/devlink/devlink-params.rst
>index d075fd0..ad54dfb 100644
>--- a/Documentation/networking/devlink/devlink-params.rst
>+++ b/Documentation/networking/devlink/devlink-params.rst
>@@ -108,3 +108,9 @@ own name.
>    * - ``region_snapshot_enable``
>      - Boolean
>      - Enable capture of ``devlink-region`` snapshots.
>+   * - ``allow_fw_live_reset``
>+     - Boolean
>+     - Firmware live reset allows users to reset the firmware in real time.
>+       For example, after firmware upgrade, this feature can immediately reset
>+       to run the new firmware without reloading the driver or rebooting the

This does not tell me anything about the reset being done on another
host. You need to emhasize that, in the name of the param too.

>+       system.
>diff --git a/include/net/devlink.h b/include/net/devlink.h
>index 8ffc1b5c..488b61c 100644
>--- a/include/net/devlink.h
>+++ b/include/net/devlink.h
>@@ -406,6 +406,7 @@ enum devlink_param_generic_id {
> 	DEVLINK_PARAM_GENERIC_ID_FW_LOAD_POLICY,
> 	DEVLINK_PARAM_GENERIC_ID_RESET_DEV_ON_DRV_PROBE,
> 	DEVLINK_PARAM_GENERIC_ID_ENABLE_ROCE,
>+	DEVLINK_PARAM_GENERIC_ID_ALLOW_FW_LIVE_RESET,
> 
> 	/* add new param generic ids above here*/
> 	__DEVLINK_PARAM_GENERIC_ID_MAX,
>@@ -443,6 +444,9 @@ enum devlink_param_generic_id {
> #define DEVLINK_PARAM_GENERIC_ENABLE_ROCE_NAME "enable_roce"
> #define DEVLINK_PARAM_GENERIC_ENABLE_ROCE_TYPE DEVLINK_PARAM_TYPE_BOOL
> 
>+#define DEVLINK_PARAM_GENERIC_ALLOW_FW_LIVE_RESET_NAME "allow_fw_live_reset"
>+#define DEVLINK_PARAM_GENERIC_ALLOW_FW_LIVE_RESET_TYPE DEVLINK_PARAM_TYPE_BOOL
>+
> #define DEVLINK_PARAM_GENERIC(_id, _cmodes, _get, _set, _validate)	\
> {									\
> 	.id = DEVLINK_PARAM_GENERIC_ID_##_id,				\
>diff --git a/net/core/devlink.c b/net/core/devlink.c
>index 7b76e5f..8544f23 100644
>--- a/net/core/devlink.c
>+++ b/net/core/devlink.c
>@@ -3011,6 +3011,11 @@ static int devlink_nl_cmd_flash_update(struct sk_buff *skb,
> 		.name = DEVLINK_PARAM_GENERIC_ENABLE_ROCE_NAME,
> 		.type = DEVLINK_PARAM_GENERIC_ENABLE_ROCE_TYPE,
> 	},
>+	{
>+		.id = DEVLINK_PARAM_GENERIC_ID_ALLOW_FW_LIVE_RESET,
>+		.name = DEVLINK_PARAM_GENERIC_ALLOW_FW_LIVE_RESET_NAME,
>+		.type = DEVLINK_PARAM_GENERIC_ALLOW_FW_LIVE_RESET_TYPE,
>+	},
> };
> 
> static int devlink_param_generic_verify(const struct devlink_param *param)
>-- 
>1.8.3.1
>