[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20181204101353.40459-3-shalomt@mellanox.com>
Date: Tue, 4 Dec 2018 10:14:08 +0000
From: Shalom Toledo <shalomt@...lanox.com>
To: "netdev@...r.kernel.org" <netdev@...r.kernel.org>
CC: "dsahern@...il.com" <dsahern@...il.com>,
"jakub.kicinski@...ronome.com" <jakub.kicinski@...ronome.com>,
mlxsw <mlxsw@...lanox.com>
Subject: [PATCH iproute2-next 2/2] devlink: Add support for 'fw_load_policy'
generic parameter
Add string to uint conversion for 'fw_load_policy' generic parameter.
Signed-off-by: Shalom Toledo <shalomt@...lanox.com>
Reviewed-by: Jiri Pirko <jiri@...lanox.com>
---
devlink/devlink.c | 13 ++++++++++++-
include/uapi/linux/devlink.h | 5 +++++
2 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/devlink/devlink.c b/devlink/devlink.c
index 1e3deb24d214..3651e90c1159 100644
--- a/devlink/devlink.c
+++ b/devlink/devlink.c
@@ -1972,7 +1972,18 @@ param_val_conv_str_get(const struct param_val_conv *param_val_conv,
return -ENOENT;
}
-static const struct param_val_conv param_val_conv[] = {};
+static const struct param_val_conv param_val_conv[] = {
+ {
+ .name = "fw_load_policy",
+ .vstr = "driver",
+ .vuint = DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_DRIVER,
+ },
+ {
+ .name = "fw_load_policy",
+ .vstr = "flash",
+ .vuint = DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_FLASH,
+ },
+};
#define PARAM_VAL_CONV_LEN ARRAY_SIZE(param_val_conv)
diff --git a/include/uapi/linux/devlink.h b/include/uapi/linux/devlink.h
index 5ee0e7397591..d0a33d79dc22 100644
--- a/include/uapi/linux/devlink.h
+++ b/include/uapi/linux/devlink.h
@@ -163,6 +163,11 @@ enum devlink_param_cmode {
DEVLINK_PARAM_CMODE_MAX = __DEVLINK_PARAM_CMODE_MAX - 1
};
+enum devlink_param_fw_load_policy_value {
+ DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_DRIVER,
+ DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_FLASH,
+};
+
enum devlink_attr {
/* don't change the order or add anything between, this is ABI! */
DEVLINK_ATTR_UNSPEC,
--
2.17.2
Powered by blists - more mailing lists