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