xref: /linux/Documentation/networking/ethtool-netlink.rst (revision 6dfafbd0299a60bfb5d5e277fdf100037c7ded07)
1=============================
2Netlink interface for ethtool
3=============================
4
5
6Basic information
7=================
8
9Netlink interface for ethtool uses generic netlink family ``ethtool``
10(userspace application should use macros ``ETHTOOL_GENL_NAME`` and
11``ETHTOOL_GENL_VERSION`` defined in ``<linux/ethtool_netlink.h>`` uapi
12header). This family does not use a specific header, all information in
13requests and replies is passed using netlink attributes.
14
15The ethtool netlink interface uses extended ACK for error and warning
16reporting, userspace application developers are encouraged to make these
17messages available to user in a suitable way.
18
19Requests can be divided into three categories: "get" (retrieving information),
20"set" (setting parameters) and "action" (invoking an action).
21
22All "set" and "action" type requests require admin privileges
23(``CAP_NET_ADMIN`` in the namespace). Most "get" type requests are allowed for
24anyone but there are exceptions (where the response contains sensitive
25information). In some cases, the request as such is allowed for anyone but
26unprivileged users have attributes with sensitive information (e.g.
27wake-on-lan password) omitted.
28
29
30Conventions
31===========
32
33Attributes which represent a boolean value usually use NLA_U8 type so that we
34can distinguish three states: "on", "off" and "not present" (meaning the
35information is not available in "get" requests or value is not to be changed
36in "set" requests). For these attributes, the "true" value should be passed as
37number 1 but any non-zero value should be understood as "true" by recipient.
38In the tables below, "bool" denotes NLA_U8 attributes interpreted in this way.
39
40In the message structure descriptions below, if an attribute name is suffixed
41with "+", parent nest can contain multiple attributes of the same type. This
42implements an array of entries.
43
44Attributes that need to be filled-in by device drivers and that are dumped to
45user space based on whether they are valid or not should not use zero as a
46valid value. This avoids the need to explicitly signal the validity of the
47attribute in the device driver API.
48
49
50Request header
51==============
52
53Each request or reply message contains a nested attribute with common header.
54Structure of this header is
55
56  ==============================  ======  =============================
57  ``ETHTOOL_A_HEADER_DEV_INDEX``  u32     device ifindex
58  ``ETHTOOL_A_HEADER_DEV_NAME``   string  device name
59  ``ETHTOOL_A_HEADER_FLAGS``      u32     flags common for all requests
60  ``ETHTOOL_A_HEADER_PHY_INDEX``  u32     phy device index
61  ==============================  ======  =============================
62
63``ETHTOOL_A_HEADER_DEV_INDEX`` and ``ETHTOOL_A_HEADER_DEV_NAME`` identify the
64device message relates to. One of them is sufficient in requests, if both are
65used, they must identify the same device. Some requests, e.g. global string
66sets, do not require device identification. Most ``GET`` requests also allow
67dump requests without device identification to query the same information for
68all devices providing it (each device in a separate message).
69
70``ETHTOOL_A_HEADER_FLAGS`` is a bitmap of request flags common for all request
71types. The interpretation of these flags is the same for all request types but
72the flags may not apply to requests. Recognized flags are:
73
74  =================================  ===================================
75  ``ETHTOOL_FLAG_COMPACT_BITSETS``   use compact format bitsets in reply
76  ``ETHTOOL_FLAG_OMIT_REPLY``        omit optional reply (_SET and _ACT)
77  ``ETHTOOL_FLAG_STATS``             include optional device statistics
78  =================================  ===================================
79
80New request flags should follow the general idea that if the flag is not set,
81the behaviour is backward compatible, i.e. requests from old clients not aware
82of the flag should be interpreted the way the client expects. A client must
83not set flags it does not understand.
84
85``ETHTOOL_A_HEADER_PHY_INDEX`` identifies the Ethernet PHY the message relates to.
86As there are numerous commands that are related to PHY configuration, and because
87there may be more than one PHY on the link, the PHY index can be passed in the
88request for the commands that needs it. It is, however, not mandatory, and if it
89is not passed for commands that target a PHY, the net_device.phydev pointer
90is used.
91
92Bit sets
93========
94
95For short bitmaps of (reasonably) fixed length, standard ``NLA_BITFIELD32``
96type is used. For arbitrary length bitmaps, ethtool netlink uses a nested
97attribute with contents of one of two forms: compact (two binary bitmaps
98representing bit values and mask of affected bits) and bit-by-bit (list of
99bits identified by either index or name).
100
101Verbose (bit-by-bit) bitsets allow sending symbolic names for bits together
102with their values which saves a round trip (when the bitset is passed in a
103request) or at least a second request (when the bitset is in a reply). This is
104useful for one shot applications like traditional ethtool command. On the
105other hand, long running applications like ethtool monitor (displaying
106notifications) or network management daemons may prefer fetching the names
107only once and using compact form to save message size. Notifications from
108ethtool netlink interface always use compact form for bitsets.
109
110A bitset can represent either a value/mask pair (``ETHTOOL_A_BITSET_NOMASK``
111not set) or a single bitmap (``ETHTOOL_A_BITSET_NOMASK`` set). In requests
112modifying a bitmap, the former changes the bit set in mask to values set in
113value and preserves the rest; the latter sets the bits set in the bitmap and
114clears the rest.
115
116Compact form: nested (bitset) attribute contents:
117
118  ============================  ======  ============================
119  ``ETHTOOL_A_BITSET_NOMASK``   flag    no mask, only a list
120  ``ETHTOOL_A_BITSET_SIZE``     u32     number of significant bits
121  ``ETHTOOL_A_BITSET_VALUE``    binary  bitmap of bit values
122  ``ETHTOOL_A_BITSET_MASK``     binary  bitmap of valid bits
123  ============================  ======  ============================
124
125Value and mask must have length at least ``ETHTOOL_A_BITSET_SIZE`` bits
126rounded up to a multiple of 32 bits. They consist of 32-bit words in host byte
127order, words ordered from least significant to most significant (i.e. the same
128way as bitmaps are passed with ioctl interface).
129
130For compact form, ``ETHTOOL_A_BITSET_SIZE`` and ``ETHTOOL_A_BITSET_VALUE`` are
131mandatory. ``ETHTOOL_A_BITSET_MASK`` attribute is mandatory if
132``ETHTOOL_A_BITSET_NOMASK`` is not set (bitset represents a value/mask pair);
133if ``ETHTOOL_A_BITSET_NOMASK`` is not set, ``ETHTOOL_A_BITSET_MASK`` is not
134allowed (bitset represents a single bitmap.
135
136Kernel bit set length may differ from userspace length if older application is
137used on newer kernel or vice versa. If userspace bitmap is longer, an error is
138issued only if the request actually tries to set values of some bits not
139recognized by kernel.
140
141Bit-by-bit form: nested (bitset) attribute contents:
142
143 +------------------------------------+--------+-----------------------------+
144 | ``ETHTOOL_A_BITSET_NOMASK``        | flag   | no mask, only a list        |
145 +------------------------------------+--------+-----------------------------+
146 | ``ETHTOOL_A_BITSET_SIZE``          | u32    | number of significant bits  |
147 +------------------------------------+--------+-----------------------------+
148 | ``ETHTOOL_A_BITSET_BITS``          | nested | array of bits               |
149 +-+----------------------------------+--------+-----------------------------+
150 | | ``ETHTOOL_A_BITSET_BITS_BIT+``   | nested | one bit                     |
151 +-+-+--------------------------------+--------+-----------------------------+
152 | | | ``ETHTOOL_A_BITSET_BIT_INDEX`` | u32    | bit index (0 for LSB)       |
153 +-+-+--------------------------------+--------+-----------------------------+
154 | | | ``ETHTOOL_A_BITSET_BIT_NAME``  | string | bit name                    |
155 +-+-+--------------------------------+--------+-----------------------------+
156 | | | ``ETHTOOL_A_BITSET_BIT_VALUE`` | flag   | present if bit is set       |
157 +-+-+--------------------------------+--------+-----------------------------+
158
159Bit size is optional for bit-by-bit form. ``ETHTOOL_A_BITSET_BITS`` nest can
160only contain ``ETHTOOL_A_BITSET_BITS_BIT`` attributes but there can be an
161arbitrary number of them.  A bit may be identified by its index or by its
162name. When used in requests, listed bits are set to 0 or 1 according to
163``ETHTOOL_A_BITSET_BIT_VALUE``, the rest is preserved. A request fails if
164index exceeds kernel bit length or if name is not recognized.
165
166When ``ETHTOOL_A_BITSET_NOMASK`` flag is present, bitset is interpreted as
167a simple bitmap. ``ETHTOOL_A_BITSET_BIT_VALUE`` attributes are not used in
168such case. Such bitset represents a bitmap with listed bits set and the rest
169zero.
170
171In requests, application can use either form. Form used by kernel in reply is
172determined by ``ETHTOOL_FLAG_COMPACT_BITSETS`` flag in flags field of request
173header. Semantics of value and mask depends on the attribute.
174
175
176List of message types
177=====================
178
179All constants identifying message types use ``ETHTOOL_CMD_`` prefix and suffix
180according to message purpose:
181
182  ==============    ======================================
183  ``_GET``          userspace request to retrieve data
184  ``_SET``          userspace request to set data
185  ``_ACT``          userspace request to perform an action
186  ``_GET_REPLY``    kernel reply to a ``GET`` request
187  ``_SET_REPLY``    kernel reply to a ``SET`` request
188  ``_ACT_REPLY``    kernel reply to an ``ACT`` request
189  ``_NTF``          kernel notification
190  ==============    ======================================
191
192Userspace to kernel:
193
194  ===================================== =================================
195  ``ETHTOOL_MSG_STRSET_GET``            get string set
196  ``ETHTOOL_MSG_LINKINFO_GET``          get link settings
197  ``ETHTOOL_MSG_LINKINFO_SET``          set link settings
198  ``ETHTOOL_MSG_LINKMODES_GET``         get link modes info
199  ``ETHTOOL_MSG_LINKMODES_SET``         set link modes info
200  ``ETHTOOL_MSG_LINKSTATE_GET``         get link state
201  ``ETHTOOL_MSG_DEBUG_GET``             get debugging settings
202  ``ETHTOOL_MSG_DEBUG_SET``             set debugging settings
203  ``ETHTOOL_MSG_WOL_GET``               get wake-on-lan settings
204  ``ETHTOOL_MSG_WOL_SET``               set wake-on-lan settings
205  ``ETHTOOL_MSG_FEATURES_GET``          get device features
206  ``ETHTOOL_MSG_FEATURES_SET``          set device features
207  ``ETHTOOL_MSG_PRIVFLAGS_GET``         get private flags
208  ``ETHTOOL_MSG_PRIVFLAGS_SET``         set private flags
209  ``ETHTOOL_MSG_RINGS_GET``             get ring sizes
210  ``ETHTOOL_MSG_RINGS_SET``             set ring sizes
211  ``ETHTOOL_MSG_CHANNELS_GET``          get channel counts
212  ``ETHTOOL_MSG_CHANNELS_SET``          set channel counts
213  ``ETHTOOL_MSG_COALESCE_GET``          get coalescing parameters
214  ``ETHTOOL_MSG_COALESCE_SET``          set coalescing parameters
215  ``ETHTOOL_MSG_PAUSE_GET``             get pause parameters
216  ``ETHTOOL_MSG_PAUSE_SET``             set pause parameters
217  ``ETHTOOL_MSG_EEE_GET``               get EEE settings
218  ``ETHTOOL_MSG_EEE_SET``               set EEE settings
219  ``ETHTOOL_MSG_TSINFO_GET``		get timestamping info
220  ``ETHTOOL_MSG_CABLE_TEST_ACT``        action start cable test
221  ``ETHTOOL_MSG_CABLE_TEST_TDR_ACT``    action start raw TDR cable test
222  ``ETHTOOL_MSG_TUNNEL_INFO_GET``       get tunnel offload info
223  ``ETHTOOL_MSG_FEC_GET``               get FEC settings
224  ``ETHTOOL_MSG_FEC_SET``               set FEC settings
225  ``ETHTOOL_MSG_MODULE_EEPROM_GET``     read SFP module EEPROM
226  ``ETHTOOL_MSG_STATS_GET``             get standard statistics
227  ``ETHTOOL_MSG_PHC_VCLOCKS_GET``       get PHC virtual clocks info
228  ``ETHTOOL_MSG_MODULE_SET``            set transceiver module parameters
229  ``ETHTOOL_MSG_MODULE_GET``            get transceiver module parameters
230  ``ETHTOOL_MSG_PSE_SET``               set PSE parameters
231  ``ETHTOOL_MSG_PSE_GET``               get PSE parameters
232  ``ETHTOOL_MSG_RSS_GET``               get RSS settings
233  ``ETHTOOL_MSG_PLCA_GET_CFG``          get PLCA RS parameters
234  ``ETHTOOL_MSG_PLCA_SET_CFG``          set PLCA RS parameters
235  ``ETHTOOL_MSG_PLCA_GET_STATUS``       get PLCA RS status
236  ``ETHTOOL_MSG_MM_GET``                get MAC merge layer state
237  ``ETHTOOL_MSG_MM_SET``                set MAC merge layer parameters
238  ``ETHTOOL_MSG_MODULE_FW_FLASH_ACT``   flash transceiver module firmware
239  ``ETHTOOL_MSG_PHY_GET``               get Ethernet PHY information
240  ``ETHTOOL_MSG_TSCONFIG_GET``          get hw timestamping configuration
241  ``ETHTOOL_MSG_TSCONFIG_SET``          set hw timestamping configuration
242  ``ETHTOOL_MSG_RSS_SET``               set RSS settings
243  ``ETHTOOL_MSG_RSS_CREATE_ACT``        create an additional RSS context
244  ``ETHTOOL_MSG_RSS_DELETE_ACT``        delete an additional RSS context
245  ``ETHTOOL_MSG_MSE_GET``               get MSE diagnostic data
246  ===================================== =================================
247
248Kernel to userspace:
249
250  ======================================== =================================
251  ``ETHTOOL_MSG_STRSET_GET_REPLY``         string set contents
252  ``ETHTOOL_MSG_LINKINFO_GET_REPLY``       link settings
253  ``ETHTOOL_MSG_LINKINFO_NTF``             link settings notification
254  ``ETHTOOL_MSG_LINKMODES_GET_REPLY``      link modes info
255  ``ETHTOOL_MSG_LINKMODES_NTF``            link modes notification
256  ``ETHTOOL_MSG_LINKSTATE_GET_REPLY``      link state info
257  ``ETHTOOL_MSG_DEBUG_GET_REPLY``          debugging settings
258  ``ETHTOOL_MSG_DEBUG_NTF``                debugging settings notification
259  ``ETHTOOL_MSG_WOL_GET_REPLY``            wake-on-lan settings
260  ``ETHTOOL_MSG_WOL_NTF``                  wake-on-lan settings notification
261  ``ETHTOOL_MSG_FEATURES_GET_REPLY``       device features
262  ``ETHTOOL_MSG_FEATURES_SET_REPLY``       optional reply to FEATURES_SET
263  ``ETHTOOL_MSG_FEATURES_NTF``             netdev features notification
264  ``ETHTOOL_MSG_PRIVFLAGS_GET_REPLY``      private flags
265  ``ETHTOOL_MSG_PRIVFLAGS_NTF``            private flags
266  ``ETHTOOL_MSG_RINGS_GET_REPLY``          ring sizes
267  ``ETHTOOL_MSG_RINGS_NTF``                ring sizes
268  ``ETHTOOL_MSG_CHANNELS_GET_REPLY``       channel counts
269  ``ETHTOOL_MSG_CHANNELS_NTF``             channel counts
270  ``ETHTOOL_MSG_COALESCE_GET_REPLY``       coalescing parameters
271  ``ETHTOOL_MSG_COALESCE_NTF``             coalescing parameters
272  ``ETHTOOL_MSG_PAUSE_GET_REPLY``          pause parameters
273  ``ETHTOOL_MSG_PAUSE_NTF``                pause parameters
274  ``ETHTOOL_MSG_EEE_GET_REPLY``            EEE settings
275  ``ETHTOOL_MSG_EEE_NTF``                  EEE settings
276  ``ETHTOOL_MSG_TSINFO_GET_REPLY``         timestamping info
277  ``ETHTOOL_MSG_CABLE_TEST_NTF``           Cable test results
278  ``ETHTOOL_MSG_CABLE_TEST_TDR_NTF``       Cable test TDR results
279  ``ETHTOOL_MSG_TUNNEL_INFO_GET_REPLY``    tunnel offload info
280  ``ETHTOOL_MSG_FEC_GET_REPLY``            FEC settings
281  ``ETHTOOL_MSG_FEC_NTF``                  FEC settings
282  ``ETHTOOL_MSG_MODULE_EEPROM_GET_REPLY``  read SFP module EEPROM
283  ``ETHTOOL_MSG_STATS_GET_REPLY``          standard statistics
284  ``ETHTOOL_MSG_PHC_VCLOCKS_GET_REPLY``    PHC virtual clocks info
285  ``ETHTOOL_MSG_MODULE_GET_REPLY``         transceiver module parameters
286  ``ETHTOOL_MSG_PSE_GET_REPLY``            PSE parameters
287  ``ETHTOOL_MSG_RSS_GET_REPLY``            RSS settings
288  ``ETHTOOL_MSG_RSS_NTF``                  RSS settings
289  ``ETHTOOL_MSG_PLCA_GET_CFG_REPLY``       PLCA RS parameters
290  ``ETHTOOL_MSG_PLCA_GET_STATUS_REPLY``    PLCA RS status
291  ``ETHTOOL_MSG_PLCA_NTF``                 PLCA RS parameters
292  ``ETHTOOL_MSG_MM_GET_REPLY``             MAC merge layer status
293  ``ETHTOOL_MSG_MODULE_FW_FLASH_NTF``      transceiver module flash updates
294  ``ETHTOOL_MSG_PHY_GET_REPLY``            Ethernet PHY information
295  ``ETHTOOL_MSG_PHY_NTF``                  Ethernet PHY information change
296  ``ETHTOOL_MSG_TSCONFIG_GET_REPLY``       hw timestamping configuration
297  ``ETHTOOL_MSG_TSCONFIG_SET_REPLY``       new hw timestamping configuration
298  ``ETHTOOL_MSG_PSE_NTF``                  PSE events notification
299  ``ETHTOOL_MSG_RSS_NTF``                  RSS settings notification
300  ``ETHTOOL_MSG_RSS_CREATE_ACT_REPLY``     create an additional RSS context
301  ``ETHTOOL_MSG_RSS_CREATE_NTF``           additional RSS context created
302  ``ETHTOOL_MSG_RSS_DELETE_NTF``           additional RSS context deleted
303  ``ETHTOOL_MSG_MSE_GET_REPLY``            MSE diagnostic data
304  ======================================== =================================
305
306``GET`` requests are sent by userspace applications to retrieve device
307information. They usually do not contain any message specific attributes.
308Kernel replies with corresponding "GET_REPLY" message. For most types, ``GET``
309request with ``NLM_F_DUMP`` and no device identification can be used to query
310the information for all devices supporting the request.
311
312If the data can be also modified, corresponding ``SET`` message with the same
313layout as corresponding ``GET_REPLY`` is used to request changes. Only
314attributes where a change is requested are included in such request (also, not
315all attributes may be changed). Replies to most ``SET`` request consist only
316of error code and extack; if kernel provides additional data, it is sent in
317the form of corresponding ``SET_REPLY`` message which can be suppressed by
318setting ``ETHTOOL_FLAG_OMIT_REPLY`` flag in request header.
319
320Data modification also triggers sending a ``NTF`` message with a notification.
321These usually bear only a subset of attributes which was affected by the
322change. The same notification is issued if the data is modified using other
323means (mostly ioctl ethtool interface). Unlike notifications from ethtool
324netlink code which are only sent if something actually changed, notifications
325triggered by ioctl interface may be sent even if the request did not actually
326change any data.
327
328``ACT`` messages request kernel (driver) to perform a specific action. If some
329information is reported by kernel (which can be suppressed by setting
330``ETHTOOL_FLAG_OMIT_REPLY`` flag in request header), the reply takes form of
331an ``ACT_REPLY`` message. Performing an action also triggers a notification
332(``NTF`` message).
333
334Later sections describe the format and semantics of these messages.
335
336
337STRSET_GET
338==========
339
340Requests contents of a string set as provided by ioctl commands
341``ETHTOOL_GSSET_INFO`` and ``ETHTOOL_GSTRINGS.`` String sets are not user
342writeable so that the corresponding ``STRSET_SET`` message is only used in
343kernel replies. There are two types of string sets: global (independent of
344a device, e.g. device feature names) and device specific (e.g. device private
345flags).
346
347Request contents:
348
349 +---------------------------------------+--------+------------------------+
350 | ``ETHTOOL_A_STRSET_HEADER``           | nested | request header         |
351 +---------------------------------------+--------+------------------------+
352 | ``ETHTOOL_A_STRSET_STRINGSETS``       | nested | string set to request  |
353 +-+-------------------------------------+--------+------------------------+
354 | | ``ETHTOOL_A_STRINGSETS_STRINGSET+`` | nested | one string set         |
355 +-+-+-----------------------------------+--------+------------------------+
356 | | | ``ETHTOOL_A_STRINGSET_ID``        | u32    | set id                 |
357 +-+-+-----------------------------------+--------+------------------------+
358
359Kernel response contents:
360
361 +---------------------------------------+--------+-----------------------+
362 | ``ETHTOOL_A_STRSET_HEADER``           | nested | reply header          |
363 +---------------------------------------+--------+-----------------------+
364 | ``ETHTOOL_A_STRSET_STRINGSETS``       | nested | array of string sets  |
365 +-+-------------------------------------+--------+-----------------------+
366 | | ``ETHTOOL_A_STRINGSETS_STRINGSET+`` | nested | one string set        |
367 +-+-+-----------------------------------+--------+-----------------------+
368 | | | ``ETHTOOL_A_STRINGSET_ID``        | u32    | set id                |
369 +-+-+-----------------------------------+--------+-----------------------+
370 | | | ``ETHTOOL_A_STRINGSET_COUNT``     | u32    | number of strings     |
371 +-+-+-----------------------------------+--------+-----------------------+
372 | | | ``ETHTOOL_A_STRINGSET_STRINGS``   | nested | array of strings      |
373 +-+-+-+---------------------------------+--------+-----------------------+
374 | | | | ``ETHTOOL_A_STRINGS_STRING+``   | nested | one string            |
375 +-+-+-+-+-------------------------------+--------+-----------------------+
376 | | | | | ``ETHTOOL_A_STRING_INDEX``    | u32    | string index          |
377 +-+-+-+-+-------------------------------+--------+-----------------------+
378 | | | | | ``ETHTOOL_A_STRING_VALUE``    | string | string value          |
379 +-+-+-+-+-------------------------------+--------+-----------------------+
380 | ``ETHTOOL_A_STRSET_COUNTS_ONLY``      | flag   | return only counts    |
381 +---------------------------------------+--------+-----------------------+
382
383Device identification in request header is optional. Depending on its presence
384a and ``NLM_F_DUMP`` flag, there are three type of ``STRSET_GET`` requests:
385
386 - no ``NLM_F_DUMP,`` no device: get "global" stringsets
387 - no ``NLM_F_DUMP``, with device: get string sets related to the device
388 - ``NLM_F_DUMP``, no device: get device related string sets for all devices
389
390If there is no ``ETHTOOL_A_STRSET_STRINGSETS`` array, all string sets of
391requested type are returned, otherwise only those specified in the request.
392Flag ``ETHTOOL_A_STRSET_COUNTS_ONLY`` tells kernel to only return string
393counts of the sets, not the actual strings.
394
395
396LINKINFO_GET
397============
398
399Requests link settings as provided by ``ETHTOOL_GLINKSETTINGS`` except for
400link modes and autonegotiation related information. The request does not use
401any attributes.
402
403Request contents:
404
405  ====================================  ======  ==========================
406  ``ETHTOOL_A_LINKINFO_HEADER``         nested  request header
407  ====================================  ======  ==========================
408
409Kernel response contents:
410
411  ====================================  ======  ==========================
412  ``ETHTOOL_A_LINKINFO_HEADER``         nested  reply header
413  ``ETHTOOL_A_LINKINFO_PORT``           u8      physical port
414  ``ETHTOOL_A_LINKINFO_PHYADDR``        u8      phy MDIO address
415  ``ETHTOOL_A_LINKINFO_TP_MDIX``        u8      MDI(-X) status
416  ``ETHTOOL_A_LINKINFO_TP_MDIX_CTRL``   u8      MDI(-X) control
417  ``ETHTOOL_A_LINKINFO_TRANSCEIVER``    u8      transceiver
418  ====================================  ======  ==========================
419
420Attributes and their values have the same meaning as matching members of the
421corresponding ioctl structures.
422
423``LINKINFO_GET`` allows dump requests (kernel returns reply message for all
424devices supporting the request).
425
426
427LINKINFO_SET
428============
429
430``LINKINFO_SET`` request allows setting some of the attributes reported by
431``LINKINFO_GET``.
432
433Request contents:
434
435  ====================================  ======  ==========================
436  ``ETHTOOL_A_LINKINFO_HEADER``         nested  request header
437  ``ETHTOOL_A_LINKINFO_PORT``           u8      physical port
438  ``ETHTOOL_A_LINKINFO_PHYADDR``        u8      phy MDIO address
439  ``ETHTOOL_A_LINKINFO_TP_MDIX_CTRL``   u8      MDI(-X) control
440  ====================================  ======  ==========================
441
442MDI(-X) status and transceiver cannot be set, request with the corresponding
443attributes is rejected.
444
445
446LINKMODES_GET
447=============
448
449Requests link modes (supported, advertised and peer advertised) and related
450information (autonegotiation status, link speed and duplex) as provided by
451``ETHTOOL_GLINKSETTINGS``. The request does not use any attributes.
452
453Request contents:
454
455  ====================================  ======  ==========================
456  ``ETHTOOL_A_LINKMODES_HEADER``        nested  request header
457  ====================================  ======  ==========================
458
459Kernel response contents:
460
461  ==========================================  ======  ==========================
462  ``ETHTOOL_A_LINKMODES_HEADER``              nested  reply header
463  ``ETHTOOL_A_LINKMODES_AUTONEG``             u8      autonegotiation status
464  ``ETHTOOL_A_LINKMODES_OURS``                bitset  advertised link modes
465  ``ETHTOOL_A_LINKMODES_PEER``                bitset  partner link modes
466  ``ETHTOOL_A_LINKMODES_SPEED``               u32     link speed (Mb/s)
467  ``ETHTOOL_A_LINKMODES_DUPLEX``              u8      duplex mode
468  ``ETHTOOL_A_LINKMODES_MASTER_SLAVE_CFG``    u8      Master/slave port mode
469  ``ETHTOOL_A_LINKMODES_MASTER_SLAVE_STATE``  u8      Master/slave port state
470  ``ETHTOOL_A_LINKMODES_RATE_MATCHING``       u8      PHY rate matching
471  ==========================================  ======  ==========================
472
473For ``ETHTOOL_A_LINKMODES_OURS``, value represents advertised modes and mask
474represents supported modes. ``ETHTOOL_A_LINKMODES_PEER`` in the reply is a bit
475list.
476
477``LINKMODES_GET`` allows dump requests (kernel returns reply messages for all
478devices supporting the request).
479
480
481LINKMODES_SET
482=============
483
484Request contents:
485
486  ==========================================  ======  ==========================
487  ``ETHTOOL_A_LINKMODES_HEADER``              nested  request header
488  ``ETHTOOL_A_LINKMODES_AUTONEG``             u8      autonegotiation status
489  ``ETHTOOL_A_LINKMODES_OURS``                bitset  advertised link modes
490  ``ETHTOOL_A_LINKMODES_PEER``                bitset  partner link modes
491  ``ETHTOOL_A_LINKMODES_SPEED``               u32     link speed (Mb/s)
492  ``ETHTOOL_A_LINKMODES_DUPLEX``              u8      duplex mode
493  ``ETHTOOL_A_LINKMODES_MASTER_SLAVE_CFG``    u8      Master/slave port mode
494  ``ETHTOOL_A_LINKMODES_RATE_MATCHING``       u8      PHY rate matching
495  ``ETHTOOL_A_LINKMODES_LANES``               u32     lanes
496  ==========================================  ======  ==========================
497
498``ETHTOOL_A_LINKMODES_OURS`` bit set allows setting advertised link modes. If
499autonegotiation is on (either set now or kept from before), advertised modes
500are not changed (no ``ETHTOOL_A_LINKMODES_OURS`` attribute) and at least one
501of speed, duplex and lanes is specified, kernel adjusts advertised modes to all
502supported modes matching speed, duplex, lanes or all (whatever is specified).
503This autoselection is done on ethtool side with ioctl interface, netlink
504interface is supposed to allow requesting changes without knowing what exactly
505kernel supports.
506
507
508LINKSTATE_GET
509=============
510
511Requests link state information. Link up/down flag (as provided by
512``ETHTOOL_GLINK`` ioctl command) is provided. Optionally, extended state might
513be provided as well. In general, extended state describes reasons for why a port
514is down, or why it operates in some non-obvious mode. This request does not have
515any attributes.
516
517Request contents:
518
519  ====================================  ======  ==========================
520  ``ETHTOOL_A_LINKSTATE_HEADER``        nested  request header
521  ====================================  ======  ==========================
522
523Kernel response contents:
524
525  ====================================  ======  ============================
526  ``ETHTOOL_A_LINKSTATE_HEADER``        nested  reply header
527  ``ETHTOOL_A_LINKSTATE_LINK``          bool    link state (up/down)
528  ``ETHTOOL_A_LINKSTATE_SQI``           u32     Current Signal Quality Index
529  ``ETHTOOL_A_LINKSTATE_SQI_MAX``       u32     Max support SQI value
530  ``ETHTOOL_A_LINKSTATE_EXT_STATE``     u8      link extended state
531  ``ETHTOOL_A_LINKSTATE_EXT_SUBSTATE``  u8      link extended substate
532  ``ETHTOOL_A_LINKSTATE_EXT_DOWN_CNT``  u32     count of link down events
533  ====================================  ======  ============================
534
535For most NIC drivers, the value of ``ETHTOOL_A_LINKSTATE_LINK`` returns
536carrier flag provided by ``netif_carrier_ok()`` but there are drivers which
537define their own handler.
538
539``ETHTOOL_A_LINKSTATE_EXT_STATE`` and ``ETHTOOL_A_LINKSTATE_EXT_SUBSTATE`` are
540optional values. ethtool core can provide either both
541``ETHTOOL_A_LINKSTATE_EXT_STATE`` and ``ETHTOOL_A_LINKSTATE_EXT_SUBSTATE``,
542or only ``ETHTOOL_A_LINKSTATE_EXT_STATE``, or none of them.
543
544``LINKSTATE_GET`` allows dump requests (kernel returns reply messages for all
545devices supporting the request).
546
547
548Link extended states:
549
550  ================================================      ============================================
551  ``ETHTOOL_LINK_EXT_STATE_AUTONEG``                    States relating to the autonegotiation or
552                                                        issues therein
553
554  ``ETHTOOL_LINK_EXT_STATE_LINK_TRAINING_FAILURE``      Failure during link training
555
556  ``ETHTOOL_LINK_EXT_STATE_LINK_LOGICAL_MISMATCH``      Logical mismatch in physical coding sublayer
557                                                        or forward error correction sublayer
558
559  ``ETHTOOL_LINK_EXT_STATE_BAD_SIGNAL_INTEGRITY``       Signal integrity issues
560
561  ``ETHTOOL_LINK_EXT_STATE_NO_CABLE``                   No cable connected
562
563  ``ETHTOOL_LINK_EXT_STATE_CABLE_ISSUE``                Failure is related to cable,
564                                                        e.g., unsupported cable
565
566  ``ETHTOOL_LINK_EXT_STATE_EEPROM_ISSUE``               Failure is related to EEPROM, e.g., failure
567                                                        during reading or parsing the data
568
569  ``ETHTOOL_LINK_EXT_STATE_CALIBRATION_FAILURE``        Failure during calibration algorithm
570
571  ``ETHTOOL_LINK_EXT_STATE_POWER_BUDGET_EXCEEDED``      The hardware is not able to provide the
572                                                        power required from cable or module
573
574  ``ETHTOOL_LINK_EXT_STATE_OVERHEAT``                   The module is overheated
575
576  ``ETHTOOL_LINK_EXT_STATE_MODULE``                     Transceiver module issue
577  ================================================      ============================================
578
579Link extended substates:
580
581  Autoneg substates:
582
583  ===============================================================   ================================
584  ``ETHTOOL_LINK_EXT_SUBSTATE_AN_NO_PARTNER_DETECTED``              Peer side is down
585
586  ``ETHTOOL_LINK_EXT_SUBSTATE_AN_ACK_NOT_RECEIVED``                 Ack not received from peer side
587
588  ``ETHTOOL_LINK_EXT_SUBSTATE_AN_NEXT_PAGE_EXCHANGE_FAILED``        Next page exchange failed
589
590  ``ETHTOOL_LINK_EXT_SUBSTATE_AN_NO_PARTNER_DETECTED_FORCE_MODE``   Peer side is down during force
591                                                                    mode or there is no agreement of
592                                                                    speed
593
594  ``ETHTOOL_LINK_EXT_SUBSTATE_AN_FEC_MISMATCH_DURING_OVERRIDE``     Forward error correction modes
595                                                                    in both sides are mismatched
596
597  ``ETHTOOL_LINK_EXT_SUBSTATE_AN_NO_HCD``                           No Highest Common Denominator
598  ===============================================================   ================================
599
600  Link training substates:
601
602  ===========================================================================   ====================
603  ``ETHTOOL_LINK_EXT_SUBSTATE_LT_KR_FRAME_LOCK_NOT_ACQUIRED``                    Frames were not
604                                                                                 recognized, the
605                                                                                 lock failed
606
607  ``ETHTOOL_LINK_EXT_SUBSTATE_LT_KR_LINK_INHIBIT_TIMEOUT``                       The lock did not
608                                                                                 occur before
609                                                                                 timeout
610
611  ``ETHTOOL_LINK_EXT_SUBSTATE_LT_KR_LINK_PARTNER_DID_NOT_SET_RECEIVER_READY``    Peer side did not
612                                                                                 send ready signal
613                                                                                 after training
614                                                                                 process
615
616  ``ETHTOOL_LINK_EXT_SUBSTATE_LT_REMOTE_FAULT``                                  Remote side is not
617                                                                                 ready yet
618  ===========================================================================   ====================
619
620  Link logical mismatch substates:
621
622  ================================================================   ===============================
623  ``ETHTOOL_LINK_EXT_SUBSTATE_LLM_PCS_DID_NOT_ACQUIRE_BLOCK_LOCK``   Physical coding sublayer was
624                                                                     not locked in first phase -
625                                                                     block lock
626
627  ``ETHTOOL_LINK_EXT_SUBSTATE_LLM_PCS_DID_NOT_ACQUIRE_AM_LOCK``      Physical coding sublayer was
628                                                                     not locked in second phase -
629                                                                     alignment markers lock
630
631  ``ETHTOOL_LINK_EXT_SUBSTATE_LLM_PCS_DID_NOT_GET_ALIGN_STATUS``     Physical coding sublayer did
632                                                                     not get align status
633
634  ``ETHTOOL_LINK_EXT_SUBSTATE_LLM_FC_FEC_IS_NOT_LOCKED``             FC forward error correction is
635                                                                     not locked
636
637  ``ETHTOOL_LINK_EXT_SUBSTATE_LLM_RS_FEC_IS_NOT_LOCKED``             RS forward error correction is
638                                                                     not locked
639  ================================================================   ===============================
640
641  Bad signal integrity substates:
642
643  =================================================================    =============================
644  ``ETHTOOL_LINK_EXT_SUBSTATE_BSI_LARGE_NUMBER_OF_PHYSICAL_ERRORS``    Large number of physical
645                                                                       errors
646
647  ``ETHTOOL_LINK_EXT_SUBSTATE_BSI_UNSUPPORTED_RATE``                   The system attempted to
648                                                                       operate the cable at a rate
649                                                                       that is not formally
650                                                                       supported, which led to
651                                                                       signal integrity issues
652
653  ``ETHTOOL_LINK_EXT_SUBSTATE_BSI_SERDES_REFERENCE_CLOCK_LOST``        The external clock signal for
654                                                                       SerDes is too weak or
655                                                                       unavailable.
656
657  ``ETHTOOL_LINK_EXT_SUBSTATE_BSI_SERDES_ALOS``                        The received signal for
658                                                                       SerDes is too weak because
659                                                                       analog loss of signal.
660  =================================================================    =============================
661
662  Cable issue substates:
663
664  ===================================================   ============================================
665  ``ETHTOOL_LINK_EXT_SUBSTATE_CI_UNSUPPORTED_CABLE``    Unsupported cable
666
667  ``ETHTOOL_LINK_EXT_SUBSTATE_CI_CABLE_TEST_FAILURE``   Cable test failure
668  ===================================================   ============================================
669
670  Transceiver module issue substates:
671
672  ===================================================   ============================================
673  ``ETHTOOL_LINK_EXT_SUBSTATE_MODULE_CMIS_NOT_READY``   The CMIS Module State Machine did not reach
674                                                        the ModuleReady state. For example, if the
675                                                        module is stuck at ModuleFault state
676  ===================================================   ============================================
677
678DEBUG_GET
679=========
680
681Requests debugging settings of a device. At the moment, only message mask is
682provided.
683
684Request contents:
685
686  ====================================  ======  ==========================
687  ``ETHTOOL_A_DEBUG_HEADER``            nested  request header
688  ====================================  ======  ==========================
689
690Kernel response contents:
691
692  ====================================  ======  ==========================
693  ``ETHTOOL_A_DEBUG_HEADER``            nested  reply header
694  ``ETHTOOL_A_DEBUG_MSGMASK``           bitset  message mask
695  ====================================  ======  ==========================
696
697The message mask (``ETHTOOL_A_DEBUG_MSGMASK``) is equal to message level as
698provided by ``ETHTOOL_GMSGLVL`` and set by ``ETHTOOL_SMSGLVL`` in ioctl
699interface. While it is called message level there for historical reasons, most
700drivers and almost all newer drivers use it as a mask of enabled message
701classes (represented by ``NETIF_MSG_*`` constants); therefore netlink
702interface follows its actual use in practice.
703
704``DEBUG_GET`` allows dump requests (kernel returns reply messages for all
705devices supporting the request).
706
707
708DEBUG_SET
709=========
710
711Set or update debugging settings of a device. At the moment, only message mask
712is supported.
713
714Request contents:
715
716  ====================================  ======  ==========================
717  ``ETHTOOL_A_DEBUG_HEADER``            nested  request header
718  ``ETHTOOL_A_DEBUG_MSGMASK``           bitset  message mask
719  ====================================  ======  ==========================
720
721``ETHTOOL_A_DEBUG_MSGMASK`` bit set allows setting or modifying mask of
722enabled debugging message types for the device.
723
724
725WOL_GET
726=======
727
728Query device wake-on-lan settings. Unlike most "GET" type requests,
729``ETHTOOL_MSG_WOL_GET`` requires (netns) ``CAP_NET_ADMIN`` privileges as it
730(potentially) provides SecureOn(tm) password which is confidential.
731
732Request contents:
733
734  ====================================  ======  ==========================
735  ``ETHTOOL_A_WOL_HEADER``              nested  request header
736  ====================================  ======  ==========================
737
738Kernel response contents:
739
740  ====================================  ======  ==========================
741  ``ETHTOOL_A_WOL_HEADER``              nested  reply header
742  ``ETHTOOL_A_WOL_MODES``               bitset  mask of enabled WoL modes
743  ``ETHTOOL_A_WOL_SOPASS``              binary  SecureOn(tm) password
744  ====================================  ======  ==========================
745
746In reply, ``ETHTOOL_A_WOL_MODES`` mask consists of modes supported by the
747device, value of modes which are enabled. ``ETHTOOL_A_WOL_SOPASS`` is only
748included in reply if ``WAKE_MAGICSECURE`` mode is supported.
749
750
751WOL_SET
752=======
753
754Set or update wake-on-lan settings.
755
756Request contents:
757
758  ====================================  ======  ==========================
759  ``ETHTOOL_A_WOL_HEADER``              nested  request header
760  ``ETHTOOL_A_WOL_MODES``               bitset  enabled WoL modes
761  ``ETHTOOL_A_WOL_SOPASS``              binary  SecureOn(tm) password
762  ====================================  ======  ==========================
763
764``ETHTOOL_A_WOL_SOPASS`` is only allowed for devices supporting
765``WAKE_MAGICSECURE`` mode.
766
767
768FEATURES_GET
769============
770
771Gets netdev features like ``ETHTOOL_GFEATURES`` ioctl request.
772
773Request contents:
774
775  ====================================  ======  ==========================
776  ``ETHTOOL_A_FEATURES_HEADER``         nested  request header
777  ====================================  ======  ==========================
778
779Kernel response contents:
780
781  ====================================  ======  ==========================
782  ``ETHTOOL_A_FEATURES_HEADER``         nested  reply header
783  ``ETHTOOL_A_FEATURES_HW``             bitset  dev->hw_features
784  ``ETHTOOL_A_FEATURES_WANTED``         bitset  dev->wanted_features
785  ``ETHTOOL_A_FEATURES_ACTIVE``         bitset  dev->features
786  ``ETHTOOL_A_FEATURES_NOCHANGE``       bitset  NETIF_F_NEVER_CHANGE
787  ====================================  ======  ==========================
788
789Bitmaps in kernel response have the same meaning as bitmaps used in ioctl
790interference but attribute names are different (they are based on
791corresponding members of struct net_device). Legacy "flags" are not provided,
792if userspace needs them (most likely only ethtool for backward compatibility),
793it can calculate their values from related feature bits itself.
794ETHA_FEATURES_HW uses mask consisting of all features recognized by kernel (to
795provide all names when using verbose bitmap format), the other three use no
796mask (simple bit lists).
797
798
799FEATURES_SET
800============
801
802Request to set netdev features like ``ETHTOOL_SFEATURES`` ioctl request.
803
804Request contents:
805
806  ====================================  ======  ==========================
807  ``ETHTOOL_A_FEATURES_HEADER``         nested  request header
808  ``ETHTOOL_A_FEATURES_WANTED``         bitset  requested features
809  ====================================  ======  ==========================
810
811Kernel response contents:
812
813  ====================================  ======  ==========================
814  ``ETHTOOL_A_FEATURES_HEADER``         nested  reply header
815  ``ETHTOOL_A_FEATURES_WANTED``         bitset  diff wanted vs. result
816  ``ETHTOOL_A_FEATURES_ACTIVE``         bitset  diff old vs. new active
817  ====================================  ======  ==========================
818
819Request contains only one bitset which can be either value/mask pair (request
820to change specific feature bits and leave the rest) or only a value (request
821to set all features to specified set).
822
823As request is subject to netdev_change_features() sanity checks, optional
824kernel reply (can be suppressed by ``ETHTOOL_FLAG_OMIT_REPLY`` flag in request
825header) informs client about the actual result. ``ETHTOOL_A_FEATURES_WANTED``
826reports the difference between client request and actual result: mask consists
827of bits which differ between requested features and result (dev->features
828after the operation), value consists of values of these bits in the request
829(i.e. negated values from resulting features). ``ETHTOOL_A_FEATURES_ACTIVE``
830reports the difference between old and new dev->features: mask consists of
831bits which have changed, values are their values in new dev->features (after
832the operation).
833
834``ETHTOOL_MSG_FEATURES_NTF`` notification is sent not only if device features
835are modified using ``ETHTOOL_MSG_FEATURES_SET`` request or on of ethtool ioctl
836request but also each time features are modified with netdev_update_features()
837or netdev_change_features().
838
839
840PRIVFLAGS_GET
841=============
842
843Gets private flags like ``ETHTOOL_GPFLAGS`` ioctl request.
844
845Request contents:
846
847  ====================================  ======  ==========================
848  ``ETHTOOL_A_PRIVFLAGS_HEADER``        nested  request header
849  ====================================  ======  ==========================
850
851Kernel response contents:
852
853  ====================================  ======  ==========================
854  ``ETHTOOL_A_PRIVFLAGS_HEADER``        nested  reply header
855  ``ETHTOOL_A_PRIVFLAGS_FLAGS``         bitset  private flags
856  ====================================  ======  ==========================
857
858``ETHTOOL_A_PRIVFLAGS_FLAGS`` is a bitset with values of device private flags.
859These flags are defined by driver, their number and names (and also meaning)
860are device dependent. For compact bitset format, names can be retrieved as
861``ETH_SS_PRIV_FLAGS`` string set. If verbose bitset format is requested,
862response uses all private flags supported by the device as mask so that client
863gets the full information without having to fetch the string set with names.
864
865
866PRIVFLAGS_SET
867=============
868
869Sets or modifies values of device private flags like ``ETHTOOL_SPFLAGS``
870ioctl request.
871
872Request contents:
873
874  ====================================  ======  ==========================
875  ``ETHTOOL_A_PRIVFLAGS_HEADER``        nested  request header
876  ``ETHTOOL_A_PRIVFLAGS_FLAGS``         bitset  private flags
877  ====================================  ======  ==========================
878
879``ETHTOOL_A_PRIVFLAGS_FLAGS`` can either set the whole set of private flags or
880modify only values of some of them.
881
882
883RINGS_GET
884=========
885
886Gets ring sizes like ``ETHTOOL_GRINGPARAM`` ioctl request.
887
888Request contents:
889
890  ====================================  ======  ==========================
891  ``ETHTOOL_A_RINGS_HEADER``            nested  request header
892  ====================================  ======  ==========================
893
894Kernel response contents:
895
896  =======================================   ======  ===========================
897  ``ETHTOOL_A_RINGS_HEADER``                nested  reply header
898  ``ETHTOOL_A_RINGS_RX_MAX``                u32     max size of RX ring
899  ``ETHTOOL_A_RINGS_RX_MINI_MAX``           u32     max size of RX mini ring
900  ``ETHTOOL_A_RINGS_RX_JUMBO_MAX``          u32     max size of RX jumbo ring
901  ``ETHTOOL_A_RINGS_TX_MAX``                u32     max size of TX ring
902  ``ETHTOOL_A_RINGS_RX``                    u32     size of RX ring
903  ``ETHTOOL_A_RINGS_RX_MINI``               u32     size of RX mini ring
904  ``ETHTOOL_A_RINGS_RX_JUMBO``              u32     size of RX jumbo ring
905  ``ETHTOOL_A_RINGS_TX``                    u32     size of TX ring
906  ``ETHTOOL_A_RINGS_RX_BUF_LEN``            u32     size of buffers on the ring
907  ``ETHTOOL_A_RINGS_TCP_DATA_SPLIT``        u8      TCP header / data split
908  ``ETHTOOL_A_RINGS_CQE_SIZE``              u32     Size of TX/RX CQE
909  ``ETHTOOL_A_RINGS_TX_PUSH``               u8      flag of TX Push mode
910  ``ETHTOOL_A_RINGS_RX_PUSH``               u8      flag of RX Push mode
911  ``ETHTOOL_A_RINGS_TX_PUSH_BUF_LEN``       u32     size of TX push buffer
912  ``ETHTOOL_A_RINGS_TX_PUSH_BUF_LEN_MAX``   u32     max size of TX push buffer
913  ``ETHTOOL_A_RINGS_HDS_THRESH``            u32     threshold of
914                                                    header / data split
915  ``ETHTOOL_A_RINGS_HDS_THRESH_MAX``        u32     max threshold of
916                                                    header / data split
917  =======================================   ======  ===========================
918
919``ETHTOOL_A_RINGS_TCP_DATA_SPLIT`` indicates whether the device is usable with
920page-flipping TCP zero-copy receive (``getsockopt(TCP_ZEROCOPY_RECEIVE)``).
921If enabled the device is configured to place frame headers and data into
922separate buffers. The device configuration must make it possible to receive
923full memory pages of data, for example because MTU is high enough or through
924HW-GRO.
925
926``ETHTOOL_A_RINGS_[RX|TX]_PUSH`` flag is used to enable descriptor fast
927path to send or receive packets. In ordinary path, driver fills descriptors in DRAM and
928notifies NIC hardware. In fast path, driver pushes descriptors to the device
929through MMIO writes, thus reducing the latency. However, enabling this feature
930may increase the CPU cost. Drivers may enforce additional per-packet
931eligibility checks (e.g. on packet size).
932
933``ETHTOOL_A_RINGS_TX_PUSH_BUF_LEN`` specifies the maximum number of bytes of a
934transmitted packet a driver can push directly to the underlying device
935('push' mode). Pushing some of the payload bytes to the device has the
936advantages of reducing latency for small packets by avoiding DMA mapping (same
937as ``ETHTOOL_A_RINGS_TX_PUSH`` parameter) as well as allowing the underlying
938device to process packet headers ahead of fetching its payload.
939This can help the device to make fast actions based on the packet's headers.
940This is similar to the "tx-copybreak" parameter, which copies the packet to a
941preallocated DMA memory area instead of mapping new memory. However,
942tx-push-buff parameter copies the packet directly to the device to allow the
943device to take faster actions on the packet.
944
945RINGS_SET
946=========
947
948Sets ring sizes like ``ETHTOOL_SRINGPARAM`` ioctl request.
949
950Request contents:
951
952  ====================================  ======  ===========================
953  ``ETHTOOL_A_RINGS_HEADER``            nested  reply header
954  ``ETHTOOL_A_RINGS_RX``                u32     size of RX ring
955  ``ETHTOOL_A_RINGS_RX_MINI``           u32     size of RX mini ring
956  ``ETHTOOL_A_RINGS_RX_JUMBO``          u32     size of RX jumbo ring
957  ``ETHTOOL_A_RINGS_TX``                u32     size of TX ring
958  ``ETHTOOL_A_RINGS_RX_BUF_LEN``        u32     size of buffers on the ring
959  ``ETHTOOL_A_RINGS_TCP_DATA_SPLIT``    u8      TCP header / data split
960  ``ETHTOOL_A_RINGS_CQE_SIZE``          u32     Size of TX/RX CQE
961  ``ETHTOOL_A_RINGS_TX_PUSH``           u8      flag of TX Push mode
962  ``ETHTOOL_A_RINGS_RX_PUSH``           u8      flag of RX Push mode
963  ``ETHTOOL_A_RINGS_TX_PUSH_BUF_LEN``   u32     size of TX push buffer
964  ``ETHTOOL_A_RINGS_HDS_THRESH``        u32     threshold of header / data split
965  ====================================  ======  ===========================
966
967Kernel checks that requested ring sizes do not exceed limits reported by
968driver. Driver may impose additional constraints and may not support all
969attributes.
970
971
972``ETHTOOL_A_RINGS_CQE_SIZE`` specifies the completion queue event size.
973Completion queue events (CQE) are the events posted by NIC to indicate the
974completion status of a packet when the packet is sent (like send success or
975error) or received (like pointers to packet fragments). The CQE size parameter
976enables to modify the CQE size other than default size if NIC supports it.
977A bigger CQE can have more receive buffer pointers, and in turn the NIC can
978transfer a bigger frame from wire. Based on the NIC hardware, the overall
979completion queue size can be adjusted in the driver if CQE size is modified.
980
981``ETHTOOL_A_RINGS_HDS_THRESH`` specifies the threshold value of
982header / data split feature. If a received packet size is larger than this
983threshold value, header and data will be split.
984
985CHANNELS_GET
986============
987
988Gets channel counts like ``ETHTOOL_GCHANNELS`` ioctl request.
989
990Request contents:
991
992  ====================================  ======  ==========================
993  ``ETHTOOL_A_CHANNELS_HEADER``         nested  request header
994  ====================================  ======  ==========================
995
996Kernel response contents:
997
998  =====================================  ======  ==========================
999  ``ETHTOOL_A_CHANNELS_HEADER``          nested  reply header
1000  ``ETHTOOL_A_CHANNELS_RX_MAX``          u32     max receive channels
1001  ``ETHTOOL_A_CHANNELS_TX_MAX``          u32     max transmit channels
1002  ``ETHTOOL_A_CHANNELS_OTHER_MAX``       u32     max other channels
1003  ``ETHTOOL_A_CHANNELS_COMBINED_MAX``    u32     max combined channels
1004  ``ETHTOOL_A_CHANNELS_RX_COUNT``        u32     receive channel count
1005  ``ETHTOOL_A_CHANNELS_TX_COUNT``        u32     transmit channel count
1006  ``ETHTOOL_A_CHANNELS_OTHER_COUNT``     u32     other channel count
1007  ``ETHTOOL_A_CHANNELS_COMBINED_COUNT``  u32     combined channel count
1008  =====================================  ======  ==========================
1009
1010
1011CHANNELS_SET
1012============
1013
1014Sets channel counts like ``ETHTOOL_SCHANNELS`` ioctl request.
1015
1016Request contents:
1017
1018  =====================================  ======  ==========================
1019  ``ETHTOOL_A_CHANNELS_HEADER``          nested  request header
1020  ``ETHTOOL_A_CHANNELS_RX_COUNT``        u32     receive channel count
1021  ``ETHTOOL_A_CHANNELS_TX_COUNT``        u32     transmit channel count
1022  ``ETHTOOL_A_CHANNELS_OTHER_COUNT``     u32     other channel count
1023  ``ETHTOOL_A_CHANNELS_COMBINED_COUNT``  u32     combined channel count
1024  =====================================  ======  ==========================
1025
1026Kernel checks that requested channel counts do not exceed limits reported by
1027driver. Driver may impose additional constraints and may not support all
1028attributes.
1029
1030
1031COALESCE_GET
1032============
1033
1034Gets coalescing parameters like ``ETHTOOL_GCOALESCE`` ioctl request.
1035
1036Request contents:
1037
1038  ====================================  ======  ==========================
1039  ``ETHTOOL_A_COALESCE_HEADER``         nested  request header
1040  ====================================  ======  ==========================
1041
1042Kernel response contents:
1043
1044  ===========================================  ======  =======================
1045  ``ETHTOOL_A_COALESCE_HEADER``                nested  reply header
1046  ``ETHTOOL_A_COALESCE_RX_USECS``              u32     delay (us), normal Rx
1047  ``ETHTOOL_A_COALESCE_RX_MAX_FRAMES``         u32     max packets, normal Rx
1048  ``ETHTOOL_A_COALESCE_RX_USECS_IRQ``          u32     delay (us), Rx in IRQ
1049  ``ETHTOOL_A_COALESCE_RX_MAX_FRAMES_IRQ``     u32     max packets, Rx in IRQ
1050  ``ETHTOOL_A_COALESCE_TX_USECS``              u32     delay (us), normal Tx
1051  ``ETHTOOL_A_COALESCE_TX_MAX_FRAMES``         u32     max packets, normal Tx
1052  ``ETHTOOL_A_COALESCE_TX_USECS_IRQ``          u32     delay (us), Tx in IRQ
1053  ``ETHTOOL_A_COALESCE_TX_MAX_FRAMES_IRQ``     u32     IRQ packets, Tx in IRQ
1054  ``ETHTOOL_A_COALESCE_STATS_BLOCK_USECS``     u32     delay of stats update
1055  ``ETHTOOL_A_COALESCE_USE_ADAPTIVE_RX``       bool    adaptive Rx coalesce
1056  ``ETHTOOL_A_COALESCE_USE_ADAPTIVE_TX``       bool    adaptive Tx coalesce
1057  ``ETHTOOL_A_COALESCE_PKT_RATE_LOW``          u32     threshold for low rate
1058  ``ETHTOOL_A_COALESCE_RX_USECS_LOW``          u32     delay (us), low Rx
1059  ``ETHTOOL_A_COALESCE_RX_MAX_FRAMES_LOW``     u32     max packets, low Rx
1060  ``ETHTOOL_A_COALESCE_TX_USECS_LOW``          u32     delay (us), low Tx
1061  ``ETHTOOL_A_COALESCE_TX_MAX_FRAMES_LOW``     u32     max packets, low Tx
1062  ``ETHTOOL_A_COALESCE_PKT_RATE_HIGH``         u32     threshold for high rate
1063  ``ETHTOOL_A_COALESCE_RX_USECS_HIGH``         u32     delay (us), high Rx
1064  ``ETHTOOL_A_COALESCE_RX_MAX_FRAMES_HIGH``    u32     max packets, high Rx
1065  ``ETHTOOL_A_COALESCE_TX_USECS_HIGH``         u32     delay (us), high Tx
1066  ``ETHTOOL_A_COALESCE_TX_MAX_FRAMES_HIGH``    u32     max packets, high Tx
1067  ``ETHTOOL_A_COALESCE_RATE_SAMPLE_INTERVAL``  u32     rate sampling interval
1068  ``ETHTOOL_A_COALESCE_USE_CQE_TX``            bool    timer reset mode, Tx
1069  ``ETHTOOL_A_COALESCE_USE_CQE_RX``            bool    timer reset mode, Rx
1070  ``ETHTOOL_A_COALESCE_TX_AGGR_MAX_BYTES``     u32     max aggr size, Tx
1071  ``ETHTOOL_A_COALESCE_TX_AGGR_MAX_FRAMES``    u32     max aggr packets, Tx
1072  ``ETHTOOL_A_COALESCE_TX_AGGR_TIME_USECS``    u32     time (us), aggr, Tx
1073  ``ETHTOOL_A_COALESCE_RX_PROFILE``            nested  profile of DIM, Rx
1074  ``ETHTOOL_A_COALESCE_TX_PROFILE``            nested  profile of DIM, Tx
1075  ===========================================  ======  =======================
1076
1077Attributes are only included in reply if their value is not zero or the
1078corresponding bit in ``ethtool_ops::supported_coalesce_params`` is set (i.e.
1079they are declared as supported by driver).
1080
1081Timer reset mode (``ETHTOOL_A_COALESCE_USE_CQE_TX`` and
1082``ETHTOOL_A_COALESCE_USE_CQE_RX``) controls the interaction between packet
1083arrival and the various time based delay parameters. By default timers are
1084expected to limit the max delay between any packet arrival/departure and a
1085corresponding interrupt. In this mode timer should be started by packet
1086arrival (sometimes delivery of previous interrupt) and reset when interrupt
1087is delivered.
1088Setting the appropriate attribute to 1 will enable ``CQE`` mode, where
1089each packet event resets the timer. In this mode timer is used to force
1090the interrupt if queue goes idle, while busy queues depend on the packet
1091limit to trigger interrupts.
1092
1093Tx aggregation consists of copying frames into a contiguous buffer so that they
1094can be submitted as a single IO operation. ``ETHTOOL_A_COALESCE_TX_AGGR_MAX_BYTES``
1095describes the maximum size in bytes for the submitted buffer.
1096``ETHTOOL_A_COALESCE_TX_AGGR_MAX_FRAMES`` describes the maximum number of frames
1097that can be aggregated into a single buffer.
1098``ETHTOOL_A_COALESCE_TX_AGGR_TIME_USECS`` describes the amount of time in usecs,
1099counted since the first packet arrival in an aggregated block, after which the
1100block should be sent.
1101This feature is mainly of interest for specific USB devices which does not cope
1102well with frequent small-sized URBs transmissions.
1103
1104``ETHTOOL_A_COALESCE_RX_PROFILE`` and ``ETHTOOL_A_COALESCE_TX_PROFILE`` refer
1105to DIM parameters, see `Generic Network Dynamic Interrupt Moderation (Net DIM)
1106<https://www.kernel.org/doc/Documentation/networking/net_dim.rst>`_.
1107
1108COALESCE_SET
1109============
1110
1111Sets coalescing parameters like ``ETHTOOL_SCOALESCE`` ioctl request.
1112
1113Request contents:
1114
1115  ===========================================  ======  =======================
1116  ``ETHTOOL_A_COALESCE_HEADER``                nested  request header
1117  ``ETHTOOL_A_COALESCE_RX_USECS``              u32     delay (us), normal Rx
1118  ``ETHTOOL_A_COALESCE_RX_MAX_FRAMES``         u32     max packets, normal Rx
1119  ``ETHTOOL_A_COALESCE_RX_USECS_IRQ``          u32     delay (us), Rx in IRQ
1120  ``ETHTOOL_A_COALESCE_RX_MAX_FRAMES_IRQ``     u32     max packets, Rx in IRQ
1121  ``ETHTOOL_A_COALESCE_TX_USECS``              u32     delay (us), normal Tx
1122  ``ETHTOOL_A_COALESCE_TX_MAX_FRAMES``         u32     max packets, normal Tx
1123  ``ETHTOOL_A_COALESCE_TX_USECS_IRQ``          u32     delay (us), Tx in IRQ
1124  ``ETHTOOL_A_COALESCE_TX_MAX_FRAMES_IRQ``     u32     IRQ packets, Tx in IRQ
1125  ``ETHTOOL_A_COALESCE_STATS_BLOCK_USECS``     u32     delay of stats update
1126  ``ETHTOOL_A_COALESCE_USE_ADAPTIVE_RX``       bool    adaptive Rx coalesce
1127  ``ETHTOOL_A_COALESCE_USE_ADAPTIVE_TX``       bool    adaptive Tx coalesce
1128  ``ETHTOOL_A_COALESCE_PKT_RATE_LOW``          u32     threshold for low rate
1129  ``ETHTOOL_A_COALESCE_RX_USECS_LOW``          u32     delay (us), low Rx
1130  ``ETHTOOL_A_COALESCE_RX_MAX_FRAMES_LOW``     u32     max packets, low Rx
1131  ``ETHTOOL_A_COALESCE_TX_USECS_LOW``          u32     delay (us), low Tx
1132  ``ETHTOOL_A_COALESCE_TX_MAX_FRAMES_LOW``     u32     max packets, low Tx
1133  ``ETHTOOL_A_COALESCE_PKT_RATE_HIGH``         u32     threshold for high rate
1134  ``ETHTOOL_A_COALESCE_RX_USECS_HIGH``         u32     delay (us), high Rx
1135  ``ETHTOOL_A_COALESCE_RX_MAX_FRAMES_HIGH``    u32     max packets, high Rx
1136  ``ETHTOOL_A_COALESCE_TX_USECS_HIGH``         u32     delay (us), high Tx
1137  ``ETHTOOL_A_COALESCE_TX_MAX_FRAMES_HIGH``    u32     max packets, high Tx
1138  ``ETHTOOL_A_COALESCE_RATE_SAMPLE_INTERVAL``  u32     rate sampling interval
1139  ``ETHTOOL_A_COALESCE_USE_CQE_TX``            bool    timer reset mode, Tx
1140  ``ETHTOOL_A_COALESCE_USE_CQE_RX``            bool    timer reset mode, Rx
1141  ``ETHTOOL_A_COALESCE_TX_AGGR_MAX_BYTES``     u32     max aggr size, Tx
1142  ``ETHTOOL_A_COALESCE_TX_AGGR_MAX_FRAMES``    u32     max aggr packets, Tx
1143  ``ETHTOOL_A_COALESCE_TX_AGGR_TIME_USECS``    u32     time (us), aggr, Tx
1144  ``ETHTOOL_A_COALESCE_RX_PROFILE``            nested  profile of DIM, Rx
1145  ``ETHTOOL_A_COALESCE_TX_PROFILE``            nested  profile of DIM, Tx
1146  ===========================================  ======  =======================
1147
1148Request is rejected if it attributes declared as unsupported by driver (i.e.
1149such that the corresponding bit in ``ethtool_ops::supported_coalesce_params``
1150is not set), regardless of their values. Driver may impose additional
1151constraints on coalescing parameters and their values.
1152
1153Compared to requests issued via the ``ioctl()`` netlink version of this request
1154will try harder to make sure that values specified by the user have been applied
1155and may call the driver twice.
1156
1157
1158PAUSE_GET
1159=========
1160
1161Gets pause frame settings like ``ETHTOOL_GPAUSEPARAM`` ioctl request.
1162
1163Request contents:
1164
1165  =====================================  ======  ==========================
1166  ``ETHTOOL_A_PAUSE_HEADER``             nested  request header
1167  ``ETHTOOL_A_PAUSE_STATS_SRC``          u32     source of statistics
1168  =====================================  ======  ==========================
1169
1170``ETHTOOL_A_PAUSE_STATS_SRC`` is optional. It takes values from:
1171
1172.. kernel-doc:: include/uapi/linux/ethtool.h
1173    :identifiers: ethtool_mac_stats_src
1174
1175If absent from the request, stats will be provided with
1176an ``ETHTOOL_A_PAUSE_STATS_SRC`` attribute in the response equal to
1177``ETHTOOL_MAC_STATS_SRC_AGGREGATE``.
1178
1179Kernel response contents:
1180
1181  =====================================  ======  ==========================
1182  ``ETHTOOL_A_PAUSE_HEADER``             nested  request header
1183  ``ETHTOOL_A_PAUSE_AUTONEG``            bool    pause autonegotiation
1184  ``ETHTOOL_A_PAUSE_RX``                 bool    receive pause frames
1185  ``ETHTOOL_A_PAUSE_TX``                 bool    transmit pause frames
1186  ``ETHTOOL_A_PAUSE_STATS``              nested  pause statistics
1187  =====================================  ======  ==========================
1188
1189``ETHTOOL_A_PAUSE_STATS`` are reported if ``ETHTOOL_FLAG_STATS`` was set
1190in ``ETHTOOL_A_HEADER_FLAGS``.
1191It will be empty if driver did not report any statistics. Drivers fill in
1192the statistics in the following structure:
1193
1194.. kernel-doc:: include/linux/ethtool.h
1195    :identifiers: ethtool_pause_stats
1196
1197Each member has a corresponding attribute defined.
1198
1199PAUSE_SET
1200=========
1201
1202Sets pause parameters like ``ETHTOOL_GPAUSEPARAM`` ioctl request.
1203
1204Request contents:
1205
1206  =====================================  ======  ==========================
1207  ``ETHTOOL_A_PAUSE_HEADER``             nested  request header
1208  ``ETHTOOL_A_PAUSE_AUTONEG``            bool    pause autonegotiation
1209  ``ETHTOOL_A_PAUSE_RX``                 bool    receive pause frames
1210  ``ETHTOOL_A_PAUSE_TX``                 bool    transmit pause frames
1211  =====================================  ======  ==========================
1212
1213
1214EEE_GET
1215=======
1216
1217Gets Energy Efficient Ethernet settings like ``ETHTOOL_GEEE`` ioctl request.
1218
1219Request contents:
1220
1221  =====================================  ======  ==========================
1222  ``ETHTOOL_A_EEE_HEADER``               nested  request header
1223  =====================================  ======  ==========================
1224
1225Kernel response contents:
1226
1227  =====================================  ======  ==========================
1228  ``ETHTOOL_A_EEE_HEADER``               nested  request header
1229  ``ETHTOOL_A_EEE_MODES_OURS``           bool    supported/advertised modes
1230  ``ETHTOOL_A_EEE_MODES_PEER``           bool    peer advertised link modes
1231  ``ETHTOOL_A_EEE_ACTIVE``               bool    EEE is actively used
1232  ``ETHTOOL_A_EEE_ENABLED``              bool    EEE is enabled
1233  ``ETHTOOL_A_EEE_TX_LPI_ENABLED``       bool    Tx lpi enabled
1234  ``ETHTOOL_A_EEE_TX_LPI_TIMER``         u32     Tx lpi timeout (in us)
1235  =====================================  ======  ==========================
1236
1237In ``ETHTOOL_A_EEE_MODES_OURS``, mask consists of link modes for which EEE is
1238enabled, value of link modes for which EEE is advertised. Link modes for which
1239peer advertises EEE are listed in ``ETHTOOL_A_EEE_MODES_PEER`` (no mask). The
1240netlink interface allows reporting EEE status for all link modes but only
1241first 32 are provided by the ``ethtool_ops`` callback.
1242
1243
1244EEE_SET
1245=======
1246
1247Sets Energy Efficient Ethernet parameters like ``ETHTOOL_SEEE`` ioctl request.
1248
1249Request contents:
1250
1251  =====================================  ======  ==========================
1252  ``ETHTOOL_A_EEE_HEADER``               nested  request header
1253  ``ETHTOOL_A_EEE_MODES_OURS``           bool    advertised modes
1254  ``ETHTOOL_A_EEE_ENABLED``              bool    EEE is enabled
1255  ``ETHTOOL_A_EEE_TX_LPI_ENABLED``       bool    Tx lpi enabled
1256  ``ETHTOOL_A_EEE_TX_LPI_TIMER``         u32     Tx lpi timeout (in us)
1257  =====================================  ======  ==========================
1258
1259``ETHTOOL_A_EEE_MODES_OURS`` is used to either list link modes to advertise
1260EEE for (if there is no mask) or specify changes to the list (if there is
1261a mask). The netlink interface allows reporting EEE status for all link modes
1262but only first 32 can be set at the moment as that is what the ``ethtool_ops``
1263callback supports.
1264
1265
1266TSINFO_GET
1267==========
1268
1269Gets timestamping information like ``ETHTOOL_GET_TS_INFO`` ioctl request.
1270
1271Request contents:
1272
1273  ========================================  ======  ============================
1274  ``ETHTOOL_A_TSINFO_HEADER``               nested  request header
1275  ``ETHTOOL_A_TSINFO_HWTSTAMP_PROVIDER``    nested  PTP hw clock provider
1276  ========================================  ======  ============================
1277
1278Kernel response contents:
1279
1280  =====================================  ======  ==========================
1281  ``ETHTOOL_A_TSINFO_HEADER``            nested  request header
1282  ``ETHTOOL_A_TSINFO_TIMESTAMPING``      bitset  SO_TIMESTAMPING flags
1283  ``ETHTOOL_A_TSINFO_TX_TYPES``          bitset  supported Tx types
1284  ``ETHTOOL_A_TSINFO_RX_FILTERS``        bitset  supported Rx filters
1285  ``ETHTOOL_A_TSINFO_PHC_INDEX``         u32     PTP hw clock index
1286  ``ETHTOOL_A_TSINFO_STATS``             nested  HW timestamping statistics
1287  =====================================  ======  ==========================
1288
1289``ETHTOOL_A_TSINFO_PHC_INDEX`` is absent if there is no associated PHC (there
1290is no special value for this case). The bitset attributes are omitted if they
1291would be empty (no bit set).
1292
1293Additional hardware timestamping statistics response contents:
1294
1295  ==================================================  ======  =====================
1296  ``ETHTOOL_A_TS_STAT_TX_PKTS``                       uint    Packets with Tx
1297                                                              HW timestamps
1298  ``ETHTOOL_A_TS_STAT_TX_LOST``                       uint    Tx HW timestamp
1299                                                              not arrived count
1300  ``ETHTOOL_A_TS_STAT_TX_ERR``                        uint    HW error request
1301                                                              Tx timestamp count
1302  ``ETHTOOL_A_TS_STAT_TX_ONESTEP_PKTS_UNCONFIRMED``   uint    Packets with one-step
1303                                                              HW TX timestamps with
1304                                                              unconfirmed delivery
1305  ==================================================  ======  =====================
1306
1307CABLE_TEST
1308==========
1309
1310Start a cable test.
1311
1312Request contents:
1313
1314  ====================================  ======  ==========================
1315  ``ETHTOOL_A_CABLE_TEST_HEADER``       nested  request header
1316  ====================================  ======  ==========================
1317
1318Notification contents:
1319
1320An Ethernet cable typically contains 1, 2 or 4 pairs. The length of
1321the pair can only be measured when there is a fault in the pair and
1322hence a reflection. Information about the fault may not be available,
1323depending on the specific hardware. Hence the contents of the notify
1324message are mostly optional. The attributes can be repeated an
1325arbitrary number of times, in an arbitrary order, for an arbitrary
1326number of pairs.
1327
1328The example shows the notification sent when the test is completed for
1329a T2 cable, i.e. two pairs. One pair is OK and hence has no length
1330information. The second pair has a fault and does have length
1331information.
1332
1333 +---------------------------------------------+--------+---------------------+
1334 | ``ETHTOOL_A_CABLE_TEST_HEADER``             | nested | reply header        |
1335 +---------------------------------------------+--------+---------------------+
1336 | ``ETHTOOL_A_CABLE_TEST_STATUS``             | u8     | completed           |
1337 +---------------------------------------------+--------+---------------------+
1338 | ``ETHTOOL_A_CABLE_TEST_NTF_NEST``           | nested | all the results     |
1339 +-+-------------------------------------------+--------+---------------------+
1340 | | ``ETHTOOL_A_CABLE_NEST_RESULT``           | nested | cable test result   |
1341 +-+-+-----------------------------------------+--------+---------------------+
1342 | | | ``ETHTOOL_A_CABLE_RESULTS_PAIR``        | u8     | pair number         |
1343 +-+-+-----------------------------------------+--------+---------------------+
1344 | | | ``ETHTOOL_A_CABLE_RESULTS_CODE``        | u8     | result code         |
1345 +-+-+-----------------------------------------+--------+---------------------+
1346 | | ``ETHTOOL_A_CABLE_NEST_RESULT``           | nested | cable test results  |
1347 +-+-+-----------------------------------------+--------+---------------------+
1348 | | | ``ETHTOOL_A_CABLE_RESULTS_PAIR``        | u8     | pair number         |
1349 +-+-+-----------------------------------------+--------+---------------------+
1350 | | | ``ETHTOOL_A_CABLE_RESULTS_CODE``        | u8     | result code         |
1351 +-+-+-----------------------------------------+--------+---------------------+
1352 | | | ``ETHTOOL_A_CABLE_RESULT_SRC``          | u32    | information source  |
1353 +-+-+-----------------------------------------+--------+---------------------+
1354 | | ``ETHTOOL_A_CABLE_NEST_FAULT_LENGTH``     | nested | cable length        |
1355 +-+-+-----------------------------------------+--------+---------------------+
1356 | | | ``ETHTOOL_A_CABLE_FAULT_LENGTH_PAIR``   | u8     | pair number         |
1357 +-+-+-----------------------------------------+--------+---------------------+
1358 | | | ``ETHTOOL_A_CABLE_FAULT_LENGTH_CM``     | u32    | length in cm        |
1359 +-+-+-----------------------------------------+--------+---------------------+
1360 | | | ``ETHTOOL_A_CABLE_FAULT_LENGTH_SRC``    | u32    | information source  |
1361 +-+-+-----------------------------------------+--------+---------------------+
1362
1363
1364CABLE_TEST TDR
1365==============
1366
1367Start a cable test and report raw TDR data
1368
1369Request contents:
1370
1371 +--------------------------------------------+--------+-----------------------+
1372 | ``ETHTOOL_A_CABLE_TEST_TDR_HEADER``        | nested | reply header          |
1373 +--------------------------------------------+--------+-----------------------+
1374 | ``ETHTOOL_A_CABLE_TEST_TDR_CFG``           | nested | test configuration    |
1375 +-+------------------------------------------+--------+-----------------------+
1376 | | ``ETHTOOL_A_CABLE_STEP_FIRST_DISTANCE``  | u32    | first data distance   |
1377 +-+-+----------------------------------------+--------+-----------------------+
1378 | | ``ETHTOOL_A_CABLE_STEP_LAST_DISTANCE``   | u32    | last data distance    |
1379 +-+-+----------------------------------------+--------+-----------------------+
1380 | | ``ETHTOOL_A_CABLE_STEP_STEP_DISTANCE``   | u32    | distance of each step |
1381 +-+-+----------------------------------------+--------+-----------------------+
1382 | | ``ETHTOOL_A_CABLE_TEST_TDR_CFG_PAIR``    | u8     | pair to test          |
1383 +-+-+----------------------------------------+--------+-----------------------+
1384
1385The ETHTOOL_A_CABLE_TEST_TDR_CFG is optional, as well as all members
1386of the nest. All distances are expressed in centimeters. The PHY takes
1387the distances as a guide, and rounds to the nearest distance it
1388actually supports. If a pair is passed, only that one pair will be
1389tested. Otherwise all pairs are tested.
1390
1391Notification contents:
1392
1393Raw TDR data is gathered by sending a pulse down the cable and
1394recording the amplitude of the reflected pulse for a given distance.
1395
1396It can take a number of seconds to collect TDR data, especial if the
1397full 100 meters is probed at 1 meter intervals. When the test is
1398started a notification will be sent containing just
1399ETHTOOL_A_CABLE_TEST_TDR_STATUS with the value
1400ETHTOOL_A_CABLE_TEST_NTF_STATUS_STARTED.
1401
1402When the test has completed a second notification will be sent
1403containing ETHTOOL_A_CABLE_TEST_TDR_STATUS with the value
1404ETHTOOL_A_CABLE_TEST_NTF_STATUS_COMPLETED and the TDR data.
1405
1406The message may optionally contain the amplitude of the pulse send
1407down the cable. This is measured in mV. A reflection should not be
1408bigger than transmitted pulse.
1409
1410Before the raw TDR data should be an ETHTOOL_A_CABLE_TDR_NEST_STEP
1411nest containing information about the distance along the cable for the
1412first reading, the last reading, and the step between each
1413reading. Distances are measured in centimeters. These should be the
1414exact values the PHY used. These may be different to what the user
1415requested, if the native measurement resolution is greater than 1 cm.
1416
1417For each step along the cable, a ETHTOOL_A_CABLE_TDR_NEST_AMPLITUDE is
1418used to report the amplitude of the reflection for a given pair.
1419
1420 +---------------------------------------------+--------+----------------------+
1421 | ``ETHTOOL_A_CABLE_TEST_TDR_HEADER``         | nested | reply header         |
1422 +---------------------------------------------+--------+----------------------+
1423 | ``ETHTOOL_A_CABLE_TEST_TDR_STATUS``         | u8     | completed            |
1424 +---------------------------------------------+--------+----------------------+
1425 | ``ETHTOOL_A_CABLE_TEST_TDR_NTF_NEST``       | nested | all the results      |
1426 +-+-------------------------------------------+--------+----------------------+
1427 | | ``ETHTOOL_A_CABLE_TDR_NEST_PULSE``        | nested | TX Pulse amplitude   |
1428 +-+-+-----------------------------------------+--------+----------------------+
1429 | | | ``ETHTOOL_A_CABLE_PULSE_mV``            | s16    | Pulse amplitude      |
1430 +-+-+-----------------------------------------+--------+----------------------+
1431 | | ``ETHTOOL_A_CABLE_NEST_STEP``             | nested | TDR step info        |
1432 +-+-+-----------------------------------------+--------+----------------------+
1433 | | | ``ETHTOOL_A_CABLE_STEP_FIRST_DISTANCE`` | u32    | First data distance  |
1434 +-+-+-----------------------------------------+--------+----------------------+
1435 | | | ``ETHTOOL_A_CABLE_STEP_LAST_DISTANCE``  | u32    | Last data distance   |
1436 +-+-+-----------------------------------------+--------+----------------------+
1437 | | | ``ETHTOOL_A_CABLE_STEP_STEP_DISTANCE``  | u32    | distance of each step|
1438 +-+-+-----------------------------------------+--------+----------------------+
1439 | | ``ETHTOOL_A_CABLE_TDR_NEST_AMPLITUDE``    | nested | Reflection amplitude |
1440 +-+-+-----------------------------------------+--------+----------------------+
1441 | | | ``ETHTOOL_A_CABLE_RESULTS_PAIR``        | u8     | pair number          |
1442 +-+-+-----------------------------------------+--------+----------------------+
1443 | | | ``ETHTOOL_A_CABLE_AMPLITUDE_mV``        | s16    | Reflection amplitude |
1444 +-+-+-----------------------------------------+--------+----------------------+
1445 | | ``ETHTOOL_A_CABLE_TDR_NEST_AMPLITUDE``    | nested | Reflection amplitude |
1446 +-+-+-----------------------------------------+--------+----------------------+
1447 | | | ``ETHTOOL_A_CABLE_RESULTS_PAIR``        | u8     | pair number          |
1448 +-+-+-----------------------------------------+--------+----------------------+
1449 | | | ``ETHTOOL_A_CABLE_AMPLITUDE_mV``        | s16    | Reflection amplitude |
1450 +-+-+-----------------------------------------+--------+----------------------+
1451 | | ``ETHTOOL_A_CABLE_TDR_NEST_AMPLITUDE``    | nested | Reflection amplitude |
1452 +-+-+-----------------------------------------+--------+----------------------+
1453 | | | ``ETHTOOL_A_CABLE_RESULTS_PAIR``        | u8     | pair number          |
1454 +-+-+-----------------------------------------+--------+----------------------+
1455 | | | ``ETHTOOL_A_CABLE_AMPLITUDE_mV``        | s16    | Reflection amplitude |
1456 +-+-+-----------------------------------------+--------+----------------------+
1457
1458TUNNEL_INFO
1459===========
1460
1461Gets information about the tunnel state NIC is aware of.
1462
1463Request contents:
1464
1465  =====================================  ======  ==========================
1466  ``ETHTOOL_A_TUNNEL_INFO_HEADER``       nested  request header
1467  =====================================  ======  ==========================
1468
1469Kernel response contents:
1470
1471 +---------------------------------------------+--------+---------------------+
1472 | ``ETHTOOL_A_TUNNEL_INFO_HEADER``            | nested | reply header        |
1473 +---------------------------------------------+--------+---------------------+
1474 | ``ETHTOOL_A_TUNNEL_INFO_UDP_PORTS``         | nested | all UDP port tables |
1475 +-+-------------------------------------------+--------+---------------------+
1476 | | ``ETHTOOL_A_TUNNEL_UDP_TABLE``            | nested | one UDP port table  |
1477 +-+-+-----------------------------------------+--------+---------------------+
1478 | | | ``ETHTOOL_A_TUNNEL_UDP_TABLE_SIZE``     | u32    | max size of the     |
1479 | | |                                         |        | table               |
1480 +-+-+-----------------------------------------+--------+---------------------+
1481 | | | ``ETHTOOL_A_TUNNEL_UDP_TABLE_TYPES``    | bitset | tunnel types which  |
1482 | | |                                         |        | table can hold      |
1483 +-+-+-----------------------------------------+--------+---------------------+
1484 | | | ``ETHTOOL_A_TUNNEL_UDP_TABLE_ENTRY``    | nested | offloaded UDP port  |
1485 +-+-+-+---------------------------------------+--------+---------------------+
1486 | | | | ``ETHTOOL_A_TUNNEL_UDP_ENTRY_PORT``   | be16   | UDP port            |
1487 +-+-+-+---------------------------------------+--------+---------------------+
1488 | | | | ``ETHTOOL_A_TUNNEL_UDP_ENTRY_TYPE``   | u32    | tunnel type         |
1489 +-+-+-+---------------------------------------+--------+---------------------+
1490
1491For UDP tunnel table empty ``ETHTOOL_A_TUNNEL_UDP_TABLE_TYPES`` indicates that
1492the table contains static entries, hard-coded by the NIC.
1493
1494FEC_GET
1495=======
1496
1497Gets FEC configuration and state like ``ETHTOOL_GFECPARAM`` ioctl request.
1498
1499Request contents:
1500
1501  =====================================  ======  ==========================
1502  ``ETHTOOL_A_FEC_HEADER``               nested  request header
1503  =====================================  ======  ==========================
1504
1505Kernel response contents:
1506
1507  =====================================  ======  ==========================
1508  ``ETHTOOL_A_FEC_HEADER``               nested  request header
1509  ``ETHTOOL_A_FEC_MODES``                bitset  configured modes
1510  ``ETHTOOL_A_FEC_AUTO``                 bool    FEC mode auto selection
1511  ``ETHTOOL_A_FEC_ACTIVE``               u32     index of active FEC mode
1512  ``ETHTOOL_A_FEC_STATS``                nested  FEC statistics
1513  =====================================  ======  ==========================
1514
1515``ETHTOOL_A_FEC_ACTIVE`` is the bit index of the FEC link mode currently
1516active on the interface. This attribute may not be present if device does
1517not support FEC.
1518
1519``ETHTOOL_A_FEC_MODES`` and ``ETHTOOL_A_FEC_AUTO`` are only meaningful when
1520autonegotiation is disabled. If ``ETHTOOL_A_FEC_AUTO`` is non-zero driver will
1521select the FEC mode automatically based on the parameters of the SFP module.
1522This is equivalent to the ``ETHTOOL_FEC_AUTO`` bit of the ioctl interface.
1523``ETHTOOL_A_FEC_MODES`` carry the current FEC configuration using link mode
1524bits (rather than old ``ETHTOOL_FEC_*`` bits).
1525
1526``ETHTOOL_A_FEC_STATS`` are reported if ``ETHTOOL_FLAG_STATS`` was set in
1527``ETHTOOL_A_HEADER_FLAGS``.
1528Each attribute carries an array of 64bit statistics. First entry in the array
1529contains the total number of events on the port, while the following entries
1530are counters corresponding to lanes/PCS instances. The number of entries in
1531the array will be:
1532
1533+--------------+---------------------------------------------+
1534| `0`          | device does not support FEC statistics      |
1535+--------------+---------------------------------------------+
1536| `1`          | device does not support per-lane break down |
1537+--------------+---------------------------------------------+
1538| `1 + #lanes` | device has full support for FEC stats       |
1539+--------------+---------------------------------------------+
1540
1541Drivers fill in the statistics in the following structure:
1542
1543.. kernel-doc:: include/linux/ethtool.h
1544    :identifiers: ethtool_fec_stats
1545
1546Statistics may have FEC bins histogram attribute ``ETHTOOL_A_FEC_STAT_HIST``
1547as defined in IEEE 802.3ck-2022 and 802.3df-2024. Nested attributes will have
1548the range of FEC errors in the bin (inclusive) and the amount of error events
1549in the bin.
1550
1551FEC_SET
1552=======
1553
1554Sets FEC parameters like ``ETHTOOL_SFECPARAM`` ioctl request.
1555
1556Request contents:
1557
1558  =====================================  ======  ==========================
1559  ``ETHTOOL_A_FEC_HEADER``               nested  request header
1560  ``ETHTOOL_A_FEC_MODES``                bitset  configured modes
1561  ``ETHTOOL_A_FEC_AUTO``                 bool    FEC mode auto selection
1562  =====================================  ======  ==========================
1563
1564``FEC_SET`` is only meaningful when autonegotiation is disabled. Otherwise
1565FEC mode is selected as part of autonegotiation.
1566
1567``ETHTOOL_A_FEC_MODES`` selects which FEC mode should be used. It's recommended
1568to set only one bit, if multiple bits are set driver may choose between them
1569in an implementation specific way.
1570
1571``ETHTOOL_A_FEC_AUTO`` requests the driver to choose FEC mode based on SFP
1572module parameters. This does not mean autonegotiation.
1573
1574MODULE_EEPROM_GET
1575=================
1576
1577Fetch module EEPROM data dump.
1578This interface is designed to allow dumps of at most 1/2 page at once. This
1579means only dumps of 128 (or less) bytes are allowed, without crossing half page
1580boundary located at offset 128. For pages other than 0 only high 128 bytes are
1581accessible.
1582
1583Request contents:
1584
1585  =======================================  ======  ==========================
1586  ``ETHTOOL_A_MODULE_EEPROM_HEADER``       nested  request header
1587  ``ETHTOOL_A_MODULE_EEPROM_OFFSET``       u32     offset within a page
1588  ``ETHTOOL_A_MODULE_EEPROM_LENGTH``       u32     amount of bytes to read
1589  ``ETHTOOL_A_MODULE_EEPROM_PAGE``         u8      page number
1590  ``ETHTOOL_A_MODULE_EEPROM_BANK``         u8      bank number
1591  ``ETHTOOL_A_MODULE_EEPROM_I2C_ADDRESS``  u8      page I2C address
1592  =======================================  ======  ==========================
1593
1594If ``ETHTOOL_A_MODULE_EEPROM_BANK`` is not specified, bank 0 is assumed.
1595
1596Kernel response contents:
1597
1598 +---------------------------------------------+--------+---------------------+
1599 | ``ETHTOOL_A_MODULE_EEPROM_HEADER``          | nested | reply header        |
1600 +---------------------------------------------+--------+---------------------+
1601 | ``ETHTOOL_A_MODULE_EEPROM_DATA``            | binary | array of bytes from |
1602 |                                             |        | module EEPROM       |
1603 +---------------------------------------------+--------+---------------------+
1604
1605``ETHTOOL_A_MODULE_EEPROM_DATA`` has an attribute length equal to the amount of
1606bytes driver actually read.
1607
1608STATS_GET
1609=========
1610
1611Get standard statistics for the interface. Note that this is not
1612a re-implementation of ``ETHTOOL_GSTATS`` which exposed driver-defined
1613stats.
1614
1615Request contents:
1616
1617  =======================================  ======  ==========================
1618  ``ETHTOOL_A_STATS_HEADER``               nested  request header
1619  ``ETHTOOL_A_STATS_SRC``                  u32     source of statistics
1620  ``ETHTOOL_A_STATS_GROUPS``               bitset  requested groups of stats
1621  =======================================  ======  ==========================
1622
1623Kernel response contents:
1624
1625 +-----------------------------------+--------+--------------------------------+
1626 | ``ETHTOOL_A_STATS_HEADER``        | nested | reply header                   |
1627 +-----------------------------------+--------+--------------------------------+
1628 | ``ETHTOOL_A_STATS_SRC``           | u32    | source of statistics           |
1629 +-----------------------------------+--------+--------------------------------+
1630 | ``ETHTOOL_A_STATS_GRP``           | nested | one or more group of stats     |
1631 +-+---------------------------------+--------+--------------------------------+
1632 | | ``ETHTOOL_A_STATS_GRP_ID``      | u32    | group ID - ``ETHTOOL_STATS_*`` |
1633 +-+---------------------------------+--------+--------------------------------+
1634 | | ``ETHTOOL_A_STATS_GRP_SS_ID``   | u32    | string set ID for names        |
1635 +-+---------------------------------+--------+--------------------------------+
1636 | | ``ETHTOOL_A_STATS_GRP_STAT``    | nested | nest containing a statistic    |
1637 +-+---------------------------------+--------+--------------------------------+
1638 | | ``ETHTOOL_A_STATS_GRP_HIST_RX`` | nested | histogram statistic (Rx)       |
1639 +-+---------------------------------+--------+--------------------------------+
1640 | | ``ETHTOOL_A_STATS_GRP_HIST_TX`` | nested | histogram statistic (Tx)       |
1641 +-+---------------------------------+--------+--------------------------------+
1642
1643Users specify which groups of statistics they are requesting via
1644the ``ETHTOOL_A_STATS_GROUPS`` bitset. Currently defined values are:
1645
1646 ====================== ======== ===============================================
1647 ETHTOOL_STATS_ETH_MAC  eth-mac  Basic IEEE 802.3 MAC statistics (30.3.1.1.*)
1648 ETHTOOL_STATS_ETH_PHY  eth-phy  Basic IEEE 802.3 PHY statistics (30.3.2.1.*)
1649 ETHTOOL_STATS_ETH_CTRL eth-ctrl Basic IEEE 802.3 MAC Ctrl statistics (30.3.3.*)
1650 ETHTOOL_STATS_RMON     rmon     RMON (RFC 2819) statistics
1651 ETHTOOL_STATS_PHY      phy      Additional PHY statistics, not defined by IEEE
1652 ====================== ======== ===============================================
1653
1654Each group should have a corresponding ``ETHTOOL_A_STATS_GRP`` in the reply.
1655``ETHTOOL_A_STATS_GRP_ID`` identifies which group's statistics nest contains.
1656``ETHTOOL_A_STATS_GRP_SS_ID`` identifies the string set ID for the names of
1657the statistics in the group, if available.
1658
1659Statistics are added to the ``ETHTOOL_A_STATS_GRP`` nest under
1660``ETHTOOL_A_STATS_GRP_STAT``. ``ETHTOOL_A_STATS_GRP_STAT`` should contain
1661single 8 byte (u64) attribute inside - the type of that attribute is
1662the statistic ID and the value is the value of the statistic.
1663Each group has its own interpretation of statistic IDs.
1664Attribute IDs correspond to strings from the string set identified
1665by ``ETHTOOL_A_STATS_GRP_SS_ID``. Complex statistics (such as RMON histogram
1666entries) are also listed inside ``ETHTOOL_A_STATS_GRP`` and do not have
1667a string defined in the string set.
1668
1669RMON "histogram" counters count number of packets within given size range.
1670Because RFC does not specify the ranges beyond the standard 1518 MTU devices
1671differ in definition of buckets. For this reason the definition of packet ranges
1672is left to each driver.
1673
1674``ETHTOOL_A_STATS_GRP_HIST_RX`` and ``ETHTOOL_A_STATS_GRP_HIST_TX`` nests
1675contain the following attributes:
1676
1677 ================================= ====== ===================================
1678 ETHTOOL_A_STATS_RMON_HIST_BKT_LOW u32    low bound of the packet size bucket
1679 ETHTOOL_A_STATS_RMON_HIST_BKT_HI  u32    high bound of the bucket
1680 ETHTOOL_A_STATS_RMON_HIST_VAL     u64    packet counter
1681 ================================= ====== ===================================
1682
1683Low and high bounds are inclusive, for example:
1684
1685 ============================= ==== ====
1686 RFC statistic                 low  high
1687 ============================= ==== ====
1688 etherStatsPkts64Octets          0    64
1689 etherStatsPkts512to1023Octets 512  1023
1690 ============================= ==== ====
1691
1692``ETHTOOL_A_STATS_SRC`` is optional. Similar to ``PAUSE_GET``, it takes values
1693from ``enum ethtool_mac_stats_src``. If absent from the request, stats will be
1694provided with an ``ETHTOOL_A_STATS_SRC`` attribute in the response equal to
1695``ETHTOOL_MAC_STATS_SRC_AGGREGATE``.
1696
1697PHC_VCLOCKS_GET
1698===============
1699
1700Query device PHC virtual clocks information.
1701
1702Request contents:
1703
1704  ====================================  ======  ==========================
1705  ``ETHTOOL_A_PHC_VCLOCKS_HEADER``      nested  request header
1706  ====================================  ======  ==========================
1707
1708Kernel response contents:
1709
1710  ====================================  ======  ==========================
1711  ``ETHTOOL_A_PHC_VCLOCKS_HEADER``      nested  reply header
1712  ``ETHTOOL_A_PHC_VCLOCKS_NUM``         u32     PHC virtual clocks number
1713  ``ETHTOOL_A_PHC_VCLOCKS_INDEX``       s32     PHC index array
1714  ====================================  ======  ==========================
1715
1716MODULE_GET
1717==========
1718
1719Gets transceiver module parameters.
1720
1721Request contents:
1722
1723  =====================================  ======  ==========================
1724  ``ETHTOOL_A_MODULE_HEADER``            nested  request header
1725  =====================================  ======  ==========================
1726
1727Kernel response contents:
1728
1729  ======================================  ======  ==========================
1730  ``ETHTOOL_A_MODULE_HEADER``             nested  reply header
1731  ``ETHTOOL_A_MODULE_POWER_MODE_POLICY``  u8      power mode policy
1732  ``ETHTOOL_A_MODULE_POWER_MODE``         u8      operational power mode
1733  ======================================  ======  ==========================
1734
1735The optional ``ETHTOOL_A_MODULE_POWER_MODE_POLICY`` attribute encodes the
1736transceiver module power mode policy enforced by the host. The default policy
1737is driver-dependent, but "auto" is the recommended default and it should be
1738implemented by new drivers and drivers where conformance to a legacy behavior
1739is not critical.
1740
1741The optional ``ETHTHOOL_A_MODULE_POWER_MODE`` attribute encodes the operational
1742power mode policy of the transceiver module. It is only reported when a module
1743is plugged-in. Possible values are:
1744
1745.. kernel-doc:: include/uapi/linux/ethtool.h
1746    :identifiers: ethtool_module_power_mode
1747
1748MODULE_SET
1749==========
1750
1751Sets transceiver module parameters.
1752
1753Request contents:
1754
1755  ======================================  ======  ==========================
1756  ``ETHTOOL_A_MODULE_HEADER``             nested  request header
1757  ``ETHTOOL_A_MODULE_POWER_MODE_POLICY``  u8      power mode policy
1758  ======================================  ======  ==========================
1759
1760When set, the optional ``ETHTOOL_A_MODULE_POWER_MODE_POLICY`` attribute is used
1761to set the transceiver module power policy enforced by the host. Possible
1762values are:
1763
1764.. kernel-doc:: include/uapi/linux/ethtool.h
1765    :identifiers: ethtool_module_power_mode_policy
1766
1767For SFF-8636 modules, low power mode is forced by the host according to table
17686-10 in revision 2.10a of the specification.
1769
1770For CMIS modules, low power mode is forced by the host according to table 6-12
1771in revision 5.0 of the specification.
1772
1773PSE_GET
1774=======
1775
1776Gets PSE attributes.
1777
1778Request contents:
1779
1780  =====================================  ======  ==========================
1781  ``ETHTOOL_A_PSE_HEADER``               nested  request header
1782  =====================================  ======  ==========================
1783
1784Kernel response contents:
1785
1786  ==========================================  ======  =============================
1787  ``ETHTOOL_A_PSE_HEADER``                    nested  reply header
1788  ``ETHTOOL_A_PODL_PSE_ADMIN_STATE``             u32  Operational state of the PoDL
1789                                                      PSE functions
1790  ``ETHTOOL_A_PODL_PSE_PW_D_STATUS``             u32  power detection status of the
1791                                                      PoDL PSE.
1792  ``ETHTOOL_A_C33_PSE_ADMIN_STATE``              u32  Operational state of the PoE
1793                                                      PSE functions.
1794  ``ETHTOOL_A_C33_PSE_PW_D_STATUS``              u32  power detection status of the
1795                                                      PoE PSE.
1796  ``ETHTOOL_A_C33_PSE_PW_CLASS``                 u32  power class of the PoE PSE.
1797  ``ETHTOOL_A_C33_PSE_ACTUAL_PW``                u32  actual power drawn on the
1798                                                      PoE PSE.
1799  ``ETHTOOL_A_C33_PSE_EXT_STATE``                u32  power extended state of the
1800                                                      PoE PSE.
1801  ``ETHTOOL_A_C33_PSE_EXT_SUBSTATE``             u32  power extended substatus of
1802                                                      the PoE PSE.
1803  ``ETHTOOL_A_C33_PSE_AVAIL_PW_LIMIT``           u32  currently configured power
1804                                                      limit of the PoE PSE.
1805  ``ETHTOOL_A_C33_PSE_PW_LIMIT_RANGES``       nested  Supported power limit
1806                                                      configuration ranges.
1807  ``ETHTOOL_A_PSE_PW_D_ID``                      u32  Index of the PSE power domain
1808  ``ETHTOOL_A_PSE_PRIO_MAX``                     u32  Priority maximum configurable
1809                                                      on the PoE PSE
1810  ``ETHTOOL_A_PSE_PRIO``                         u32  Priority of the PoE PSE
1811                                                      currently configured
1812  ==========================================  ======  =============================
1813
1814When set, the optional ``ETHTOOL_A_PODL_PSE_ADMIN_STATE`` attribute identifies
1815the operational state of the PoDL PSE functions.  The operational state of the
1816PSE function can be changed using the ``ETHTOOL_A_PODL_PSE_ADMIN_CONTROL``
1817action. This attribute corresponds to ``IEEE 802.3-2018`` 30.15.1.1.2
1818aPoDLPSEAdminState. Possible values are:
1819
1820.. kernel-doc:: include/uapi/linux/ethtool.h
1821    :identifiers: ethtool_podl_pse_admin_state
1822
1823The same goes for ``ETHTOOL_A_C33_PSE_ADMIN_STATE`` implementing
1824``IEEE 802.3-2022`` 30.9.1.1.2 aPSEAdminState.
1825
1826.. kernel-doc:: include/uapi/linux/ethtool.h
1827    :identifiers: ethtool_c33_pse_admin_state
1828
1829When set, the optional ``ETHTOOL_A_PODL_PSE_PW_D_STATUS`` attribute identifies
1830the power detection status of the PoDL PSE.  The status depend on internal PSE
1831state machine and automatic PD classification support. This attribute
1832corresponds to ``IEEE 802.3-2018`` 30.15.1.1.3 aPoDLPSEPowerDetectionStatus.
1833Possible values are:
1834
1835.. kernel-doc:: include/uapi/linux/ethtool.h
1836    :identifiers: ethtool_podl_pse_pw_d_status
1837
1838The same goes for ``ETHTOOL_A_C33_PSE_ADMIN_PW_D_STATUS`` implementing
1839``IEEE 802.3-2022`` 30.9.1.1.5 aPSEPowerDetectionStatus.
1840
1841.. kernel-doc:: include/uapi/linux/ethtool.h
1842    :identifiers: ethtool_c33_pse_pw_d_status
1843
1844When set, the optional ``ETHTOOL_A_C33_PSE_PW_CLASS`` attribute identifies
1845the power class of the C33 PSE. It depends on the class negotiated between
1846the PSE and the PD. This attribute corresponds to ``IEEE 802.3-2022``
184730.9.1.1.8 aPSEPowerClassification.
1848
1849When set, the optional ``ETHTOOL_A_C33_PSE_ACTUAL_PW`` attribute identifies
1850the actual power drawn by the C33 PSE. This attribute corresponds to
1851``IEEE 802.3-2022`` 30.9.1.1.23 aPSEActualPower. Actual power is reported
1852in mW.
1853
1854When set, the optional ``ETHTOOL_A_C33_PSE_EXT_STATE`` attribute identifies
1855the extended error state of the C33 PSE. Possible values are:
1856
1857.. kernel-doc:: include/uapi/linux/ethtool.h
1858    :identifiers: ethtool_c33_pse_ext_state
1859
1860When set, the optional ``ETHTOOL_A_C33_PSE_EXT_SUBSTATE`` attribute identifies
1861the extended error state of the C33 PSE. Possible values are:
1862Possible values are:
1863
1864.. kernel-doc:: include/uapi/linux/ethtool.h
1865    :identifiers: ethtool_c33_pse_ext_substate_class_num_events
1866		  ethtool_c33_pse_ext_substate_error_condition
1867		  ethtool_c33_pse_ext_substate_mr_pse_enable
1868		  ethtool_c33_pse_ext_substate_option_detect_ted
1869		  ethtool_c33_pse_ext_substate_option_vport_lim
1870		  ethtool_c33_pse_ext_substate_ovld_detected
1871		  ethtool_c33_pse_ext_substate_pd_dll_power_type
1872		  ethtool_c33_pse_ext_substate_power_not_available
1873		  ethtool_c33_pse_ext_substate_short_detected
1874
1875When set, the optional ``ETHTOOL_A_C33_PSE_AVAIL_PW_LIMIT`` attribute
1876identifies the C33 PSE power limit in mW.
1877
1878When set the optional ``ETHTOOL_A_C33_PSE_PW_LIMIT_RANGES`` nested attribute
1879identifies the C33 PSE power limit ranges through
1880``ETHTOOL_A_C33_PSE_PWR_VAL_LIMIT_RANGE_MIN`` and
1881``ETHTOOL_A_C33_PSE_PWR_VAL_LIMIT_RANGE_MAX``.
1882If the controller works with fixed classes, the min and max values will be
1883equal.
1884
1885The ``ETHTOOL_A_PSE_PW_D_ID`` attribute identifies the index of PSE power
1886domain.
1887
1888When set, the optional ``ETHTOOL_A_PSE_PRIO_MAX`` attribute identifies
1889the PSE maximum priority value.
1890When set, the optional ``ETHTOOL_A_PSE_PRIO`` attributes is used to
1891identifies the currently configured PSE priority.
1892For a description of PSE priority attributes, see ``PSE_SET``.
1893
1894PSE_SET
1895=======
1896
1897Sets PSE parameters.
1898
1899Request contents:
1900
1901  ======================================  ======  =============================
1902  ``ETHTOOL_A_PSE_HEADER``                nested  request header
1903  ``ETHTOOL_A_PODL_PSE_ADMIN_CONTROL``       u32  Control PoDL PSE Admin state
1904  ``ETHTOOL_A_C33_PSE_ADMIN_CONTROL``        u32  Control PSE Admin state
1905  ``ETHTOOL_A_C33_PSE_AVAIL_PWR_LIMIT``      u32  Control PoE PSE available
1906                                                  power limit
1907  ``ETHTOOL_A_PSE_PRIO``                     u32  Control priority of the
1908                                                  PoE PSE
1909  ======================================  ======  =============================
1910
1911When set, the optional ``ETHTOOL_A_PODL_PSE_ADMIN_CONTROL`` attribute is used
1912to control PoDL PSE Admin functions. This option implements
1913``IEEE 802.3-2018`` 30.15.1.2.1 acPoDLPSEAdminControl. See
1914``ETHTOOL_A_PODL_PSE_ADMIN_STATE`` for supported values.
1915
1916The same goes for ``ETHTOOL_A_C33_PSE_ADMIN_CONTROL`` implementing
1917``IEEE 802.3-2022`` 30.9.1.2.1 acPSEAdminControl.
1918
1919When set, the optional ``ETHTOOL_A_C33_PSE_AVAIL_PWR_LIMIT`` attribute is
1920used to control the available power value limit for C33 PSE in milliwatts.
1921This attribute corresponds  to the `pse_available_power` variable described in
1922``IEEE 802.3-2022`` 33.2.4.4 Variables  and `pse_avail_pwr` in 145.2.5.4
1923Variables, which are described in power classes.
1924
1925It was decided to use milliwatts for this interface to unify it with other
1926power monitoring interfaces, which also use milliwatts, and to align with
1927various existing products that document power consumption in watts rather than
1928classes. If power limit configuration based on classes is needed, the
1929conversion can be done in user space, for example by ethtool.
1930
1931When set, the optional ``ETHTOOL_A_PSE_PRIO`` attributes is used to
1932control the PSE priority. Allowed priority value are between zero and
1933the value of ``ETHTOOL_A_PSE_PRIO_MAX`` attribute.
1934
1935A lower value indicates a higher priority, meaning that a priority value
1936of 0 corresponds to the highest port priority.
1937Port priority serves two functions:
1938
1939 - Power-up Order: After a reset, ports are powered up in order of their
1940   priority from highest to lowest. Ports with higher priority
1941   (lower values) power up first.
1942 - Shutdown Order: When the power budget is exceeded, ports with lower
1943   priority (higher values) are turned off first.
1944
1945PSE_NTF
1946=======
1947
1948Notify PSE events.
1949
1950Notification contents:
1951
1952  ===============================  ======  ========================
1953  ``ETHTOOL_A_PSE_HEADER``         nested  request header
1954  ``ETHTOOL_A_PSE_EVENTS``         bitset  PSE events
1955  ===============================  ======  ========================
1956
1957When set, the optional ``ETHTOOL_A_PSE_EVENTS`` attribute identifies the
1958PSE events.
1959
1960.. kernel-doc:: include/uapi/linux/ethtool_netlink_generated.h
1961    :identifiers: ethtool_pse_event
1962
1963RSS_GET
1964=======
1965
1966Get indirection table, hash key and hash function info associated with a
1967RSS context of an interface similar to ``ETHTOOL_GRSSH`` ioctl request.
1968
1969Request contents:
1970
1971=====================================  ======  ============================
1972  ``ETHTOOL_A_RSS_HEADER``             nested  request header
1973  ``ETHTOOL_A_RSS_CONTEXT``            u32     context number
1974  ``ETHTOOL_A_RSS_START_CONTEXT``      u32     start context number (dumps)
1975=====================================  ======  ============================
1976
1977``ETHTOOL_A_RSS_CONTEXT`` specifies which RSS context number to query,
1978if not set context 0 (the main context) is queried. Dumps can be filtered
1979by device (only listing contexts of a given netdev). Filtering single
1980context number is not supported but ``ETHTOOL_A_RSS_START_CONTEXT``
1981can be used to start dumping context from the given number (primarily
1982used to ignore context 0s and only dump additional contexts).
1983
1984Kernel response contents:
1985
1986=====================================  ======  ===============================
1987  ``ETHTOOL_A_RSS_HEADER``             nested  reply header
1988  ``ETHTOOL_A_RSS_CONTEXT``            u32     context number
1989  ``ETHTOOL_A_RSS_HFUNC``              u32     RSS hash func
1990  ``ETHTOOL_A_RSS_INDIR``              binary  Indir table bytes
1991  ``ETHTOOL_A_RSS_HKEY``               binary  Hash key bytes
1992  ``ETHTOOL_A_RSS_INPUT_XFRM``         u32     RSS input data transformation
1993  ``ETHTOOL_A_RSS_FLOW_HASH``          nested  Header fields included in hash
1994=====================================  ======  ===============================
1995
1996ETHTOOL_A_RSS_HFUNC attribute is bitmap indicating the hash function
1997being used. Current supported options are toeplitz, xor or crc32.
1998ETHTOOL_A_RSS_INDIR attribute returns RSS indirection table where each byte
1999indicates queue number.
2000ETHTOOL_A_RSS_INPUT_XFRM attribute is a bitmap indicating the type of
2001transformation applied to the input protocol fields before given to the RSS
2002hfunc. Current supported options are symmetric-xor and symmetric-or-xor.
2003ETHTOOL_A_RSS_FLOW_HASH carries per-flow type bitmask of which header
2004fields are included in the hash calculation.
2005
2006RSS_SET
2007=======
2008
2009Request contents:
2010
2011=====================================  ======  ==============================
2012  ``ETHTOOL_A_RSS_HEADER``             nested  request header
2013  ``ETHTOOL_A_RSS_CONTEXT``            u32     context number
2014  ``ETHTOOL_A_RSS_HFUNC``              u32     RSS hash func
2015  ``ETHTOOL_A_RSS_INDIR``              binary  Indir table bytes
2016  ``ETHTOOL_A_RSS_HKEY``               binary  Hash key bytes
2017  ``ETHTOOL_A_RSS_INPUT_XFRM``         u32     RSS input data transformation
2018  ``ETHTOOL_A_RSS_FLOW_HASH``          nested  Header fields included in hash
2019=====================================  ======  ==============================
2020
2021``ETHTOOL_A_RSS_INDIR`` is the minimal RSS table the user expects. Kernel and
2022the device driver may replicate the table if its smaller than smallest table
2023size supported by the device. For example if user requests ``[0, 1]`` but the
2024device needs at least 8 entries - the real table in use will end up being
2025``[0, 1, 0, 1, 0, 1, 0, 1]``. Most devices require the table size to be power
2026of 2, so tables which size is not a power of 2 will likely be rejected.
2027Using table of size 0 will reset the indirection table to the default.
2028
2029RSS_CREATE_ACT
2030==============
2031
2032Request contents:
2033
2034=====================================  ======  ==============================
2035  ``ETHTOOL_A_RSS_HEADER``             nested  request header
2036  ``ETHTOOL_A_RSS_CONTEXT``            u32     context number
2037  ``ETHTOOL_A_RSS_HFUNC``              u32     RSS hash func
2038  ``ETHTOOL_A_RSS_INDIR``              binary  Indir table bytes
2039  ``ETHTOOL_A_RSS_HKEY``               binary  Hash key bytes
2040  ``ETHTOOL_A_RSS_INPUT_XFRM``         u32     RSS input data transformation
2041=====================================  ======  ==============================
2042
2043Kernel response contents:
2044
2045=====================================  ======  ==============================
2046  ``ETHTOOL_A_RSS_HEADER``             nested  request header
2047  ``ETHTOOL_A_RSS_CONTEXT``            u32     context number
2048=====================================  ======  ==============================
2049
2050Create an additional RSS context, if ``ETHTOOL_A_RSS_CONTEXT`` is not
2051specified kernel will allocate one automatically.
2052
2053RSS_DELETE_ACT
2054==============
2055
2056Request contents:
2057
2058=====================================  ======  ==============================
2059  ``ETHTOOL_A_RSS_HEADER``             nested  request header
2060  ``ETHTOOL_A_RSS_CONTEXT``            u32     context number
2061=====================================  ======  ==============================
2062
2063Delete an additional RSS context.
2064
2065PLCA_GET_CFG
2066============
2067
2068Gets the IEEE 802.3cg-2019 Clause 148 Physical Layer Collision Avoidance
2069(PLCA) Reconciliation Sublayer (RS) attributes.
2070
2071Request contents:
2072
2073  =====================================  ======  ==========================
2074  ``ETHTOOL_A_PLCA_HEADER``              nested  request header
2075  =====================================  ======  ==========================
2076
2077Kernel response contents:
2078
2079  ======================================  ======  =============================
2080  ``ETHTOOL_A_PLCA_HEADER``               nested  reply header
2081  ``ETHTOOL_A_PLCA_VERSION``              u16     Supported PLCA management
2082                                                  interface standard/version
2083  ``ETHTOOL_A_PLCA_ENABLED``              u8      PLCA Admin State
2084  ``ETHTOOL_A_PLCA_NODE_ID``              u32     PLCA unique local node ID
2085  ``ETHTOOL_A_PLCA_NODE_CNT``             u32     Number of PLCA nodes on the
2086                                                  network, including the
2087                                                  coordinator
2088  ``ETHTOOL_A_PLCA_TO_TMR``               u32     Transmit Opportunity Timer
2089                                                  value in bit-times (BT)
2090  ``ETHTOOL_A_PLCA_BURST_CNT``            u32     Number of additional packets
2091                                                  the node is allowed to send
2092                                                  within a single TO
2093  ``ETHTOOL_A_PLCA_BURST_TMR``            u32     Time to wait for the MAC to
2094                                                  transmit a new frame before
2095                                                  terminating the burst
2096  ======================================  ======  =============================
2097
2098When set, the optional ``ETHTOOL_A_PLCA_VERSION`` attribute indicates which
2099standard and version the PLCA management interface complies to. When not set,
2100the interface is vendor-specific and (possibly) supplied by the driver.
2101The OPEN Alliance SIG specifies a standard register map for 10BASE-T1S PHYs
2102embedding the PLCA Reconciliation Sublayer. See "10BASE-T1S PLCA Management
2103Registers" at https://www.opensig.org/about/specifications/.
2104
2105When set, the optional ``ETHTOOL_A_PLCA_ENABLED`` attribute indicates the
2106administrative state of the PLCA RS. When not set, the node operates in "plain"
2107CSMA/CD mode. This option is corresponding to ``IEEE 802.3cg-2019`` 30.16.1.1.1
2108aPLCAAdminState / 30.16.1.2.1 acPLCAAdminControl.
2109
2110When set, the optional ``ETHTOOL_A_PLCA_NODE_ID`` attribute indicates the
2111configured local node ID of the PHY. This ID determines which transmit
2112opportunity (TO) is reserved for the node to transmit into. This option is
2113corresponding to ``IEEE 802.3cg-2019`` 30.16.1.1.4 aPLCALocalNodeID. The valid
2114range for this attribute is [0 .. 255] where 255 means "not configured".
2115
2116When set, the optional ``ETHTOOL_A_PLCA_NODE_CNT`` attribute indicates the
2117configured maximum number of PLCA nodes on the mixing-segment. This number
2118determines the total number of transmit opportunities generated during a
2119PLCA cycle. This attribute is relevant only for the PLCA coordinator, which is
2120the node with aPLCALocalNodeID set to 0. Follower nodes ignore this setting.
2121This option is corresponding to ``IEEE 802.3cg-2019`` 30.16.1.1.3
2122aPLCANodeCount. The valid range for this attribute is [1 .. 255].
2123
2124When set, the optional ``ETHTOOL_A_PLCA_TO_TMR`` attribute indicates the
2125configured value of the transmit opportunity timer in bit-times. This value
2126must be set equal across all nodes sharing the medium for PLCA to work
2127correctly. This option is corresponding to ``IEEE 802.3cg-2019`` 30.16.1.1.5
2128aPLCATransmitOpportunityTimer. The valid range for this attribute is
2129[0 .. 255].
2130
2131When set, the optional ``ETHTOOL_A_PLCA_BURST_CNT`` attribute indicates the
2132configured number of extra packets that the node is allowed to send during a
2133single transmit opportunity. By default, this attribute is 0, meaning that
2134the node can only send a single frame per TO. When greater than 0, the PLCA RS
2135keeps the TO after any transmission, waiting for the MAC to send a new frame
2136for up to aPLCABurstTimer BTs. This can only happen a number of times per PLCA
2137cycle up to the value of this parameter. After that, the burst is over and the
2138normal counting of TOs resumes. This option is corresponding to
2139``IEEE 802.3cg-2019`` 30.16.1.1.6 aPLCAMaxBurstCount. The valid range for this
2140attribute is [0 .. 255].
2141
2142When set, the optional ``ETHTOOL_A_PLCA_BURST_TMR`` attribute indicates how
2143many bit-times the PLCA RS waits for the MAC to initiate a new transmission
2144when aPLCAMaxBurstCount is greater than 0. If the MAC fails to send a new
2145frame within this time, the burst ends and the counting of TOs resumes.
2146Otherwise, the new frame is sent as part of the current burst. This option
2147is corresponding to ``IEEE 802.3cg-2019`` 30.16.1.1.7 aPLCABurstTimer. The
2148valid range for this attribute is [0 .. 255]. Although, the value should be
2149set greater than the Inter-Frame-Gap (IFG) time of the MAC (plus some margin)
2150for PLCA burst mode to work as intended.
2151
2152PLCA_SET_CFG
2153============
2154
2155Sets PLCA RS parameters.
2156
2157Request contents:
2158
2159  ======================================  ======  =============================
2160  ``ETHTOOL_A_PLCA_HEADER``               nested  request header
2161  ``ETHTOOL_A_PLCA_ENABLED``              u8      PLCA Admin State
2162  ``ETHTOOL_A_PLCA_NODE_ID``              u8      PLCA unique local node ID
2163  ``ETHTOOL_A_PLCA_NODE_CNT``             u8      Number of PLCA nodes on the
2164                                                  network, including the
2165                                                  coordinator
2166  ``ETHTOOL_A_PLCA_TO_TMR``               u8      Transmit Opportunity Timer
2167                                                  value in bit-times (BT)
2168  ``ETHTOOL_A_PLCA_BURST_CNT``            u8      Number of additional packets
2169                                                  the node is allowed to send
2170                                                  within a single TO
2171  ``ETHTOOL_A_PLCA_BURST_TMR``            u8      Time to wait for the MAC to
2172                                                  transmit a new frame before
2173                                                  terminating the burst
2174  ======================================  ======  =============================
2175
2176For a description of each attribute, see ``PLCA_GET_CFG``.
2177
2178PLCA_GET_STATUS
2179===============
2180
2181Gets PLCA RS status information.
2182
2183Request contents:
2184
2185  =====================================  ======  ==========================
2186  ``ETHTOOL_A_PLCA_HEADER``              nested  request header
2187  =====================================  ======  ==========================
2188
2189Kernel response contents:
2190
2191  ======================================  ======  =============================
2192  ``ETHTOOL_A_PLCA_HEADER``               nested  reply header
2193  ``ETHTOOL_A_PLCA_STATUS``               u8      PLCA RS operational status
2194  ======================================  ======  =============================
2195
2196When set, the ``ETHTOOL_A_PLCA_STATUS`` attribute indicates whether the node is
2197detecting the presence of the BEACON on the network. This flag is
2198corresponding to ``IEEE 802.3cg-2019`` 30.16.1.1.2 aPLCAStatus.
2199
2200MM_GET
2201======
2202
2203Retrieve 802.3 MAC Merge parameters.
2204
2205Request contents:
2206
2207  ====================================  ======  ==========================
2208  ``ETHTOOL_A_MM_HEADER``               nested  request header
2209  ====================================  ======  ==========================
2210
2211Kernel response contents:
2212
2213  =================================  ======  ===================================
2214  ``ETHTOOL_A_MM_HEADER``            nested  request header
2215  ``ETHTOOL_A_MM_PMAC_ENABLED``      bool    set if RX of preemptible and SMD-V
2216                                             frames is enabled
2217  ``ETHTOOL_A_MM_TX_ENABLED``        bool    set if TX of preemptible frames is
2218                                             administratively enabled (might be
2219                                             inactive if verification failed)
2220  ``ETHTOOL_A_MM_TX_ACTIVE``         bool    set if TX of preemptible frames is
2221                                             operationally enabled
2222  ``ETHTOOL_A_MM_TX_MIN_FRAG_SIZE``  u32     minimum size of transmitted
2223                                             non-final fragments, in octets
2224  ``ETHTOOL_A_MM_RX_MIN_FRAG_SIZE``  u32     minimum size of received non-final
2225                                             fragments, in octets
2226  ``ETHTOOL_A_MM_VERIFY_ENABLED``    bool    set if TX of SMD-V frames is
2227                                             administratively enabled
2228  ``ETHTOOL_A_MM_VERIFY_STATUS``     u8      state of the verification function
2229  ``ETHTOOL_A_MM_VERIFY_TIME``       u32     delay between verification attempts
2230  ``ETHTOOL_A_MM_MAX_VERIFY_TIME```  u32     maximum verification interval
2231                                             supported by device
2232  ``ETHTOOL_A_MM_STATS``             nested  IEEE 802.3-2018 subclause 30.14.1
2233                                             oMACMergeEntity statistics counters
2234  =================================  ======  ===================================
2235
2236The attributes are populated by the device driver through the following
2237structure:
2238
2239.. kernel-doc:: include/linux/ethtool.h
2240    :identifiers: ethtool_mm_state
2241
2242The ``ETHTOOL_A_MM_VERIFY_STATUS`` will report one of the values from
2243
2244.. kernel-doc:: include/uapi/linux/ethtool.h
2245    :identifiers: ethtool_mm_verify_status
2246
2247If ``ETHTOOL_A_MM_VERIFY_ENABLED`` was passed as false in the ``MM_SET``
2248command, ``ETHTOOL_A_MM_VERIFY_STATUS`` will report either
2249``ETHTOOL_MM_VERIFY_STATUS_INITIAL`` or ``ETHTOOL_MM_VERIFY_STATUS_DISABLED``,
2250otherwise it should report one of the other states.
2251
2252It is recommended that drivers start with the pMAC disabled, and enable it upon
2253user space request. It is also recommended that user space does not depend upon
2254the default values from ``ETHTOOL_MSG_MM_GET`` requests.
2255
2256``ETHTOOL_A_MM_STATS`` are reported if ``ETHTOOL_FLAG_STATS`` was set in
2257``ETHTOOL_A_HEADER_FLAGS``. The attribute will be empty if driver did not
2258report any statistics. Drivers fill in the statistics in the following
2259structure:
2260
2261.. kernel-doc:: include/linux/ethtool.h
2262    :identifiers: ethtool_mm_stats
2263
2264MM_SET
2265======
2266
2267Modifies the configuration of the 802.3 MAC Merge layer.
2268
2269Request contents:
2270
2271  =================================  ======  ==========================
2272  ``ETHTOOL_A_MM_VERIFY_TIME``       u32     see MM_GET description
2273  ``ETHTOOL_A_MM_VERIFY_ENABLED``    bool    see MM_GET description
2274  ``ETHTOOL_A_MM_TX_ENABLED``        bool    see MM_GET description
2275  ``ETHTOOL_A_MM_PMAC_ENABLED``      bool    see MM_GET description
2276  ``ETHTOOL_A_MM_TX_MIN_FRAG_SIZE``  u32     see MM_GET description
2277  =================================  ======  ==========================
2278
2279The attributes are propagated to the driver through the following structure:
2280
2281.. kernel-doc:: include/linux/ethtool.h
2282    :identifiers: ethtool_mm_cfg
2283
2284MODULE_FW_FLASH_ACT
2285===================
2286
2287Flashes transceiver module firmware.
2288
2289Request contents:
2290
2291  =======================================  ======  ===========================
2292  ``ETHTOOL_A_MODULE_FW_FLASH_HEADER``     nested  request header
2293  ``ETHTOOL_A_MODULE_FW_FLASH_FILE_NAME``  string  firmware image file name
2294  ``ETHTOOL_A_MODULE_FW_FLASH_PASSWORD``   u32     transceiver module password
2295  =======================================  ======  ===========================
2296
2297The firmware update process consists of three logical steps:
2298
22991. Downloading a firmware image to the transceiver module and validating it.
23002. Running the firmware image.
23013. Committing the firmware image so that it is run upon reset.
2302
2303When flash command is given, those three steps are taken in that order.
2304
2305This message merely schedules the update process and returns immediately
2306without blocking. The process then runs asynchronously.
2307Since it can take several minutes to complete, during the update process
2308notifications are emitted from the kernel to user space updating it about
2309the status and progress.
2310
2311The ``ETHTOOL_A_MODULE_FW_FLASH_FILE_NAME`` attribute encodes the firmware
2312image file name. The firmware image is downloaded to the transceiver module,
2313validated, run and committed.
2314
2315The optional ``ETHTOOL_A_MODULE_FW_FLASH_PASSWORD`` attribute encodes a password
2316that might be required as part of the transceiver module firmware update
2317process.
2318
2319The firmware update process can take several minutes to complete. Therefore,
2320during the update process notifications are emitted from the kernel to user
2321space updating it about the status and progress.
2322
2323
2324
2325Notification contents:
2326
2327 +---------------------------------------------------+--------+----------------+
2328 | ``ETHTOOL_A_MODULE_FW_FLASH_HEADER``              | nested | reply header   |
2329 +---------------------------------------------------+--------+----------------+
2330 | ``ETHTOOL_A_MODULE_FW_FLASH_STATUS``              | u32    | status         |
2331 +---------------------------------------------------+--------+----------------+
2332 | ``ETHTOOL_A_MODULE_FW_FLASH_STATUS_MSG``          | string | status message |
2333 +---------------------------------------------------+--------+----------------+
2334 | ``ETHTOOL_A_MODULE_FW_FLASH_DONE``                | uint   | progress       |
2335 +---------------------------------------------------+--------+----------------+
2336 | ``ETHTOOL_A_MODULE_FW_FLASH_TOTAL``               | uint   | total          |
2337 +---------------------------------------------------+--------+----------------+
2338
2339The ``ETHTOOL_A_MODULE_FW_FLASH_STATUS`` attribute encodes the current status
2340of the firmware update process. Possible values are:
2341
2342.. kernel-doc:: include/uapi/linux/ethtool.h
2343    :identifiers: ethtool_module_fw_flash_status
2344
2345The ``ETHTOOL_A_MODULE_FW_FLASH_STATUS_MSG`` attribute encodes a status message
2346string.
2347
2348The ``ETHTOOL_A_MODULE_FW_FLASH_DONE`` and ``ETHTOOL_A_MODULE_FW_FLASH_TOTAL``
2349attributes encode the completed and total amount of work, respectively.
2350
2351PHY_GET
2352=======
2353
2354Retrieve information about a given Ethernet PHY sitting on the link. The DO
2355operation returns all available information about dev->phydev. User can also
2356specify a PHY_INDEX, in which case the DO request returns information about that
2357specific PHY.
2358
2359As there can be more than one PHY, the DUMP operation can be used to list the PHYs
2360present on a given interface, by passing an interface index or name in
2361the dump request.
2362
2363For more information, refer to :ref:`phy_link_topology`
2364
2365Request contents:
2366
2367  ====================================  ======  ==========================
2368  ``ETHTOOL_A_PHY_HEADER``              nested  request header
2369  ====================================  ======  ==========================
2370
2371Kernel response contents:
2372
2373  ===================================== ======  ===============================
2374  ``ETHTOOL_A_PHY_HEADER``              nested  request header
2375  ``ETHTOOL_A_PHY_INDEX``               u32     the phy's unique index, that can
2376                                                be used for phy-specific
2377                                                requests
2378  ``ETHTOOL_A_PHY_DRVNAME``             string  the phy driver name
2379  ``ETHTOOL_A_PHY_NAME``                string  the phy device name
2380  ``ETHTOOL_A_PHY_UPSTREAM_TYPE``       u32     the type of device this phy is
2381                                                connected to
2382  ``ETHTOOL_A_PHY_UPSTREAM_INDEX``      u32     the PHY index of the upstream
2383                                                PHY
2384  ``ETHTOOL_A_PHY_UPSTREAM_SFP_NAME``   string  if this PHY is connected to
2385                                                its parent PHY through an SFP
2386                                                bus, the name of this sfp bus
2387  ``ETHTOOL_A_PHY_DOWNSTREAM_SFP_NAME`` string  if the phy controls an sfp bus,
2388                                                the name of the sfp bus
2389  ===================================== ======  ===============================
2390
2391When ``ETHTOOL_A_PHY_UPSTREAM_TYPE`` is PHY_UPSTREAM_PHY, the PHY's parent is
2392another PHY.
2393
2394TSCONFIG_GET
2395============
2396
2397Retrieves the information about the current hardware timestamping source and
2398configuration.
2399
2400It is similar to the deprecated ``SIOCGHWTSTAMP`` ioctl request.
2401
2402Request contents:
2403
2404  ====================================  ======  ==========================
2405  ``ETHTOOL_A_TSCONFIG_HEADER``         nested  request header
2406  ====================================  ======  ==========================
2407
2408Kernel response contents:
2409
2410  ======================================== ======  ============================
2411  ``ETHTOOL_A_TSCONFIG_HEADER``            nested  request header
2412  ``ETHTOOL_A_TSCONFIG_HWTSTAMP_PROVIDER`` nested  PTP hw clock provider
2413  ``ETHTOOL_A_TSCONFIG_TX_TYPES``          bitset  hwtstamp Tx type
2414  ``ETHTOOL_A_TSCONFIG_RX_FILTERS``        bitset  hwtstamp Rx filter
2415  ``ETHTOOL_A_TSCONFIG_HWTSTAMP_FLAGS``	   u32     hwtstamp flags
2416  ======================================== ======  ============================
2417
2418When set the ``ETHTOOL_A_TSCONFIG_HWTSTAMP_PROVIDER`` attribute identifies the
2419source of the hw timestamping provider. It is composed by
2420``ETHTOOL_A_TS_HWTSTAMP_PROVIDER_INDEX`` attribute which describe the index of
2421the PTP device and ``ETHTOOL_A_TS_HWTSTAMP_PROVIDER_QUALIFIER`` which describe
2422the qualifier of the timestamp.
2423
2424When set the ``ETHTOOL_A_TSCONFIG_TX_TYPES``, ``ETHTOOL_A_TSCONFIG_RX_FILTERS``
2425and the ``ETHTOOL_A_TSCONFIG_HWTSTAMP_FLAGS`` attributes identify the Tx
2426type, the Rx filter and the flags configured for the current hw timestamping
2427provider. The attributes are propagated to the driver through the following
2428structure:
2429
2430.. kernel-doc:: include/linux/net_tstamp.h
2431    :identifiers: kernel_hwtstamp_config
2432
2433TSCONFIG_SET
2434============
2435
2436Set the information about the current hardware timestamping source and
2437configuration.
2438
2439It is similar to the deprecated ``SIOCSHWTSTAMP`` ioctl request.
2440
2441Request contents:
2442
2443  ======================================== ======  ============================
2444  ``ETHTOOL_A_TSCONFIG_HEADER``            nested  request header
2445  ``ETHTOOL_A_TSCONFIG_HWTSTAMP_PROVIDER`` nested  PTP hw clock provider
2446  ``ETHTOOL_A_TSCONFIG_TX_TYPES``          bitset  hwtstamp Tx type
2447  ``ETHTOOL_A_TSCONFIG_RX_FILTERS``        bitset  hwtstamp Rx filter
2448  ``ETHTOOL_A_TSCONFIG_HWTSTAMP_FLAGS``	   u32     hwtstamp flags
2449  ======================================== ======  ============================
2450
2451Kernel response contents:
2452
2453  ======================================== ======  ============================
2454  ``ETHTOOL_A_TSCONFIG_HEADER``            nested  request header
2455  ``ETHTOOL_A_TSCONFIG_HWTSTAMP_PROVIDER`` nested  PTP hw clock provider
2456  ``ETHTOOL_A_TSCONFIG_TX_TYPES``          bitset  hwtstamp Tx type
2457  ``ETHTOOL_A_TSCONFIG_RX_FILTERS``        bitset  hwtstamp Rx filter
2458  ``ETHTOOL_A_TSCONFIG_HWTSTAMP_FLAGS``	   u32     hwtstamp flags
2459  ======================================== ======  ============================
2460
2461For a description of each attribute, see ``TSCONFIG_GET``.
2462
2463MSE_GET
2464=======
2465
2466Retrieves detailed Mean Square Error (MSE) diagnostic information from the PHY.
2467
2468Request Contents:
2469
2470  ====================================  ======  ============================
2471  ``ETHTOOL_A_MSE_HEADER``              nested  request header
2472  ====================================  ======  ============================
2473
2474Kernel Response Contents:
2475
2476  ====================================  ======  ================================
2477  ``ETHTOOL_A_MSE_HEADER``              nested  reply header
2478  ``ETHTOOL_A_MSE_CAPABILITIES``        nested  capability/scale info for MSE
2479                                                measurements
2480  ``ETHTOOL_A_MSE_CHANNEL_A``           nested  snapshot for Channel A
2481  ``ETHTOOL_A_MSE_CHANNEL_B``           nested  snapshot for Channel B
2482  ``ETHTOOL_A_MSE_CHANNEL_C``           nested  snapshot for Channel C
2483  ``ETHTOOL_A_MSE_CHANNEL_D``           nested  snapshot for Channel D
2484  ``ETHTOOL_A_MSE_WORST_CHANNEL``       nested  snapshot for worst channel
2485  ``ETHTOOL_A_MSE_LINK``                nested  snapshot for link-wide aggregate
2486  ====================================  ======  ================================
2487
2488MSE Capabilities
2489----------------
2490
2491This nested attribute reports the capability / scaling properties used to
2492interpret snapshot values.
2493
2494  ============================================== ======  =========================
2495  ``ETHTOOL_A_MSE_CAPABILITIES_MAX_AVERAGE_MSE`` uint    max avg_mse scale
2496  ``ETHTOOL_A_MSE_CAPABILITIES_MAX_PEAK_MSE``    uint    max peak_mse scale
2497  ``ETHTOOL_A_MSE_CAPABILITIES_REFRESH_RATE_PS`` uint    sample rate (picoseconds)
2498  ``ETHTOOL_A_MSE_CAPABILITIES_NUM_SYMBOLS``     uint    symbols per HW sample
2499  ============================================== ======  =========================
2500
2501The max-average/peak fields are included only if the corresponding metric
2502is supported by the PHY. Their absence indicates that the metric is not
2503available.
2504
2505See ``struct phy_mse_capability`` kernel documentation in
2506``include/linux/phy.h``.
2507
2508MSE Snapshot
2509------------
2510
2511Each per-channel nest contains an atomic snapshot of MSE values for that
2512selector (channel A/B/C/D, worst channel, or link).
2513
2514  ==========================================  ======  ===================
2515  ``ETHTOOL_A_MSE_SNAPSHOT_AVERAGE_MSE``      uint    average MSE value
2516  ``ETHTOOL_A_MSE_SNAPSHOT_PEAK_MSE``         uint    current peak MSE
2517  ``ETHTOOL_A_MSE_SNAPSHOT_WORST_PEAK_MSE``   uint    worst-case peak MSE
2518  ==========================================  ======  ===================
2519
2520Within each channel nest, only the metrics supported by the PHY will be present.
2521
2522See ``struct phy_mse_snapshot`` kernel documentation in
2523``include/linux/phy.h``.
2524
2525Request translation
2526===================
2527
2528The following table maps ioctl commands to netlink commands providing their
2529functionality. Entries with "n/a" in right column are commands which do not
2530have their netlink replacement yet. Entries which "n/a" in the left column
2531are netlink only.
2532
2533  =================================== =====================================
2534  ioctl command                       netlink command
2535  =================================== =====================================
2536  ``ETHTOOL_GSET``                    ``ETHTOOL_MSG_LINKINFO_GET``
2537                                      ``ETHTOOL_MSG_LINKMODES_GET``
2538  ``ETHTOOL_SSET``                    ``ETHTOOL_MSG_LINKINFO_SET``
2539                                      ``ETHTOOL_MSG_LINKMODES_SET``
2540  ``ETHTOOL_GDRVINFO``                n/a
2541  ``ETHTOOL_GREGS``                   n/a
2542  ``ETHTOOL_GWOL``                    ``ETHTOOL_MSG_WOL_GET``
2543  ``ETHTOOL_SWOL``                    ``ETHTOOL_MSG_WOL_SET``
2544  ``ETHTOOL_GMSGLVL``                 ``ETHTOOL_MSG_DEBUG_GET``
2545  ``ETHTOOL_SMSGLVL``                 ``ETHTOOL_MSG_DEBUG_SET``
2546  ``ETHTOOL_NWAY_RST``                n/a
2547  ``ETHTOOL_GLINK``                   ``ETHTOOL_MSG_LINKSTATE_GET``
2548  ``ETHTOOL_GEEPROM``                 n/a
2549  ``ETHTOOL_SEEPROM``                 n/a
2550  ``ETHTOOL_GCOALESCE``               ``ETHTOOL_MSG_COALESCE_GET``
2551  ``ETHTOOL_SCOALESCE``               ``ETHTOOL_MSG_COALESCE_SET``
2552  ``ETHTOOL_GRINGPARAM``              ``ETHTOOL_MSG_RINGS_GET``
2553  ``ETHTOOL_SRINGPARAM``              ``ETHTOOL_MSG_RINGS_SET``
2554  ``ETHTOOL_GPAUSEPARAM``             ``ETHTOOL_MSG_PAUSE_GET``
2555  ``ETHTOOL_SPAUSEPARAM``             ``ETHTOOL_MSG_PAUSE_SET``
2556  ``ETHTOOL_GRXCSUM``                 ``ETHTOOL_MSG_FEATURES_GET``
2557  ``ETHTOOL_SRXCSUM``                 ``ETHTOOL_MSG_FEATURES_SET``
2558  ``ETHTOOL_GTXCSUM``                 ``ETHTOOL_MSG_FEATURES_GET``
2559  ``ETHTOOL_STXCSUM``                 ``ETHTOOL_MSG_FEATURES_SET``
2560  ``ETHTOOL_GSG``                     ``ETHTOOL_MSG_FEATURES_GET``
2561  ``ETHTOOL_SSG``                     ``ETHTOOL_MSG_FEATURES_SET``
2562  ``ETHTOOL_TEST``                    n/a
2563  ``ETHTOOL_GSTRINGS``                ``ETHTOOL_MSG_STRSET_GET``
2564  ``ETHTOOL_PHYS_ID``                 n/a
2565  ``ETHTOOL_GSTATS``                  n/a
2566  ``ETHTOOL_GTSO``                    ``ETHTOOL_MSG_FEATURES_GET``
2567  ``ETHTOOL_STSO``                    ``ETHTOOL_MSG_FEATURES_SET``
2568  ``ETHTOOL_GPERMADDR``               rtnetlink ``RTM_GETLINK``
2569  ``ETHTOOL_GUFO``                    ``ETHTOOL_MSG_FEATURES_GET``
2570  ``ETHTOOL_SUFO``                    ``ETHTOOL_MSG_FEATURES_SET``
2571  ``ETHTOOL_GGSO``                    ``ETHTOOL_MSG_FEATURES_GET``
2572  ``ETHTOOL_SGSO``                    ``ETHTOOL_MSG_FEATURES_SET``
2573  ``ETHTOOL_GFLAGS``                  ``ETHTOOL_MSG_FEATURES_GET``
2574  ``ETHTOOL_SFLAGS``                  ``ETHTOOL_MSG_FEATURES_SET``
2575  ``ETHTOOL_GPFLAGS``                 ``ETHTOOL_MSG_PRIVFLAGS_GET``
2576  ``ETHTOOL_SPFLAGS``                 ``ETHTOOL_MSG_PRIVFLAGS_SET``
2577  ``ETHTOOL_GRXFH``                   ``ETHTOOL_MSG_RSS_GET``
2578  ``ETHTOOL_SRXFH``                   ``ETHTOOL_MSG_RSS_SET``
2579  ``ETHTOOL_GGRO``                    ``ETHTOOL_MSG_FEATURES_GET``
2580  ``ETHTOOL_SGRO``                    ``ETHTOOL_MSG_FEATURES_SET``
2581  ``ETHTOOL_GRXRINGS``                n/a
2582  ``ETHTOOL_GRXCLSRLCNT``             n/a
2583  ``ETHTOOL_GRXCLSRULE``              n/a
2584  ``ETHTOOL_GRXCLSRLALL``             n/a
2585  ``ETHTOOL_SRXCLSRLDEL``             n/a
2586  ``ETHTOOL_SRXCLSRLINS``             n/a
2587  ``ETHTOOL_FLASHDEV``                n/a
2588  ``ETHTOOL_RESET``                   n/a
2589  ``ETHTOOL_SRXNTUPLE``               n/a
2590  ``ETHTOOL_GRXNTUPLE``               n/a
2591  ``ETHTOOL_GSSET_INFO``              ``ETHTOOL_MSG_STRSET_GET``
2592  ``ETHTOOL_GRXFHINDIR``              ``ETHTOOL_MSG_RSS_GET``
2593  ``ETHTOOL_SRXFHINDIR``              ``ETHTOOL_MSG_RSS_SET``
2594  ``ETHTOOL_GFEATURES``               ``ETHTOOL_MSG_FEATURES_GET``
2595  ``ETHTOOL_SFEATURES``               ``ETHTOOL_MSG_FEATURES_SET``
2596  ``ETHTOOL_GCHANNELS``               ``ETHTOOL_MSG_CHANNELS_GET``
2597  ``ETHTOOL_SCHANNELS``               ``ETHTOOL_MSG_CHANNELS_SET``
2598  ``ETHTOOL_SET_DUMP``                n/a
2599  ``ETHTOOL_GET_DUMP_FLAG``           n/a
2600  ``ETHTOOL_GET_DUMP_DATA``           n/a
2601  ``ETHTOOL_GET_TS_INFO``             ``ETHTOOL_MSG_TSINFO_GET``
2602  ``ETHTOOL_GMODULEINFO``             ``ETHTOOL_MSG_MODULE_EEPROM_GET``
2603  ``ETHTOOL_GMODULEEEPROM``           ``ETHTOOL_MSG_MODULE_EEPROM_GET``
2604  ``ETHTOOL_GEEE``                    ``ETHTOOL_MSG_EEE_GET``
2605  ``ETHTOOL_SEEE``                    ``ETHTOOL_MSG_EEE_SET``
2606  ``ETHTOOL_GRSSH``                   ``ETHTOOL_MSG_RSS_GET``
2607  ``ETHTOOL_SRSSH``                   n/a
2608  ``ETHTOOL_GTUNABLE``                n/a
2609  ``ETHTOOL_STUNABLE``                n/a
2610  ``ETHTOOL_GPHYSTATS``               n/a
2611  ``ETHTOOL_PERQUEUE``                n/a
2612  ``ETHTOOL_GLINKSETTINGS``           ``ETHTOOL_MSG_LINKINFO_GET``
2613                                      ``ETHTOOL_MSG_LINKMODES_GET``
2614  ``ETHTOOL_SLINKSETTINGS``           ``ETHTOOL_MSG_LINKINFO_SET``
2615                                      ``ETHTOOL_MSG_LINKMODES_SET``
2616  ``ETHTOOL_PHY_GTUNABLE``            n/a
2617  ``ETHTOOL_PHY_STUNABLE``            n/a
2618  ``ETHTOOL_GFECPARAM``               ``ETHTOOL_MSG_FEC_GET``
2619  ``ETHTOOL_SFECPARAM``               ``ETHTOOL_MSG_FEC_SET``
2620  n/a                                 ``ETHTOOL_MSG_CABLE_TEST_ACT``
2621  n/a                                 ``ETHTOOL_MSG_CABLE_TEST_TDR_ACT``
2622  n/a                                 ``ETHTOOL_MSG_TUNNEL_INFO_GET``
2623  n/a                                 ``ETHTOOL_MSG_PHC_VCLOCKS_GET``
2624  n/a                                 ``ETHTOOL_MSG_MODULE_GET``
2625  n/a                                 ``ETHTOOL_MSG_MODULE_SET``
2626  n/a                                 ``ETHTOOL_MSG_PLCA_GET_CFG``
2627  n/a                                 ``ETHTOOL_MSG_PLCA_SET_CFG``
2628  n/a                                 ``ETHTOOL_MSG_PLCA_GET_STATUS``
2629  n/a                                 ``ETHTOOL_MSG_MM_GET``
2630  n/a                                 ``ETHTOOL_MSG_MM_SET``
2631  n/a                                 ``ETHTOOL_MSG_MODULE_FW_FLASH_ACT``
2632  n/a                                 ``ETHTOOL_MSG_PHY_GET``
2633  ``SIOCGHWTSTAMP``                   ``ETHTOOL_MSG_TSCONFIG_GET``
2634  ``SIOCSHWTSTAMP``                   ``ETHTOOL_MSG_TSCONFIG_SET``
2635  =================================== =====================================
2636