Skip to contentSkip to conversation

devlink: add unknown 'fw_load_policy' value

PATCH In review Simon Horman 2 participants 4 messages Sep 11, 2019

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

cover devlink: add unknown 'fw_load_policy' value

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(-)
Signature · 1 line
2.11.0
#1 lore raw

PATCH 1/2 devlink: add unknown 'fw_load_policy' value

From: Dirk van der Merwe <[email protected]>

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.

---
 include/uapi/linux/devlink.h | 1 +
 1 file changed, 1 insertion(+)
include/uapi/linux/devlink.h +1 -0
index 1da3e83f1fd4..8da5365850cd 100644
@@ -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 {
Signature · 1 line
2.11.0
#2 lore raw

PATCH 2/2 nfp: devlink: set unknown fw_load_policy

In reply to Simon Horman

From: Dirk van der Merwe <[email protected]>

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

---
 drivers/net/ethernet/netronome/nfp/devlink_param.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/netronome/nfp/devlink_param.c +2 -1
index 4a8141b4d625..36491835ac65 100644
@@ -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,
Signature · 1 line
2.11.0
maintainer
#3 lore raw
In reply to Simon Horman

From: Simon Horman <[email protected]>
Date: Wed, 11 Sep 2019 12:08:31 +0100

Quoted 6 lines

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.