Netdev Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH net-next 0/2] devlink: add unknown 'fw_load_policy' value
@ 2019-09-11 11:08 Simon Horman
  2019-09-11 11:08 ` [PATCH net-next 1/2] " Simon Horman
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Simon Horman @ 2019-09-11 11:08 UTC (permalink / raw)
  To: David Miller
  Cc: Jakub Kicinski, netdev, oss-drivers, Dirk van der Merwe, Simon Horman

Dirk says:

Recently we added an unknown value for the 'reset_dev_on_drv_probe' devlink
parameter. Extend the 'fw_load_policy' parameter in the same way.

The only driver that uses this right now is the nfp driver.

Dirk van der Merwe (2):
  devlink: add unknown 'fw_load_policy' value
  nfp: devlink: set unknown fw_load_policy

 drivers/net/ethernet/netronome/nfp/devlink_param.c | 3 ++-
 include/uapi/linux/devlink.h                       | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)

-- 
2.11.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH net-next 1/2] devlink: add unknown 'fw_load_policy' value
  2019-09-11 11:08 [PATCH net-next 0/2] devlink: add unknown 'fw_load_policy' value Simon Horman
@ 2019-09-11 11:08 ` " Simon Horman
  2019-09-11 11:08 ` [PATCH net-next 2/2] nfp: devlink: set unknown fw_load_policy Simon Horman
  2019-09-11 14:10 ` [PATCH net-next 0/2] devlink: add unknown 'fw_load_policy' value David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Simon Horman @ 2019-09-11 11:08 UTC (permalink / raw)
  To: David Miller
  Cc: Jakub Kicinski, netdev, oss-drivers, Dirk van der Merwe, Simon Horman

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

Similar to the 'reset_dev_on_drv_probe' devlink parameter, it is useful
to have an unknown value which can be used by drivers to report that the
hardware value isn't recognized or is otherwise invalid instead of
failing the operation.

This is especially useful for u8/enum parameters.

Suggested-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Dirk van der Merwe <dirk.vandermerwe@netronome.com>
Signed-off-by: Simon Horman <simon.horman@netronome.com>
---
 include/uapi/linux/devlink.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/uapi/linux/devlink.h b/include/uapi/linux/devlink.h
index 1da3e83f1fd4..8da5365850cd 100644
--- a/include/uapi/linux/devlink.h
+++ b/include/uapi/linux/devlink.h
@@ -203,6 +203,7 @@ enum devlink_param_fw_load_policy_value {
 	DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_DRIVER,
 	DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_FLASH,
 	DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_DISK,
+	DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_UNKNOWN,
 };
 
 enum devlink_param_reset_dev_on_drv_probe_value {
-- 
2.11.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH net-next 2/2] nfp: devlink: set unknown fw_load_policy
  2019-09-11 11:08 [PATCH net-next 0/2] devlink: add unknown 'fw_load_policy' value Simon Horman
  2019-09-11 11:08 ` [PATCH net-next 1/2] " Simon Horman
@ 2019-09-11 11:08 ` Simon Horman
  2019-09-11 14:10 ` [PATCH net-next 0/2] devlink: add unknown 'fw_load_policy' value David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Simon Horman @ 2019-09-11 11:08 UTC (permalink / raw)
  To: David Miller
  Cc: Jakub Kicinski, netdev, oss-drivers, Dirk van der Merwe, Simon Horman

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

If the 'app_fw_from_flash' HWinfo key is invalid, set the
'fw_load_policy' devlink parameter value to unknown.

Suggested-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Dirk van der Merwe <dirk.vandermerwe@netronome.com>
Signed-off-by: Simon Horman <simon.horman@netronome.com>
---
 drivers/net/ethernet/netronome/nfp/devlink_param.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/netronome/nfp/devlink_param.c b/drivers/net/ethernet/netronome/nfp/devlink_param.c
index 4a8141b4d625..36491835ac65 100644
--- a/drivers/net/ethernet/netronome/nfp/devlink_param.c
+++ b/drivers/net/ethernet/netronome/nfp/devlink_param.c
@@ -32,7 +32,8 @@ static const struct nfp_devlink_param_u8_arg nfp_devlink_u8_args[] = {
 	[DEVLINK_PARAM_GENERIC_ID_FW_LOAD_POLICY] = {
 		.hwinfo_name = "app_fw_from_flash",
 		.default_hi_val = NFP_NSP_APP_FW_LOAD_DEFAULT,
-		.invalid_dl_val = -EINVAL,
+		.invalid_dl_val =
+			DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_UNKNOWN,
 		.hi_to_dl = {
 			[NFP_NSP_APP_FW_LOAD_DISK] =
 				DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_DISK,
-- 
2.11.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next 0/2] devlink: add unknown 'fw_load_policy' value
  2019-09-11 11:08 [PATCH net-next 0/2] devlink: add unknown 'fw_load_policy' value Simon Horman
  2019-09-11 11:08 ` [PATCH net-next 1/2] " Simon Horman
  2019-09-11 11:08 ` [PATCH net-next 2/2] nfp: devlink: set unknown fw_load_policy Simon Horman
@ 2019-09-11 14:10 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2019-09-11 14:10 UTC (permalink / raw)
  To: simon.horman; +Cc: jakub.kicinski, netdev, oss-drivers, dirk.vandermerwe

From: Simon Horman <simon.horman@netronome.com>
Date: Wed, 11 Sep 2019 12:08:31 +0100

> Dirk says:
> 
> Recently we added an unknown value for the 'reset_dev_on_drv_probe' devlink
> parameter. Extend the 'fw_load_policy' parameter in the same way.
> 
> The only driver that uses this right now is the nfp driver.

Series applied to net-next, thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-11 11:08 [PATCH net-next 0/2] devlink: add unknown 'fw_load_policy' value Simon Horman
2019-09-11 11:08 ` [PATCH net-next 1/2] " Simon Horman
2019-09-11 11:08 ` [PATCH net-next 2/2] nfp: devlink: set unknown fw_load_policy Simon Horman
2019-09-11 14:10 ` [PATCH net-next 0/2] devlink: add unknown 'fw_load_policy' value David Miller

Netdev Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/netdev/0 netdev/git/0.git
	git clone --mirror https://lore.kernel.org/netdev/1 netdev/git/1.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 netdev netdev/ https://lore.kernel.org/netdev \
		netdev@vger.kernel.org netdev@archiver.kernel.org
	public-inbox-index netdev


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.netdev


AGPL code for this site: git clone https://public-inbox.org/ public-inbox