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