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