All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, michael.chan@broadcom.com,
	Vasundhara Volam <vasundhara-v.volam@broadcom.com>,
	Jiri Pirko <jiri@mellanox.com>, Jakub Kicinski <kuba@kernel.org>
Subject: [PATCH v3 net-next 2/6] devlink: Add 'allow_live_dev_reset' generic parameter.
Date: Sun, 31 May 2020 12:33:41 +0530	[thread overview]
Message-ID: <1590908625-10952-3-git-send-email-vasundhara-v.volam@broadcom.com> (raw)
In-Reply-To: <1590908625-10952-1-git-send-email-vasundhara-v.volam@broadcom.com>

This parameter is supported only when 'enable_live_dev_reset' is
true. The purpose of this parameter is to allow the user on a
host to temporarily disable the live reset feature of the device.

For example, if a host is running a mission critical application,
a user from the host can set this parameter to false, to avoid
a potential live reset from disrupting it.

Cc: Jiri Pirko <jiri@mellanox.com>
Cc: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
 Documentation/networking/devlink/devlink-params.rst | 20 ++++++++++++++++++++
 include/net/devlink.h                               |  4 ++++
 net/core/devlink.c                                  |  5 +++++
 3 files changed, 29 insertions(+)

diff --git a/Documentation/networking/devlink/devlink-params.rst b/Documentation/networking/devlink/devlink-params.rst
index 8e12c83..450fe18 100644
--- a/Documentation/networking/devlink/devlink-params.rst
+++ b/Documentation/networking/devlink/devlink-params.rst
@@ -116,3 +116,23 @@ own name.
        For example, after flashing a new firmware image, this feature allows the
        user to initiate the reset immediately from a separate command, to load
        the new firmware without reloading the driver or resetting the system.
+
+       A user can set the 'allow_live_dev_reset' parameter to false to
+       momentarily disable the live reset capability.
+   * - ``allow_live_dev_reset``
+     - Boolean
+     - This parameter is supported only when 'enable_live_dev_reset' is true.
+       The purpose of this parameter is to allow the user on a host to
+       temporarily disable the live reset feature of the device. When this
+       parameter is set to true from all the hosts in a multi-host environment
+       for example, a user from any host can initiate live device reset from any
+       of the host drivers.
+
+       For the parameter to be true, all the loaded host drivers must support
+       the live reset and the parameter must be set to true for all the host
+       drivers. For example, if any of the host (in case of multi-host NIC) is
+       loaded with an old driver which is not aware of the feature, then the
+       value of the parameter will be false until the old driver is upgraded
+       or unloaded. Also if the user has set the parameter to false on one of
+       the host (say A), the parameter will be false for all the hosts until the
+       user sets the parameter to true in the host (A).
diff --git a/include/net/devlink.h b/include/net/devlink.h
index eb28fa1..d922033 100644
--- a/include/net/devlink.h
+++ b/include/net/devlink.h
@@ -407,6 +407,7 @@ enum devlink_param_generic_id {
 	DEVLINK_PARAM_GENERIC_ID_RESET_DEV_ON_DRV_PROBE,
 	DEVLINK_PARAM_GENERIC_ID_ENABLE_ROCE,
 	DEVLINK_PARAM_GENERIC_ID_ENABLE_LIVE_DEV_RESET,
+	DEVLINK_PARAM_GENERIC_ID_ALLOW_LIVE_DEV_RESET,
 
 	/* add new param generic ids above here*/
 	__DEVLINK_PARAM_GENERIC_ID_MAX,
@@ -447,6 +448,9 @@ enum devlink_param_generic_id {
 #define DEVLINK_PARAM_GENERIC_ENABLE_LIVE_DEV_RESET_NAME "enable_live_dev_reset"
 #define DEVLINK_PARAM_GENERIC_ENABLE_LIVE_DEV_RESET_TYPE DEVLINK_PARAM_TYPE_BOOL
 
+#define DEVLINK_PARAM_GENERIC_ALLOW_LIVE_DEV_RESET_NAME "allow_live_dev_reset"
+#define DEVLINK_PARAM_GENERIC_ALLOW_LIVE_DEV_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 7b52b38..e36f6c4 100644
--- a/net/core/devlink.c
+++ b/net/core/devlink.c
@@ -3016,6 +3016,11 @@ static int devlink_nl_cmd_flash_update(struct sk_buff *skb,
 		.name = DEVLINK_PARAM_GENERIC_ENABLE_LIVE_DEV_RESET_NAME,
 		.type = DEVLINK_PARAM_GENERIC_ENABLE_LIVE_DEV_RESET_TYPE,
 	},
+	{
+		.id = DEVLINK_PARAM_GENERIC_ID_ALLOW_LIVE_DEV_RESET,
+		.name = DEVLINK_PARAM_GENERIC_ALLOW_LIVE_DEV_RESET_NAME,
+		.type = DEVLINK_PARAM_GENERIC_ALLOW_LIVE_DEV_RESET_TYPE,
+	},
 };
 
 static int devlink_param_generic_verify(const struct devlink_param *param)
-- 
1.8.3.1


  parent reply	other threads:[~2020-05-31  7:06 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-31  7:03 [PATCH v3 net-next 0/6] bnxt_en: Add 'enable_live_dev_reset' and 'allow_live_dev_reset' generic devlink params Vasundhara Volam
2020-05-31  7:03 ` [PATCH v3 net-next 1/6] devlink: Add 'enable_live_dev_reset' generic parameter Vasundhara Volam
2020-06-01  6:19   ` Jiri Pirko
2020-05-31  7:03 ` Vasundhara Volam [this message]
2020-05-31  7:03 ` [PATCH v3 net-next 3/6] bnxt_en: Use 'enable_live_dev_reset' devlink parameter Vasundhara Volam
2020-05-31  7:03 ` [PATCH v3 net-next 4/6] bnxt_en: Update firmware spec. to 1.10.1.40 Vasundhara Volam
2020-05-31  7:03 ` [PATCH v3 net-next 5/6] bnxt_en: Use 'allow_live_dev_reset' devlink parameter Vasundhara Volam
2020-05-31  7:03 ` [PATCH v3 net-next 6/6] bnxt_en: Check if fw_live_reset is allowed before doing ETHTOOL_RESET Vasundhara Volam
2020-06-01  6:18 ` [PATCH v3 net-next 0/6] bnxt_en: Add 'enable_live_dev_reset' and 'allow_live_dev_reset' generic devlink params Jiri Pirko
2020-06-01  6:43   ` Jiri Pirko
2020-06-01  8:58     ` Vasundhara Volam
2020-06-01  9:52       ` Jiri Pirko
2020-06-01 10:08         ` Vasundhara Volam
2020-06-01 10:27           ` Jiri Pirko
2020-06-01 10:04       ` Jiri Pirko
2020-06-01 15:31         ` Vasundhara Volam
2020-06-01 23:24           ` Jakub Kicinski
2020-06-02  6:31             ` Jiri Pirko
2020-06-06 14:18           ` Vasundhara Volam
2020-06-01  9:58 ` Jiri Pirko
2020-06-01 10:12   ` Vasundhara Volam
2020-06-01 23:20   ` Jakub Kicinski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1590908625-10952-3-git-send-email-vasundhara-v.volam@broadcom.com \
    --to=vasundhara-v.volam@broadcom.com \
    --cc=davem@davemloft.net \
    --cc=jiri@mellanox.com \
    --cc=kuba@kernel.org \
    --cc=michael.chan@broadcom.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.