Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Ivan Vecera and committed by
Jakub Kicinski
f2cab25b 4b316e07

+75 -3
+59
Documentation/networking/devlink/i40e.rst
··· 1 + .. SPDX-License-Identifier: GPL-2.0 2 + 3 + ==================== 4 + i40e devlink support 5 + ==================== 6 + 7 + This document describes the devlink features implemented by the ``i40e`` 8 + device driver. 9 + 10 + Info versions 11 + ============= 12 + 13 + The ``i40e`` driver reports the following versions 14 + 15 + .. list-table:: devlink info versions implemented 16 + :widths: 5 5 5 90 17 + 18 + * - Name 19 + - Type 20 + - Example 21 + - Description 22 + * - ``board.id`` 23 + - fixed 24 + - K15190-000 25 + - The Product Board Assembly (PBA) identifier of the board. 26 + * - ``fw.mgmt`` 27 + - running 28 + - 9.130 29 + - 2-digit version number of the management firmware that controls the 30 + PHY, link, etc. 31 + * - ``fw.mgmt.api`` 32 + - running 33 + - 1.15 34 + - 2-digit version number of the API exported over the AdminQ by the 35 + management firmware. Used by the driver to identify what commands 36 + are supported. 37 + * - ``fw.mgmt.build`` 38 + - running 39 + - 73618 40 + - Build number of the source for the management firmware. 41 + * - ``fw.undi`` 42 + - running 43 + - 1.3429.0 44 + - Version of the Option ROM containing the UEFI driver. The version is 45 + reported in ``major.minor.patch`` format. The major version is 46 + incremented whenever a major breaking change occurs, or when the 47 + minor version would overflow. The minor version is incremented for 48 + non-breaking changes and reset to 1 when the major version is 49 + incremented. The patch version is normally 0 but is incremented when 50 + a fix is delivered as a patch against an older base Option ROM. 51 + * - ``fw.psid.api`` 52 + - running 53 + - 9.30 54 + - Version defining the format of the flash contents. 55 + * - ``fw.bundle_id`` 56 + - running 57 + - 0x8000e5f3 58 + - Unique identifier of the firmware image file that was loaded onto 59 + the device. Also referred to as the EETRACK identifier of the NVM.
+1
Documentation/networking/devlink/index.rst
··· 80 80 bnxt 81 81 etas_es58x 82 82 hns3 83 + i40e 83 84 ionic 84 85 ice 85 86 mlx4
+15 -3
drivers/net/ethernet/intel/i40e/i40e_devlink.c
··· 18 18 { 19 19 struct i40e_adminq_info *aq = &hw->aq; 20 20 21 - snprintf(buf, len, "%u.%u.%05d", 22 - aq->fw_maj_ver, aq->fw_min_ver, aq->fw_build); 21 + snprintf(buf, len, "%u.%u", aq->fw_maj_ver, aq->fw_min_ver); 22 + } 23 + 24 + static void i40e_info_fw_mgmt_build(struct i40e_hw *hw, char *buf, size_t len) 25 + { 26 + struct i40e_adminq_info *aq = &hw->aq; 27 + 28 + snprintf(buf, len, "%05d", aq->fw_build); 23 29 } 24 30 25 31 static void i40e_info_fw_api(struct i40e_hw *hw, char *buf, size_t len) ··· 83 77 if (err) 84 78 return err; 85 79 80 + i40e_info_fw_mgmt_build(hw, buf, sizeof(buf)); 81 + err = i40e_devlink_info_put(req, I40E_DL_VERSION_RUNNING, 82 + "fw.mgmt.build", buf); 83 + if (err) 84 + return err; 85 + 86 86 i40e_info_fw_api(hw, buf, sizeof(buf)); 87 87 err = i40e_devlink_info_put(req, I40E_DL_VERSION_RUNNING, 88 88 DEVLINK_INFO_VERSION_GENERIC_FW_MGMT_API, ··· 98 86 99 87 i40e_info_nvm_ver(hw, buf, sizeof(buf)); 100 88 err = i40e_devlink_info_put(req, I40E_DL_VERSION_RUNNING, 101 - DEVLINK_INFO_VERSION_GENERIC_FW_PSID, buf); 89 + "fw.psid.api", buf); 102 90 if (err) 103 91 return err; 104 92