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