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