Netdev List
 help / color / mirror / Atom feed
From: Simon Horman <simon.horman@netronome.com>
To: David Miller <davem@davemloft.net>
Cc: Jakub Kicinski <jakub.kicinski@netronome.com>,
	netdev@vger.kernel.org, oss-drivers@netronome.com,
	Dirk van der Merwe <dirk.vandermerwe@netronome.com>,
	Simon Horman <simon.horman@netronome.com>
Subject: [net-next 09/11] nfp: devlink: add 'reset_dev_on_drv_probe' support
Date: Fri,  6 Sep 2019 18:00:59 +0200	[thread overview]
Message-ID: <20190906160101.14866-10-simon.horman@netronome.com> (raw)
In-Reply-To: <20190906160101.14866-1-simon.horman@netronome.com>

From: Dirk van der Merwe <dirk.vandermerwe@netronome.com>

Add support for the 'reset_dev_on_drv_probe' devlink parameter. The
reset control policy is controlled by the 'abi_drv_reset' hwinfo key.

Signed-off-by: Dirk van der Merwe <dirk.vandermerwe@netronome.com>
Signed-off-by: Simon Horman <simon.horman@netronome.com>
---
 Documentation/networking/devlink-params-nfp.txt    |  3 +++
 drivers/net/ethernet/netronome/nfp/devlink_param.c | 28 ++++++++++++++++++++++
 2 files changed, 31 insertions(+)

diff --git a/Documentation/networking/devlink-params-nfp.txt b/Documentation/networking/devlink-params-nfp.txt
index 85b1e36f73a8..43e4d4034865 100644
--- a/Documentation/networking/devlink-params-nfp.txt
+++ b/Documentation/networking/devlink-params-nfp.txt
@@ -1,2 +1,5 @@
 fw_load_policy		[DEVICE, GENERIC]
 			Configuration mode: permanent
+
+reset_dev_on_drv_probe	[DEVICE, GENERIC]
+			Configuration mode: permanent
diff --git a/drivers/net/ethernet/netronome/nfp/devlink_param.c b/drivers/net/ethernet/netronome/nfp/devlink_param.c
index d9c74cfba560..df5a5c88ee76 100644
--- a/drivers/net/ethernet/netronome/nfp/devlink_param.c
+++ b/drivers/net/ethernet/netronome/nfp/devlink_param.c
@@ -52,6 +52,29 @@ static const struct nfp_devlink_param_u8_arg nfp_devlink_u8_args[] = {
 		.max_dl_val = DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_DISK,
 		.max_hi_val = NFP_NSP_APP_FW_LOAD_PREF,
 	},
+	[DEVLINK_PARAM_GENERIC_ID_RESET_DEV] = {
+		.hwinfo_name = "abi_drv_reset",
+		.default_hi_val = NFP_NSP_DRV_RESET_DEFAULT,
+		.invalid_dl_val = DEVLINK_PARAM_RESET_DEV_VALUE_UNKNOWN,
+		.hi_to_dl = {
+			[NFP_NSP_DRV_RESET_ALWAYS] =
+				DEVLINK_PARAM_RESET_DEV_VALUE_ALWAYS,
+			[NFP_NSP_DRV_RESET_NEVER] =
+				DEVLINK_PARAM_RESET_DEV_VALUE_NEVER,
+			[NFP_NSP_DRV_RESET_DISK] =
+				DEVLINK_PARAM_RESET_DEV_VALUE_DISK,
+		},
+		.dl_to_hi = {
+			[DEVLINK_PARAM_RESET_DEV_VALUE_ALWAYS] =
+				NFP_NSP_DRV_RESET_ALWAYS,
+			[DEVLINK_PARAM_RESET_DEV_VALUE_NEVER] =
+				NFP_NSP_DRV_RESET_NEVER,
+			[DEVLINK_PARAM_RESET_DEV_VALUE_DISK] =
+				NFP_NSP_DRV_RESET_DISK,
+		},
+		.max_dl_val = DEVLINK_PARAM_RESET_DEV_VALUE_DISK,
+		.max_hi_val = NFP_NSP_DRV_RESET_NEVER,
+	}
 };
 
 static int
@@ -172,6 +195,11 @@ static const struct devlink_param nfp_devlink_params[] = {
 			      nfp_devlink_param_u8_get,
 			      nfp_devlink_param_u8_set,
 			      nfp_devlink_param_u8_validate),
+	DEVLINK_PARAM_GENERIC(RESET_DEV,
+			      BIT(DEVLINK_PARAM_CMODE_PERMANENT),
+			      nfp_devlink_param_u8_get,
+			      nfp_devlink_param_u8_set,
+			      nfp_devlink_param_u8_validate),
 };
 
 static int nfp_devlink_supports_params(struct nfp_pf *pf)
-- 
2.11.0


  parent reply	other threads:[~2019-09-06 16:01 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-06 16:00 [net-next 00/11] nfp: implement firmware loading policy Simon Horman
2019-09-06 16:00 ` [net-next 01/11] devlink: extend 'fw_load_policy' values Simon Horman
2019-09-06 16:00 ` [net-next 02/11] devlink: add 'reset_dev_on_drv_probe' param Simon Horman
2019-09-06 18:31   ` Jiri Pirko
2019-09-06 18:40     ` Dirk van der Merwe
2019-09-07  4:17       ` Jakub Kicinski
2019-09-07 10:28         ` Jiri Pirko
2019-09-06 16:00 ` [net-next 03/11] nfp: nsp: add support for fw_loaded command Simon Horman
2019-09-06 16:00 ` [net-next 04/11] nfp: nsp: add support for optional hwinfo lookup Simon Horman
2019-09-06 16:00 ` [net-next 05/11] nfp: nsp: add support for hwinfo set operation Simon Horman
2019-09-06 16:00 ` [net-next 06/11] nfp: honor FW reset and loading policies Simon Horman
2019-09-06 16:00 ` [net-next 07/11] nfp: add devlink param infrastructure Simon Horman
2019-09-06 16:00 ` [net-next 08/11] nfp: devlink: add 'fw_load_policy' support Simon Horman
2019-09-06 16:00 ` Simon Horman [this message]
2019-09-06 16:01 ` [net-next 10/11] kdoc: fix nfp_fw_load documentation Simon Horman
2019-09-06 16:01 ` [net-next 11/11] Documentation: nfp: add nfp driver specific notes Simon Horman

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=20190906160101.14866-10-simon.horman@netronome.com \
    --to=simon.horman@netronome.com \
    --cc=davem@davemloft.net \
    --cc=dirk.vandermerwe@netronome.com \
    --cc=jakub.kicinski@netronome.com \
    --cc=netdev@vger.kernel.org \
    --cc=oss-drivers@netronome.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox