devlink-info.rst 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  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. Generic Versions
  70. ================
  71. It is expected that drivers use the following generic names for exporting
  72. version information. If a generic name for a given component doesn't exist yet,
  73. driver authors should consult existing driver-specific versions and attempt
  74. reuse. As last resort, if a component is truly unique, using driver-specific
  75. names is allowed, but these should be documented in the driver-specific file.
  76. All versions should try to use the following terminology:
  77. .. list-table:: List of common version suffixes
  78. :widths: 10 90
  79. * - Name
  80. - Description
  81. * - ``id``, ``revision``
  82. - Identifiers of designs and revision, mostly used for hardware versions.
  83. * - ``api``
  84. - Version of API between components. API items are usually of limited
  85. value to the user, and can be inferred from other versions by the vendor,
  86. so adding API versions is generally discouraged as noise.
  87. * - ``bundle_id``
  88. - Identifier of a distribution package which was flashed onto the device.
  89. This is an attribute of a firmware package which covers multiple versions
  90. for ease of managing firmware images (see
  91. :ref:`Documentation/networking/devlink/devlink-flash.rst <devlink_flash>`).
  92. ``bundle_id`` can appear in both ``running`` and ``stored`` versions,
  93. but it must not be reported if any of the components covered by the
  94. ``bundle_id`` was changed and no longer matches the version from
  95. the bundle.
  96. board.id
  97. --------
  98. Unique identifier of the board design.
  99. board.rev
  100. ---------
  101. Board design revision.
  102. asic.id
  103. -------
  104. ASIC design identifier.
  105. asic.rev
  106. --------
  107. ASIC design revision/stepping.
  108. board.manufacture
  109. -----------------
  110. An identifier of the company or the facility which produced the part.
  111. fw
  112. --
  113. Overall firmware version, often representing the collection of
  114. fw.mgmt, fw.app, etc.
  115. fw.mgmt
  116. -------
  117. Control unit firmware version. This firmware is responsible for house
  118. keeping tasks, PHY control etc. but not the packet-by-packet data path
  119. operation.
  120. fw.mgmt.api
  121. -----------
  122. Firmware interface specification version of the software interfaces between
  123. driver and firmware.
  124. fw.app
  125. ------
  126. Data path microcode controlling high-speed packet processing.
  127. fw.undi
  128. -------
  129. UNDI software, may include the UEFI driver, firmware or both.
  130. fw.ncsi
  131. -------
  132. Version of the software responsible for supporting/handling the
  133. Network Controller Sideband Interface.
  134. fw.psid
  135. -------
  136. Unique identifier of the firmware parameter set. These are usually
  137. parameters of a particular board, defined at manufacturing time.
  138. fw.roce
  139. -------
  140. RoCE firmware version which is responsible for handling roce
  141. management.
  142. fw.bundle_id
  143. ------------
  144. Unique identifier of the entire firmware bundle.
  145. Future work
  146. ===========
  147. The following extensions could be useful:
  148. - on-disk firmware file names - drivers list the file names of firmware they
  149. may need to load onto devices via the ``MODULE_FIRMWARE()`` macro. These,
  150. however, are per module, rather than per device. It'd be useful to list
  151. the names of firmware files the driver will try to load for a given device,
  152. in order of priority.