devlink-info.rst 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. .. SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
  2. ============
  3. Devlink Info
  4. ============
  5. The ``devlink-info`` mechanism enables device drivers to report device
  6. (hardware and firmware) information in a standard, extensible fashion.
  7. The original motivation for the ``devlink-info`` API was twofold:
  8. - making it possible to automate device and firmware management in a fleet
  9. of machines in a vendor-independent fashion (see also
  10. :ref:`Documentation/networking/devlink/devlink-flash.rst <devlink_flash>`);
  11. - name the per component FW versions (as opposed to the crowded ethtool
  12. version string).
  13. ``devlink-info`` supports reporting multiple types of objects. Reporting driver
  14. versions is generally discouraged - here, and via any other Linux API.
  15. .. list-table:: List of top level info objects
  16. :widths: 5 95
  17. * - Name
  18. - Description
  19. * - ``driver``
  20. - Name of the currently used device driver, also available through sysfs.
  21. * - ``serial_number``
  22. - Serial number of the device.
  23. This is usually the serial number of the ASIC, also often available
  24. in PCI config space of the device in the *Device Serial Number*
  25. capability.
  26. The serial number should be unique per physical device.
  27. Sometimes the serial number of the device is only 48 bits long (the
  28. length of the Ethernet MAC address), and since PCI DSN is 64 bits long
  29. devices pad or encode additional information into the serial number.
  30. One example is adding port ID or PCI interface ID in the extra two bytes.
  31. Drivers should make sure to strip or normalize any such padding
  32. or interface ID, and report only the part of the serial number
  33. which uniquely identifies the hardware. In other words serial number
  34. reported for two ports of the same device or on two hosts of
  35. a multi-host device should be identical.
  36. * - ``board.serial_number``
  37. - Board serial number of the device.
  38. This is usually the serial number of the board, often available in
  39. PCI *Vital Product Data*.
  40. * - ``fixed``
  41. - Group for hardware identifiers, and versions of components
  42. which are not field-updatable.
  43. Versions in this section identify the device design. For example,
  44. component identifiers or the board version reported in the PCI VPD.
  45. Data in ``devlink-info`` should be broken into the smallest logical
  46. components, e.g. PCI VPD may concatenate various information
  47. to form the Part Number string, while in ``devlink-info`` all parts
  48. should be reported as separate items.
  49. This group must not contain any frequently changing identifiers,
  50. such as serial numbers. See
  51. :ref:`Documentation/networking/devlink/devlink-flash.rst <devlink_flash>`
  52. to understand why.
  53. * - ``running``
  54. - Group for information about currently running software/firmware.
  55. These versions often only update after a reboot, sometimes device reset.
  56. * - ``stored``
  57. - Group for software/firmware versions in device flash.
  58. Stored values must update to reflect changes in the flash even
  59. if reboot has not yet occurred. If device is not capable of updating
  60. ``stored`` versions when new software is flashed, it must not report
  61. them.
  62. Each version can be reported at most once in each version group. Firmware
  63. components stored on the flash should feature in both the ``running`` and
  64. ``stored`` sections, if device is capable of reporting ``stored`` versions
  65. (see :ref:`Documentation/networking/devlink/devlink-flash.rst <devlink_flash>`).
  66. In case software/firmware components are loaded from the disk (e.g.
  67. ``/lib/firmware``) only the running version should be reported via
  68. the kernel API.
  69. Please note that any security versions reported via devlink are purely
  70. informational. Devlink does not use a secure channel to communicate with
  71. the device.
  72. Generic Versions
  73. ================
  74. It is expected that drivers use the following generic names for exporting
  75. version information. If a generic name for a given component doesn't exist yet,
  76. driver authors should consult existing driver-specific versions and attempt
  77. reuse. As last resort, if a component is truly unique, using driver-specific
  78. names is allowed, but these should be documented in the driver-specific file.
  79. All versions should try to use the following terminology:
  80. .. list-table:: List of common version suffixes
  81. :widths: 10 90
  82. * - Name
  83. - Description
  84. * - ``id``, ``revision``
  85. - Identifiers of designs and revision, mostly used for hardware versions.
  86. * - ``api``
  87. - Version of API between components. API items are usually of limited
  88. value to the user, and can be inferred from other versions by the vendor,
  89. so adding API versions is generally discouraged as noise.
  90. * - ``bundle_id``
  91. - Identifier of a distribution package which was flashed onto the device.
  92. This is an attribute of a firmware package which covers multiple versions
  93. for ease of managing firmware images (see
  94. :ref:`Documentation/networking/devlink/devlink-flash.rst <devlink_flash>`).
  95. ``bundle_id`` can appear in both ``running`` and ``stored`` versions,
  96. but it must not be reported if any of the components covered by the
  97. ``bundle_id`` was changed and no longer matches the version from
  98. the bundle.
  99. board.id
  100. --------
  101. Unique identifier of the board design.
  102. board.rev
  103. ---------
  104. Board design revision.
  105. asic.id
  106. -------
  107. ASIC design identifier.
  108. asic.rev
  109. --------
  110. ASIC design revision/stepping.
  111. board.manufacture
  112. -----------------
  113. An identifier of the company or the facility which produced the part.
  114. board.part_number
  115. -----------------
  116. Part number of the board and its components.
  117. fw
  118. --
  119. Overall firmware version, often representing the collection of
  120. fw.mgmt, fw.app, etc.
  121. fw.mgmt
  122. -------
  123. Control unit firmware version. This firmware is responsible for house
  124. keeping tasks, PHY control etc. but not the packet-by-packet data path
  125. operation.
  126. fw.mgmt.api
  127. -----------
  128. Firmware interface specification version of the software interfaces between
  129. driver and firmware.
  130. fw.app
  131. ------
  132. Data path microcode controlling high-speed packet processing.
  133. fw.undi
  134. -------
  135. UNDI software, may include the UEFI driver, firmware or both.
  136. fw.ncsi
  137. -------
  138. Version of the software responsible for supporting/handling the
  139. Network Controller Sideband Interface.
  140. fw.psid
  141. -------
  142. Unique identifier of the firmware parameter set. These are usually
  143. parameters of a particular board, defined at manufacturing time.
  144. fw.roce
  145. -------
  146. RoCE firmware version which is responsible for handling roce
  147. management.
  148. fw.bundle_id
  149. ------------
  150. Unique identifier of the entire firmware bundle.
  151. fw.bootloader
  152. -------------
  153. Version of the bootloader.
  154. Future work
  155. ===========
  156. The following extensions could be useful:
  157. - on-disk firmware file names - drivers list the file names of firmware they
  158. may need to load onto devices via the ``MODULE_FIRMWARE()`` macro. These,
  159. however, are per module, rather than per device. It'd be useful to list
  160. the names of firmware files the driver will try to load for a given device,
  161. in order of priority.