summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorIvan Vecera <ivecera@redhat.com>2023-10-18 14:35:55 +0200
committerJakub Kicinski <kuba@kernel.org>2023-10-19 09:03:56 -0700
commitf2cab25b0eb7bd735459059e2eb8d21d2569c41d (patch)
treed2add1ffdcff925edc1318f58e7befaafb514a8a /drivers
parent4b316e0700b6fdf585cacef2d7cb9f7d2a5275a0 (diff)
i40e: Align devlink info versions with ice driver and add docs
Align devlink info versions with ice driver so change 'fw.mgmt' version to be 2-digit version [major.minor], add 'fw.mgmt.build' that reports mgmt firmware build number and use '"fw.psid.api' for NVM format version instead of incorrect '"fw.psid'. Additionally add missing i40e devlink documentation. Fixes: 5a423552e0d9 ("i40e: Add handler for devlink .info_get") Signed-off-by: Ivan Vecera <ivecera@redhat.com> Reviewed-by: Jacob Keller <jacob.e.keller@intel.com> Link: https://lore.kernel.org/r/20231018123558.552453-1-ivecera@redhat.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_devlink.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e_devlink.c b/drivers/net/ethernet/intel/i40e/i40e_devlink.c
index 9168ade8da47..74bc111b4849 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_devlink.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_devlink.c
@@ -18,8 +18,14 @@ static void i40e_info_fw_mgmt(struct i40e_hw *hw, char *buf, size_t len)
{
struct i40e_adminq_info *aq = &hw->aq;
- snprintf(buf, len, "%u.%u.%05d",
- aq->fw_maj_ver, aq->fw_min_ver, aq->fw_build);
+ snprintf(buf, len, "%u.%u", aq->fw_maj_ver, aq->fw_min_ver);
+}
+
+static void i40e_info_fw_mgmt_build(struct i40e_hw *hw, char *buf, size_t len)
+{
+ struct i40e_adminq_info *aq = &hw->aq;
+
+ snprintf(buf, len, "%05d", aq->fw_build);
}
static void i40e_info_fw_api(struct i40e_hw *hw, char *buf, size_t len)
@@ -77,6 +83,12 @@ static int i40e_devlink_info_get(struct devlink *dl,
if (err)
return err;
+ i40e_info_fw_mgmt_build(hw, buf, sizeof(buf));
+ err = i40e_devlink_info_put(req, I40E_DL_VERSION_RUNNING,
+ "fw.mgmt.build", buf);
+ if (err)
+ return err;
+
i40e_info_fw_api(hw, buf, sizeof(buf));
err = i40e_devlink_info_put(req, I40E_DL_VERSION_RUNNING,
DEVLINK_INFO_VERSION_GENERIC_FW_MGMT_API,
@@ -86,7 +98,7 @@ static int i40e_devlink_info_get(struct devlink *dl,
i40e_info_nvm_ver(hw, buf, sizeof(buf));
err = i40e_devlink_info_put(req, I40E_DL_VERSION_RUNNING,
- DEVLINK_INFO_VERSION_GENERIC_FW_PSID, buf);
+ "fw.psid.api", buf);
if (err)
return err;