xref: /linux/Documentation/networking/devlink/devlink-info.rst (revision 621cde16e49b3ecf7d59a8106a20aaebfb4a59a9)
12dfaaae5SJacob Keller.. SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
22dfaaae5SJacob Keller
32dfaaae5SJacob Keller============
42dfaaae5SJacob KellerDevlink Info
52dfaaae5SJacob Keller============
62dfaaae5SJacob Keller
72dfaaae5SJacob KellerThe ``devlink-info`` mechanism enables device drivers to report device
8cd556e40SJakub Kicinski(hardware and firmware) information in a standard, extensible fashion.
92dfaaae5SJacob Keller
10cd556e40SJakub KicinskiThe original motivation for the ``devlink-info`` API was twofold:
112dfaaae5SJacob Keller
12cd556e40SJakub Kicinski - making it possible to automate device and firmware management in a fleet
13cd556e40SJakub Kicinski   of machines in a vendor-independent fashion (see also
14cd556e40SJakub Kicinski   :ref:`Documentation/networking/devlink/devlink-flash.rst <devlink_flash>`);
15cd556e40SJakub Kicinski - name the per component FW versions (as opposed to the crowded ethtool
16cd556e40SJakub Kicinski   version string).
17cd556e40SJakub Kicinski
18cd556e40SJakub Kicinski``devlink-info`` supports reporting multiple types of objects. Reporting driver
19cd556e40SJakub Kicinskiversions is generally discouraged - here, and via any other Linux API.
20cd556e40SJakub Kicinski
21cd556e40SJakub Kicinski.. list-table:: List of top level info objects
222dfaaae5SJacob Keller   :widths: 5 95
232dfaaae5SJacob Keller
24cd556e40SJakub Kicinski   * - Name
252dfaaae5SJacob Keller     - Description
26cd556e40SJakub Kicinski   * - ``driver``
27cd556e40SJakub Kicinski     - Name of the currently used device driver, also available through sysfs.
28cd556e40SJakub Kicinski
29cd556e40SJakub Kicinski   * - ``serial_number``
30cd556e40SJakub Kicinski     - Serial number of the device.
31cd556e40SJakub Kicinski
32cd556e40SJakub Kicinski       This is usually the serial number of the ASIC, also often available
33cd556e40SJakub Kicinski       in PCI config space of the device in the *Device Serial Number*
34cd556e40SJakub Kicinski       capability.
35cd556e40SJakub Kicinski
36cd556e40SJakub Kicinski       The serial number should be unique per physical device.
37cd556e40SJakub Kicinski       Sometimes the serial number of the device is only 48 bits long (the
38cd556e40SJakub Kicinski       length of the Ethernet MAC address), and since PCI DSN is 64 bits long
39cd556e40SJakub Kicinski       devices pad or encode additional information into the serial number.
40cd556e40SJakub Kicinski       One example is adding port ID or PCI interface ID in the extra two bytes.
41cd556e40SJakub Kicinski       Drivers should make sure to strip or normalize any such padding
42cd556e40SJakub Kicinski       or interface ID, and report only the part of the serial number
43cd556e40SJakub Kicinski       which uniquely identifies the hardware. In other words serial number
44cd556e40SJakub Kicinski       reported for two ports of the same device or on two hosts of
45cd556e40SJakub Kicinski       a multi-host device should be identical.
46cd556e40SJakub Kicinski
47b5872cd0SVasundhara Volam   * - ``board.serial_number``
48b5872cd0SVasundhara Volam     - Board serial number of the device.
49b5872cd0SVasundhara Volam
50b5872cd0SVasundhara Volam       This is usually the serial number of the board, often available in
51b5872cd0SVasundhara Volam       PCI *Vital Product Data*.
52cd556e40SJakub Kicinski
532dfaaae5SJacob Keller   * - ``fixed``
54cd556e40SJakub Kicinski     - Group for hardware identifiers, and versions of components
55cd556e40SJakub Kicinski       which are not field-updatable.
56cd556e40SJakub Kicinski
57cd556e40SJakub Kicinski       Versions in this section identify the device design. For example,
582dfaaae5SJacob Keller       component identifiers or the board version reported in the PCI VPD.
59cd556e40SJakub Kicinski       Data in ``devlink-info`` should be broken into the smallest logical
60cd556e40SJakub Kicinski       components, e.g. PCI VPD may concatenate various information
61cd556e40SJakub Kicinski       to form the Part Number string, while in ``devlink-info`` all parts
62cd556e40SJakub Kicinski       should be reported as separate items.
63cd556e40SJakub Kicinski
64cd556e40SJakub Kicinski       This group must not contain any frequently changing identifiers,
65cd556e40SJakub Kicinski       such as serial numbers. See
66cd556e40SJakub Kicinski       :ref:`Documentation/networking/devlink/devlink-flash.rst <devlink_flash>`
67cd556e40SJakub Kicinski       to understand why.
68cd556e40SJakub Kicinski
692dfaaae5SJacob Keller   * - ``running``
70cd556e40SJakub Kicinski     - Group for information about currently running software/firmware.
71cd556e40SJakub Kicinski       These versions often only update after a reboot, sometimes device reset.
72cd556e40SJakub Kicinski
732dfaaae5SJacob Keller   * - ``stored``
74cd556e40SJakub Kicinski     - Group for software/firmware versions in device flash.
75cd556e40SJakub Kicinski
76cd556e40SJakub Kicinski       Stored values must update to reflect changes in the flash even
77cd556e40SJakub Kicinski       if reboot has not yet occurred. If device is not capable of updating
78cd556e40SJakub Kicinski       ``stored`` versions when new software is flashed, it must not report
79cd556e40SJakub Kicinski       them.
80cd556e40SJakub Kicinski
81cd556e40SJakub KicinskiEach version can be reported at most once in each version group. Firmware
82cd556e40SJakub Kicinskicomponents stored on the flash should feature in both the ``running`` and
83cd556e40SJakub Kicinski``stored`` sections, if device is capable of reporting ``stored`` versions
84cd556e40SJakub Kicinski(see :ref:`Documentation/networking/devlink/devlink-flash.rst <devlink_flash>`).
85cd556e40SJakub KicinskiIn case software/firmware components are loaded from the disk (e.g.
86cd556e40SJakub Kicinski``/lib/firmware``) only the running version should be reported via
87cd556e40SJakub Kicinskithe kernel API.
882dfaaae5SJacob Keller
892dfaaae5SJacob KellerGeneric Versions
902dfaaae5SJacob Keller================
912dfaaae5SJacob Keller
922dfaaae5SJacob KellerIt is expected that drivers use the following generic names for exporting
93cd556e40SJakub Kicinskiversion information. If a generic name for a given component doesn't exist yet,
94cd556e40SJakub Kicinskidriver authors should consult existing driver-specific versions and attempt
95cd556e40SJakub Kicinskireuse. As last resort, if a component is truly unique, using driver-specific
96cd556e40SJakub Kicinskinames is allowed, but these should be documented in the driver-specific file.
97cd556e40SJakub Kicinski
98cd556e40SJakub KicinskiAll versions should try to use the following terminology:
99cd556e40SJakub Kicinski
100cd556e40SJakub Kicinski.. list-table:: List of common version suffixes
101cd556e40SJakub Kicinski   :widths: 10 90
102cd556e40SJakub Kicinski
103cd556e40SJakub Kicinski   * - Name
104cd556e40SJakub Kicinski     - Description
105cd556e40SJakub Kicinski   * - ``id``, ``revision``
106cd556e40SJakub Kicinski     - Identifiers of designs and revision, mostly used for hardware versions.
107cd556e40SJakub Kicinski
108cd556e40SJakub Kicinski   * - ``api``
109cd556e40SJakub Kicinski     - Version of API between components. API items are usually of limited
110cd556e40SJakub Kicinski       value to the user, and can be inferred from other versions by the vendor,
111cd556e40SJakub Kicinski       so adding API versions is generally discouraged as noise.
112cd556e40SJakub Kicinski
113cd556e40SJakub Kicinski   * - ``bundle_id``
114cd556e40SJakub Kicinski     - Identifier of a distribution package which was flashed onto the device.
115cd556e40SJakub Kicinski       This is an attribute of a firmware package which covers multiple versions
116cd556e40SJakub Kicinski       for ease of managing firmware images (see
117cd556e40SJakub Kicinski       :ref:`Documentation/networking/devlink/devlink-flash.rst <devlink_flash>`).
118cd556e40SJakub Kicinski
119cd556e40SJakub Kicinski       ``bundle_id`` can appear in both ``running`` and ``stored`` versions,
120cd556e40SJakub Kicinski       but it must not be reported if any of the components covered by the
121cd556e40SJakub Kicinski       ``bundle_id`` was changed and no longer matches the version from
122cd556e40SJakub Kicinski       the bundle.
1232dfaaae5SJacob Keller
1242dfaaae5SJacob Kellerboard.id
1252dfaaae5SJacob Keller--------
1262dfaaae5SJacob Keller
1272dfaaae5SJacob KellerUnique identifier of the board design.
1282dfaaae5SJacob Keller
1292dfaaae5SJacob Kellerboard.rev
1302dfaaae5SJacob Keller---------
1312dfaaae5SJacob Keller
1322dfaaae5SJacob KellerBoard design revision.
1332dfaaae5SJacob Keller
1342dfaaae5SJacob Kellerasic.id
1352dfaaae5SJacob Keller-------
1362dfaaae5SJacob Keller
1372dfaaae5SJacob KellerASIC design identifier.
1382dfaaae5SJacob Keller
1392dfaaae5SJacob Kellerasic.rev
1402dfaaae5SJacob Keller--------
1412dfaaae5SJacob Keller
142cd556e40SJakub KicinskiASIC design revision/stepping.
1432dfaaae5SJacob Keller
1442dfaaae5SJacob Kellerboard.manufacture
1452dfaaae5SJacob Keller-----------------
1462dfaaae5SJacob Keller
1472dfaaae5SJacob KellerAn identifier of the company or the facility which produced the part.
1482dfaaae5SJacob Keller
149*3bb946c9SFei Qinboard.part_number
150*3bb946c9SFei Qin-----------------
151*3bb946c9SFei Qin
152*3bb946c9SFei QinPart number of the board and its components.
153*3bb946c9SFei Qin
1542dfaaae5SJacob Kellerfw
1552dfaaae5SJacob Keller--
1562dfaaae5SJacob Keller
1572dfaaae5SJacob KellerOverall firmware version, often representing the collection of
1582dfaaae5SJacob Kellerfw.mgmt, fw.app, etc.
1592dfaaae5SJacob Keller
1602dfaaae5SJacob Kellerfw.mgmt
1612dfaaae5SJacob Keller-------
1622dfaaae5SJacob Keller
1632dfaaae5SJacob KellerControl unit firmware version. This firmware is responsible for house
1642dfaaae5SJacob Kellerkeeping tasks, PHY control etc. but not the packet-by-packet data path
1652dfaaae5SJacob Kelleroperation.
1662dfaaae5SJacob Keller
1672d9eade8SVasundhara Volamfw.mgmt.api
1682d9eade8SVasundhara Volam-----------
1692d9eade8SVasundhara Volam
1702d9eade8SVasundhara VolamFirmware interface specification version of the software interfaces between
1712d9eade8SVasundhara Volamdriver and firmware.
1722d9eade8SVasundhara Volam
1732dfaaae5SJacob Kellerfw.app
1742dfaaae5SJacob Keller------
1752dfaaae5SJacob Keller
1762dfaaae5SJacob KellerData path microcode controlling high-speed packet processing.
1772dfaaae5SJacob Keller
1782dfaaae5SJacob Kellerfw.undi
1792dfaaae5SJacob Keller-------
1802dfaaae5SJacob Keller
1812dfaaae5SJacob KellerUNDI software, may include the UEFI driver, firmware or both.
1822dfaaae5SJacob Keller
1832dfaaae5SJacob Kellerfw.ncsi
1842dfaaae5SJacob Keller-------
1852dfaaae5SJacob Keller
1862dfaaae5SJacob KellerVersion of the software responsible for supporting/handling the
1872dfaaae5SJacob KellerNetwork Controller Sideband Interface.
1882dfaaae5SJacob Keller
1892dfaaae5SJacob Kellerfw.psid
1902dfaaae5SJacob Keller-------
1912dfaaae5SJacob Keller
192cd556e40SJakub KicinskiUnique identifier of the firmware parameter set. These are usually
193cd556e40SJakub Kicinskiparameters of a particular board, defined at manufacturing time.
19441c0d917SVasundhara Volam
19541c0d917SVasundhara Volamfw.roce
19641c0d917SVasundhara Volam-------
19741c0d917SVasundhara Volam
19841c0d917SVasundhara VolamRoCE firmware version which is responsible for handling roce
19941c0d917SVasundhara Volammanagement.
200c90977a3SJacob Keller
201c90977a3SJacob Kellerfw.bundle_id
202c90977a3SJacob Keller------------
203c90977a3SJacob Keller
204c90977a3SJacob KellerUnique identifier of the entire firmware bundle.
205cd556e40SJakub Kicinski
20601d80532SVincent Mailholfw.bootloader
20701d80532SVincent Mailhol-------------
20801d80532SVincent Mailhol
20901d80532SVincent MailholVersion of the bootloader.
21001d80532SVincent Mailhol
211cd556e40SJakub KicinskiFuture work
212cd556e40SJakub Kicinski===========
213cd556e40SJakub Kicinski
214cd556e40SJakub KicinskiThe following extensions could be useful:
215cd556e40SJakub Kicinski
216cd556e40SJakub Kicinski - on-disk firmware file names - drivers list the file names of firmware they
217cd556e40SJakub Kicinski   may need to load onto devices via the ``MODULE_FIRMWARE()`` macro. These,
218cd556e40SJakub Kicinski   however, are per module, rather than per device. It'd be useful to list
219cd556e40SJakub Kicinski   the names of firmware files the driver will try to load for a given device,
220cd556e40SJakub Kicinski   in order of priority.
221