2352 lines · plain
1=============================2Netlink interface for ethtool3=============================4 5 6Basic information7=================8 9Netlink interface for ethtool uses generic netlink family ``ethtool``10(userspace application should use macros ``ETHTOOL_GENL_NAME`` and11``ETHTOOL_GENL_VERSION`` defined in ``<linux/ethtool_netlink.h>`` uapi12header). This family does not use a specific header, all information in13requests and replies is passed using netlink attributes.14 15The ethtool netlink interface uses extended ACK for error and warning16reporting, userspace application developers are encouraged to make these17messages 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 privileges23(``CAP_NET_ADMIN`` in the namespace). Most "get" type requests are allowed for24anyone but there are exceptions (where the response contains sensitive25information). In some cases, the request as such is allowed for anyone but26unprivileged users have attributes with sensitive information (e.g.27wake-on-lan password) omitted.28 29 30Conventions31===========32 33Attributes which represent a boolean value usually use NLA_U8 type so that we34can distinguish three states: "on", "off" and "not present" (meaning the35information is not available in "get" requests or value is not to be changed36in "set" requests). For these attributes, the "true" value should be passed as37number 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 suffixed41with "+", parent nest can contain multiple attributes of the same type. This42implements an array of entries.43 44Attributes that need to be filled-in by device drivers and that are dumped to45user space based on whether they are valid or not should not use zero as a46valid value. This avoids the need to explicitly signal the validity of the47attribute in the device driver API.48 49 50Request header51==============52 53Each request or reply message contains a nested attribute with common header.54Structure of this header is55 56 ============================== ====== =============================57 ``ETHTOOL_A_HEADER_DEV_INDEX`` u32 device ifindex58 ``ETHTOOL_A_HEADER_DEV_NAME`` string device name59 ``ETHTOOL_A_HEADER_FLAGS`` u32 flags common for all requests60 ``ETHTOOL_A_HEADER_PHY_INDEX`` u32 phy device index61 ============================== ====== =============================62 63``ETHTOOL_A_HEADER_DEV_INDEX`` and ``ETHTOOL_A_HEADER_DEV_NAME`` identify the64device message relates to. One of them is sufficient in requests, if both are65used, they must identify the same device. Some requests, e.g. global string66sets, do not require device identification. Most ``GET`` requests also allow67dump requests without device identification to query the same information for68all devices providing it (each device in a separate message).69 70``ETHTOOL_A_HEADER_FLAGS`` is a bitmap of request flags common for all request71types. The interpretation of these flags is the same for all request types but72the flags may not apply to requests. Recognized flags are:73 74 ================================= ===================================75 ``ETHTOOL_FLAG_COMPACT_BITSETS`` use compact format bitsets in reply76 ``ETHTOOL_FLAG_OMIT_REPLY`` omit optional reply (_SET and _ACT)77 ``ETHTOOL_FLAG_STATS`` include optional device statistics78 ================================= ===================================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 aware82of the flag should be interpreted the way the client expects. A client must83not 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 because87there may be more than one PHY on the link, the PHY index can be passed in the88request for the commands that needs it. It is, however, not mandatory, and if it89is not passed for commands that target a PHY, the net_device.phydev pointer90is used.91 92Bit sets93========94 95For short bitmaps of (reasonably) fixed length, standard ``NLA_BITFIELD32``96type is used. For arbitrary length bitmaps, ethtool netlink uses a nested97attribute with contents of one of two forms: compact (two binary bitmaps98representing bit values and mask of affected bits) and bit-by-bit (list of99bits identified by either index or name).100 101Verbose (bit-by-bit) bitsets allow sending symbolic names for bits together102with their values which saves a round trip (when the bitset is passed in a103request) or at least a second request (when the bitset is in a reply). This is104useful for one shot applications like traditional ethtool command. On the105other hand, long running applications like ethtool monitor (displaying106notifications) or network management daemons may prefer fetching the names107only once and using compact form to save message size. Notifications from108ethtool 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 requests112modifying a bitmap, the former changes the bit set in mask to values set in113value and preserves the rest; the latter sets the bits set in the bitmap and114clears the rest.115 116Compact form: nested (bitset) attribute contents:117 118 ============================ ====== ============================119 ``ETHTOOL_A_BITSET_NOMASK`` flag no mask, only a list120 ``ETHTOOL_A_BITSET_SIZE`` u32 number of significant bits121 ``ETHTOOL_A_BITSET_VALUE`` binary bitmap of bit values122 ``ETHTOOL_A_BITSET_MASK`` binary bitmap of valid bits123 ============================ ====== ============================124 125Value and mask must have length at least ``ETHTOOL_A_BITSET_SIZE`` bits126rounded up to a multiple of 32 bits. They consist of 32-bit words in host byte127order, words ordered from least significant to most significant (i.e. the same128way as bitmaps are passed with ioctl interface).129 130For compact form, ``ETHTOOL_A_BITSET_SIZE`` and ``ETHTOOL_A_BITSET_VALUE`` are131mandatory. ``ETHTOOL_A_BITSET_MASK`` attribute is mandatory if132``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 not134allowed (bitset represents a single bitmap.135 136Kernel bit set length may differ from userspace length if older application is137used on newer kernel or vice versa. If userspace bitmap is longer, an error is138issued only if the request actually tries to set values of some bits not139recognized 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 can160only contain ``ETHTOOL_A_BITSET_BITS_BIT`` attributes but there can be an161arbitrary number of them. A bit may be identified by its index or by its162name. When used in requests, listed bits are set to 0 or 1 according to163``ETHTOOL_A_BITSET_BIT_VALUE``, the rest is preserved. A request fails if164index exceeds kernel bit length or if name is not recognized.165 166When ``ETHTOOL_A_BITSET_NOMASK`` flag is present, bitset is interpreted as167a simple bitmap. ``ETHTOOL_A_BITSET_BIT_VALUE`` attributes are not used in168such case. Such bitset represents a bitmap with listed bits set and the rest169zero.170 171In requests, application can use either form. Form used by kernel in reply is172determined by ``ETHTOOL_FLAG_COMPACT_BITSETS`` flag in flags field of request173header. Semantics of value and mask depends on the attribute.174 175 176List of message types177=====================178 179All constants identifying message types use ``ETHTOOL_CMD_`` prefix and suffix180according to message purpose:181 182 ============== ======================================183 ``_GET`` userspace request to retrieve data184 ``_SET`` userspace request to set data185 ``_ACT`` userspace request to perform an action186 ``_GET_REPLY`` kernel reply to a ``GET`` request187 ``_SET_REPLY`` kernel reply to a ``SET`` request188 ``_ACT_REPLY`` kernel reply to an ``ACT`` request189 ``_NTF`` kernel notification190 ============== ======================================191 192Userspace to kernel:193 194 ===================================== =================================195 ``ETHTOOL_MSG_STRSET_GET`` get string set196 ``ETHTOOL_MSG_LINKINFO_GET`` get link settings197 ``ETHTOOL_MSG_LINKINFO_SET`` set link settings198 ``ETHTOOL_MSG_LINKMODES_GET`` get link modes info199 ``ETHTOOL_MSG_LINKMODES_SET`` set link modes info200 ``ETHTOOL_MSG_LINKSTATE_GET`` get link state201 ``ETHTOOL_MSG_DEBUG_GET`` get debugging settings202 ``ETHTOOL_MSG_DEBUG_SET`` set debugging settings203 ``ETHTOOL_MSG_WOL_GET`` get wake-on-lan settings204 ``ETHTOOL_MSG_WOL_SET`` set wake-on-lan settings205 ``ETHTOOL_MSG_FEATURES_GET`` get device features206 ``ETHTOOL_MSG_FEATURES_SET`` set device features207 ``ETHTOOL_MSG_PRIVFLAGS_GET`` get private flags208 ``ETHTOOL_MSG_PRIVFLAGS_SET`` set private flags209 ``ETHTOOL_MSG_RINGS_GET`` get ring sizes210 ``ETHTOOL_MSG_RINGS_SET`` set ring sizes211 ``ETHTOOL_MSG_CHANNELS_GET`` get channel counts212 ``ETHTOOL_MSG_CHANNELS_SET`` set channel counts213 ``ETHTOOL_MSG_COALESCE_GET`` get coalescing parameters214 ``ETHTOOL_MSG_COALESCE_SET`` set coalescing parameters215 ``ETHTOOL_MSG_PAUSE_GET`` get pause parameters216 ``ETHTOOL_MSG_PAUSE_SET`` set pause parameters217 ``ETHTOOL_MSG_EEE_GET`` get EEE settings218 ``ETHTOOL_MSG_EEE_SET`` set EEE settings219 ``ETHTOOL_MSG_TSINFO_GET`` get timestamping info220 ``ETHTOOL_MSG_CABLE_TEST_ACT`` action start cable test221 ``ETHTOOL_MSG_CABLE_TEST_TDR_ACT`` action start raw TDR cable test222 ``ETHTOOL_MSG_TUNNEL_INFO_GET`` get tunnel offload info223 ``ETHTOOL_MSG_FEC_GET`` get FEC settings224 ``ETHTOOL_MSG_FEC_SET`` set FEC settings225 ``ETHTOOL_MSG_MODULE_EEPROM_GET`` read SFP module EEPROM226 ``ETHTOOL_MSG_STATS_GET`` get standard statistics227 ``ETHTOOL_MSG_PHC_VCLOCKS_GET`` get PHC virtual clocks info228 ``ETHTOOL_MSG_MODULE_SET`` set transceiver module parameters229 ``ETHTOOL_MSG_MODULE_GET`` get transceiver module parameters230 ``ETHTOOL_MSG_PSE_SET`` set PSE parameters231 ``ETHTOOL_MSG_PSE_GET`` get PSE parameters232 ``ETHTOOL_MSG_RSS_GET`` get RSS settings233 ``ETHTOOL_MSG_PLCA_GET_CFG`` get PLCA RS parameters234 ``ETHTOOL_MSG_PLCA_SET_CFG`` set PLCA RS parameters235 ``ETHTOOL_MSG_PLCA_GET_STATUS`` get PLCA RS status236 ``ETHTOOL_MSG_MM_GET`` get MAC merge layer state237 ``ETHTOOL_MSG_MM_SET`` set MAC merge layer parameters238 ``ETHTOOL_MSG_MODULE_FW_FLASH_ACT`` flash transceiver module firmware239 ===================================== =================================240 241Kernel to userspace:242 243 ======================================== =================================244 ``ETHTOOL_MSG_STRSET_GET_REPLY`` string set contents245 ``ETHTOOL_MSG_LINKINFO_GET_REPLY`` link settings246 ``ETHTOOL_MSG_LINKINFO_NTF`` link settings notification247 ``ETHTOOL_MSG_LINKMODES_GET_REPLY`` link modes info248 ``ETHTOOL_MSG_LINKMODES_NTF`` link modes notification249 ``ETHTOOL_MSG_LINKSTATE_GET_REPLY`` link state info250 ``ETHTOOL_MSG_DEBUG_GET_REPLY`` debugging settings251 ``ETHTOOL_MSG_DEBUG_NTF`` debugging settings notification252 ``ETHTOOL_MSG_WOL_GET_REPLY`` wake-on-lan settings253 ``ETHTOOL_MSG_WOL_NTF`` wake-on-lan settings notification254 ``ETHTOOL_MSG_FEATURES_GET_REPLY`` device features255 ``ETHTOOL_MSG_FEATURES_SET_REPLY`` optional reply to FEATURES_SET256 ``ETHTOOL_MSG_FEATURES_NTF`` netdev features notification257 ``ETHTOOL_MSG_PRIVFLAGS_GET_REPLY`` private flags258 ``ETHTOOL_MSG_PRIVFLAGS_NTF`` private flags259 ``ETHTOOL_MSG_RINGS_GET_REPLY`` ring sizes260 ``ETHTOOL_MSG_RINGS_NTF`` ring sizes261 ``ETHTOOL_MSG_CHANNELS_GET_REPLY`` channel counts262 ``ETHTOOL_MSG_CHANNELS_NTF`` channel counts263 ``ETHTOOL_MSG_COALESCE_GET_REPLY`` coalescing parameters264 ``ETHTOOL_MSG_COALESCE_NTF`` coalescing parameters265 ``ETHTOOL_MSG_PAUSE_GET_REPLY`` pause parameters266 ``ETHTOOL_MSG_PAUSE_NTF`` pause parameters267 ``ETHTOOL_MSG_EEE_GET_REPLY`` EEE settings268 ``ETHTOOL_MSG_EEE_NTF`` EEE settings269 ``ETHTOOL_MSG_TSINFO_GET_REPLY`` timestamping info270 ``ETHTOOL_MSG_CABLE_TEST_NTF`` Cable test results271 ``ETHTOOL_MSG_CABLE_TEST_TDR_NTF`` Cable test TDR results272 ``ETHTOOL_MSG_TUNNEL_INFO_GET_REPLY`` tunnel offload info273 ``ETHTOOL_MSG_FEC_GET_REPLY`` FEC settings274 ``ETHTOOL_MSG_FEC_NTF`` FEC settings275 ``ETHTOOL_MSG_MODULE_EEPROM_GET_REPLY`` read SFP module EEPROM276 ``ETHTOOL_MSG_STATS_GET_REPLY`` standard statistics277 ``ETHTOOL_MSG_PHC_VCLOCKS_GET_REPLY`` PHC virtual clocks info278 ``ETHTOOL_MSG_MODULE_GET_REPLY`` transceiver module parameters279 ``ETHTOOL_MSG_PSE_GET_REPLY`` PSE parameters280 ``ETHTOOL_MSG_RSS_GET_REPLY`` RSS settings281 ``ETHTOOL_MSG_PLCA_GET_CFG_REPLY`` PLCA RS parameters282 ``ETHTOOL_MSG_PLCA_GET_STATUS_REPLY`` PLCA RS status283 ``ETHTOOL_MSG_PLCA_NTF`` PLCA RS parameters284 ``ETHTOOL_MSG_MM_GET_REPLY`` MAC merge layer status285 ``ETHTOOL_MSG_MODULE_FW_FLASH_NTF`` transceiver module flash updates286 ======================================== =================================287 288``GET`` requests are sent by userspace applications to retrieve device289information. They usually do not contain any message specific attributes.290Kernel replies with corresponding "GET_REPLY" message. For most types, ``GET``291request with ``NLM_F_DUMP`` and no device identification can be used to query292the information for all devices supporting the request.293 294If the data can be also modified, corresponding ``SET`` message with the same295layout as corresponding ``GET_REPLY`` is used to request changes. Only296attributes where a change is requested are included in such request (also, not297all attributes may be changed). Replies to most ``SET`` request consist only298of error code and extack; if kernel provides additional data, it is sent in299the form of corresponding ``SET_REPLY`` message which can be suppressed by300setting ``ETHTOOL_FLAG_OMIT_REPLY`` flag in request header.301 302Data modification also triggers sending a ``NTF`` message with a notification.303These usually bear only a subset of attributes which was affected by the304change. The same notification is issued if the data is modified using other305means (mostly ioctl ethtool interface). Unlike notifications from ethtool306netlink code which are only sent if something actually changed, notifications307triggered by ioctl interface may be sent even if the request did not actually308change any data.309 310``ACT`` messages request kernel (driver) to perform a specific action. If some311information is reported by kernel (which can be suppressed by setting312``ETHTOOL_FLAG_OMIT_REPLY`` flag in request header), the reply takes form of313an ``ACT_REPLY`` message. Performing an action also triggers a notification314(``NTF`` message).315 316Later sections describe the format and semantics of these messages.317 318 319STRSET_GET320==========321 322Requests contents of a string set as provided by ioctl commands323``ETHTOOL_GSSET_INFO`` and ``ETHTOOL_GSTRINGS.`` String sets are not user324writeable so that the corresponding ``STRSET_SET`` message is only used in325kernel replies. There are two types of string sets: global (independent of326a device, e.g. device feature names) and device specific (e.g. device private327flags).328 329Request contents:330 331 +---------------------------------------+--------+------------------------+332 | ``ETHTOOL_A_STRSET_HEADER`` | nested | request header |333 +---------------------------------------+--------+------------------------+334 | ``ETHTOOL_A_STRSET_STRINGSETS`` | nested | string set to request |335 +-+-------------------------------------+--------+------------------------+336 | | ``ETHTOOL_A_STRINGSETS_STRINGSET+`` | nested | one string set |337 +-+-+-----------------------------------+--------+------------------------+338 | | | ``ETHTOOL_A_STRINGSET_ID`` | u32 | set id |339 +-+-+-----------------------------------+--------+------------------------+340 341Kernel response contents:342 343 +---------------------------------------+--------+-----------------------+344 | ``ETHTOOL_A_STRSET_HEADER`` | nested | reply header |345 +---------------------------------------+--------+-----------------------+346 | ``ETHTOOL_A_STRSET_STRINGSETS`` | nested | array of string sets |347 +-+-------------------------------------+--------+-----------------------+348 | | ``ETHTOOL_A_STRINGSETS_STRINGSET+`` | nested | one string set |349 +-+-+-----------------------------------+--------+-----------------------+350 | | | ``ETHTOOL_A_STRINGSET_ID`` | u32 | set id |351 +-+-+-----------------------------------+--------+-----------------------+352 | | | ``ETHTOOL_A_STRINGSET_COUNT`` | u32 | number of strings |353 +-+-+-----------------------------------+--------+-----------------------+354 | | | ``ETHTOOL_A_STRINGSET_STRINGS`` | nested | array of strings |355 +-+-+-+---------------------------------+--------+-----------------------+356 | | | | ``ETHTOOL_A_STRINGS_STRING+`` | nested | one string |357 +-+-+-+-+-------------------------------+--------+-----------------------+358 | | | | | ``ETHTOOL_A_STRING_INDEX`` | u32 | string index |359 +-+-+-+-+-------------------------------+--------+-----------------------+360 | | | | | ``ETHTOOL_A_STRING_VALUE`` | string | string value |361 +-+-+-+-+-------------------------------+--------+-----------------------+362 | ``ETHTOOL_A_STRSET_COUNTS_ONLY`` | flag | return only counts |363 +---------------------------------------+--------+-----------------------+364 365Device identification in request header is optional. Depending on its presence366a and ``NLM_F_DUMP`` flag, there are three type of ``STRSET_GET`` requests:367 368 - no ``NLM_F_DUMP,`` no device: get "global" stringsets369 - no ``NLM_F_DUMP``, with device: get string sets related to the device370 - ``NLM_F_DUMP``, no device: get device related string sets for all devices371 372If there is no ``ETHTOOL_A_STRSET_STRINGSETS`` array, all string sets of373requested type are returned, otherwise only those specified in the request.374Flag ``ETHTOOL_A_STRSET_COUNTS_ONLY`` tells kernel to only return string375counts of the sets, not the actual strings.376 377 378LINKINFO_GET379============380 381Requests link settings as provided by ``ETHTOOL_GLINKSETTINGS`` except for382link modes and autonegotiation related information. The request does not use383any attributes.384 385Request contents:386 387 ==================================== ====== ==========================388 ``ETHTOOL_A_LINKINFO_HEADER`` nested request header389 ==================================== ====== ==========================390 391Kernel response contents:392 393 ==================================== ====== ==========================394 ``ETHTOOL_A_LINKINFO_HEADER`` nested reply header395 ``ETHTOOL_A_LINKINFO_PORT`` u8 physical port396 ``ETHTOOL_A_LINKINFO_PHYADDR`` u8 phy MDIO address397 ``ETHTOOL_A_LINKINFO_TP_MDIX`` u8 MDI(-X) status398 ``ETHTOOL_A_LINKINFO_TP_MDIX_CTRL`` u8 MDI(-X) control399 ``ETHTOOL_A_LINKINFO_TRANSCEIVER`` u8 transceiver400 ==================================== ====== ==========================401 402Attributes and their values have the same meaning as matching members of the403corresponding ioctl structures.404 405``LINKINFO_GET`` allows dump requests (kernel returns reply message for all406devices supporting the request).407 408 409LINKINFO_SET410============411 412``LINKINFO_SET`` request allows setting some of the attributes reported by413``LINKINFO_GET``.414 415Request contents:416 417 ==================================== ====== ==========================418 ``ETHTOOL_A_LINKINFO_HEADER`` nested request header419 ``ETHTOOL_A_LINKINFO_PORT`` u8 physical port420 ``ETHTOOL_A_LINKINFO_PHYADDR`` u8 phy MDIO address421 ``ETHTOOL_A_LINKINFO_TP_MDIX_CTRL`` u8 MDI(-X) control422 ==================================== ====== ==========================423 424MDI(-X) status and transceiver cannot be set, request with the corresponding425attributes is rejected.426 427 428LINKMODES_GET429=============430 431Requests link modes (supported, advertised and peer advertised) and related432information (autonegotiation status, link speed and duplex) as provided by433``ETHTOOL_GLINKSETTINGS``. The request does not use any attributes.434 435Request contents:436 437 ==================================== ====== ==========================438 ``ETHTOOL_A_LINKMODES_HEADER`` nested request header439 ==================================== ====== ==========================440 441Kernel response contents:442 443 ========================================== ====== ==========================444 ``ETHTOOL_A_LINKMODES_HEADER`` nested reply header445 ``ETHTOOL_A_LINKMODES_AUTONEG`` u8 autonegotiation status446 ``ETHTOOL_A_LINKMODES_OURS`` bitset advertised link modes447 ``ETHTOOL_A_LINKMODES_PEER`` bitset partner link modes448 ``ETHTOOL_A_LINKMODES_SPEED`` u32 link speed (Mb/s)449 ``ETHTOOL_A_LINKMODES_DUPLEX`` u8 duplex mode450 ``ETHTOOL_A_LINKMODES_MASTER_SLAVE_CFG`` u8 Master/slave port mode451 ``ETHTOOL_A_LINKMODES_MASTER_SLAVE_STATE`` u8 Master/slave port state452 ``ETHTOOL_A_LINKMODES_RATE_MATCHING`` u8 PHY rate matching453 ========================================== ====== ==========================454 455For ``ETHTOOL_A_LINKMODES_OURS``, value represents advertised modes and mask456represents supported modes. ``ETHTOOL_A_LINKMODES_PEER`` in the reply is a bit457list.458 459``LINKMODES_GET`` allows dump requests (kernel returns reply messages for all460devices supporting the request).461 462 463LINKMODES_SET464=============465 466Request contents:467 468 ========================================== ====== ==========================469 ``ETHTOOL_A_LINKMODES_HEADER`` nested request header470 ``ETHTOOL_A_LINKMODES_AUTONEG`` u8 autonegotiation status471 ``ETHTOOL_A_LINKMODES_OURS`` bitset advertised link modes472 ``ETHTOOL_A_LINKMODES_PEER`` bitset partner link modes473 ``ETHTOOL_A_LINKMODES_SPEED`` u32 link speed (Mb/s)474 ``ETHTOOL_A_LINKMODES_DUPLEX`` u8 duplex mode475 ``ETHTOOL_A_LINKMODES_MASTER_SLAVE_CFG`` u8 Master/slave port mode476 ``ETHTOOL_A_LINKMODES_RATE_MATCHING`` u8 PHY rate matching477 ``ETHTOOL_A_LINKMODES_LANES`` u32 lanes478 ========================================== ====== ==========================479 480``ETHTOOL_A_LINKMODES_OURS`` bit set allows setting advertised link modes. If481autonegotiation is on (either set now or kept from before), advertised modes482are not changed (no ``ETHTOOL_A_LINKMODES_OURS`` attribute) and at least one483of speed, duplex and lanes is specified, kernel adjusts advertised modes to all484supported modes matching speed, duplex, lanes or all (whatever is specified).485This autoselection is done on ethtool side with ioctl interface, netlink486interface is supposed to allow requesting changes without knowing what exactly487kernel supports.488 489 490LINKSTATE_GET491=============492 493Requests link state information. Link up/down flag (as provided by494``ETHTOOL_GLINK`` ioctl command) is provided. Optionally, extended state might495be provided as well. In general, extended state describes reasons for why a port496is down, or why it operates in some non-obvious mode. This request does not have497any attributes.498 499Request contents:500 501 ==================================== ====== ==========================502 ``ETHTOOL_A_LINKSTATE_HEADER`` nested request header503 ==================================== ====== ==========================504 505Kernel response contents:506 507 ==================================== ====== ============================508 ``ETHTOOL_A_LINKSTATE_HEADER`` nested reply header509 ``ETHTOOL_A_LINKSTATE_LINK`` bool link state (up/down)510 ``ETHTOOL_A_LINKSTATE_SQI`` u32 Current Signal Quality Index511 ``ETHTOOL_A_LINKSTATE_SQI_MAX`` u32 Max support SQI value512 ``ETHTOOL_A_LINKSTATE_EXT_STATE`` u8 link extended state513 ``ETHTOOL_A_LINKSTATE_EXT_SUBSTATE`` u8 link extended substate514 ``ETHTOOL_A_LINKSTATE_EXT_DOWN_CNT`` u32 count of link down events515 ==================================== ====== ============================516 517For most NIC drivers, the value of ``ETHTOOL_A_LINKSTATE_LINK`` returns518carrier flag provided by ``netif_carrier_ok()`` but there are drivers which519define their own handler.520 521``ETHTOOL_A_LINKSTATE_EXT_STATE`` and ``ETHTOOL_A_LINKSTATE_EXT_SUBSTATE`` are522optional values. ethtool core can provide either both523``ETHTOOL_A_LINKSTATE_EXT_STATE`` and ``ETHTOOL_A_LINKSTATE_EXT_SUBSTATE``,524or only ``ETHTOOL_A_LINKSTATE_EXT_STATE``, or none of them.525 526``LINKSTATE_GET`` allows dump requests (kernel returns reply messages for all527devices supporting the request).528 529 530Link extended states:531 532 ================================================ ============================================533 ``ETHTOOL_LINK_EXT_STATE_AUTONEG`` States relating to the autonegotiation or534 issues therein535 536 ``ETHTOOL_LINK_EXT_STATE_LINK_TRAINING_FAILURE`` Failure during link training537 538 ``ETHTOOL_LINK_EXT_STATE_LINK_LOGICAL_MISMATCH`` Logical mismatch in physical coding sublayer539 or forward error correction sublayer540 541 ``ETHTOOL_LINK_EXT_STATE_BAD_SIGNAL_INTEGRITY`` Signal integrity issues542 543 ``ETHTOOL_LINK_EXT_STATE_NO_CABLE`` No cable connected544 545 ``ETHTOOL_LINK_EXT_STATE_CABLE_ISSUE`` Failure is related to cable,546 e.g., unsupported cable547 548 ``ETHTOOL_LINK_EXT_STATE_EEPROM_ISSUE`` Failure is related to EEPROM, e.g., failure549 during reading or parsing the data550 551 ``ETHTOOL_LINK_EXT_STATE_CALIBRATION_FAILURE`` Failure during calibration algorithm552 553 ``ETHTOOL_LINK_EXT_STATE_POWER_BUDGET_EXCEEDED`` The hardware is not able to provide the554 power required from cable or module555 556 ``ETHTOOL_LINK_EXT_STATE_OVERHEAT`` The module is overheated557 558 ``ETHTOOL_LINK_EXT_STATE_MODULE`` Transceiver module issue559 ================================================ ============================================560 561Link extended substates:562 563 Autoneg substates:564 565 =============================================================== ================================566 ``ETHTOOL_LINK_EXT_SUBSTATE_AN_NO_PARTNER_DETECTED`` Peer side is down567 568 ``ETHTOOL_LINK_EXT_SUBSTATE_AN_ACK_NOT_RECEIVED`` Ack not received from peer side569 570 ``ETHTOOL_LINK_EXT_SUBSTATE_AN_NEXT_PAGE_EXCHANGE_FAILED`` Next page exchange failed571 572 ``ETHTOOL_LINK_EXT_SUBSTATE_AN_NO_PARTNER_DETECTED_FORCE_MODE`` Peer side is down during force573 mode or there is no agreement of574 speed575 576 ``ETHTOOL_LINK_EXT_SUBSTATE_AN_FEC_MISMATCH_DURING_OVERRIDE`` Forward error correction modes577 in both sides are mismatched578 579 ``ETHTOOL_LINK_EXT_SUBSTATE_AN_NO_HCD`` No Highest Common Denominator580 =============================================================== ================================581 582 Link training substates:583 584 =========================================================================== ====================585 ``ETHTOOL_LINK_EXT_SUBSTATE_LT_KR_FRAME_LOCK_NOT_ACQUIRED`` Frames were not586 recognized, the587 lock failed588 589 ``ETHTOOL_LINK_EXT_SUBSTATE_LT_KR_LINK_INHIBIT_TIMEOUT`` The lock did not590 occur before591 timeout592 593 ``ETHTOOL_LINK_EXT_SUBSTATE_LT_KR_LINK_PARTNER_DID_NOT_SET_RECEIVER_READY`` Peer side did not594 send ready signal595 after training596 process597 598 ``ETHTOOL_LINK_EXT_SUBSTATE_LT_REMOTE_FAULT`` Remote side is not599 ready yet600 =========================================================================== ====================601 602 Link logical mismatch substates:603 604 ================================================================ ===============================605 ``ETHTOOL_LINK_EXT_SUBSTATE_LLM_PCS_DID_NOT_ACQUIRE_BLOCK_LOCK`` Physical coding sublayer was606 not locked in first phase -607 block lock608 609 ``ETHTOOL_LINK_EXT_SUBSTATE_LLM_PCS_DID_NOT_ACQUIRE_AM_LOCK`` Physical coding sublayer was610 not locked in second phase -611 alignment markers lock612 613 ``ETHTOOL_LINK_EXT_SUBSTATE_LLM_PCS_DID_NOT_GET_ALIGN_STATUS`` Physical coding sublayer did614 not get align status615 616 ``ETHTOOL_LINK_EXT_SUBSTATE_LLM_FC_FEC_IS_NOT_LOCKED`` FC forward error correction is617 not locked618 619 ``ETHTOOL_LINK_EXT_SUBSTATE_LLM_RS_FEC_IS_NOT_LOCKED`` RS forward error correction is620 not locked621 ================================================================ ===============================622 623 Bad signal integrity substates:624 625 ================================================================= =============================626 ``ETHTOOL_LINK_EXT_SUBSTATE_BSI_LARGE_NUMBER_OF_PHYSICAL_ERRORS`` Large number of physical627 errors628 629 ``ETHTOOL_LINK_EXT_SUBSTATE_BSI_UNSUPPORTED_RATE`` The system attempted to630 operate the cable at a rate631 that is not formally632 supported, which led to633 signal integrity issues634 635 ``ETHTOOL_LINK_EXT_SUBSTATE_BSI_SERDES_REFERENCE_CLOCK_LOST`` The external clock signal for636 SerDes is too weak or637 unavailable.638 639 ``ETHTOOL_LINK_EXT_SUBSTATE_BSI_SERDES_ALOS`` The received signal for640 SerDes is too weak because641 analog loss of signal.642 ================================================================= =============================643 644 Cable issue substates:645 646 =================================================== ============================================647 ``ETHTOOL_LINK_EXT_SUBSTATE_CI_UNSUPPORTED_CABLE`` Unsupported cable648 649 ``ETHTOOL_LINK_EXT_SUBSTATE_CI_CABLE_TEST_FAILURE`` Cable test failure650 =================================================== ============================================651 652 Transceiver module issue substates:653 654 =================================================== ============================================655 ``ETHTOOL_LINK_EXT_SUBSTATE_MODULE_CMIS_NOT_READY`` The CMIS Module State Machine did not reach656 the ModuleReady state. For example, if the657 module is stuck at ModuleFault state658 =================================================== ============================================659 660DEBUG_GET661=========662 663Requests debugging settings of a device. At the moment, only message mask is664provided.665 666Request contents:667 668 ==================================== ====== ==========================669 ``ETHTOOL_A_DEBUG_HEADER`` nested request header670 ==================================== ====== ==========================671 672Kernel response contents:673 674 ==================================== ====== ==========================675 ``ETHTOOL_A_DEBUG_HEADER`` nested reply header676 ``ETHTOOL_A_DEBUG_MSGMASK`` bitset message mask677 ==================================== ====== ==========================678 679The message mask (``ETHTOOL_A_DEBUG_MSGMASK``) is equal to message level as680provided by ``ETHTOOL_GMSGLVL`` and set by ``ETHTOOL_SMSGLVL`` in ioctl681interface. While it is called message level there for historical reasons, most682drivers and almost all newer drivers use it as a mask of enabled message683classes (represented by ``NETIF_MSG_*`` constants); therefore netlink684interface follows its actual use in practice.685 686``DEBUG_GET`` allows dump requests (kernel returns reply messages for all687devices supporting the request).688 689 690DEBUG_SET691=========692 693Set or update debugging settings of a device. At the moment, only message mask694is supported.695 696Request contents:697 698 ==================================== ====== ==========================699 ``ETHTOOL_A_DEBUG_HEADER`` nested request header700 ``ETHTOOL_A_DEBUG_MSGMASK`` bitset message mask701 ==================================== ====== ==========================702 703``ETHTOOL_A_DEBUG_MSGMASK`` bit set allows setting or modifying mask of704enabled debugging message types for the device.705 706 707WOL_GET708=======709 710Query device wake-on-lan settings. Unlike most "GET" type requests,711``ETHTOOL_MSG_WOL_GET`` requires (netns) ``CAP_NET_ADMIN`` privileges as it712(potentially) provides SecureOn(tm) password which is confidential.713 714Request contents:715 716 ==================================== ====== ==========================717 ``ETHTOOL_A_WOL_HEADER`` nested request header718 ==================================== ====== ==========================719 720Kernel response contents:721 722 ==================================== ====== ==========================723 ``ETHTOOL_A_WOL_HEADER`` nested reply header724 ``ETHTOOL_A_WOL_MODES`` bitset mask of enabled WoL modes725 ``ETHTOOL_A_WOL_SOPASS`` binary SecureOn(tm) password726 ==================================== ====== ==========================727 728In reply, ``ETHTOOL_A_WOL_MODES`` mask consists of modes supported by the729device, value of modes which are enabled. ``ETHTOOL_A_WOL_SOPASS`` is only730included in reply if ``WAKE_MAGICSECURE`` mode is supported.731 732 733WOL_SET734=======735 736Set or update wake-on-lan settings.737 738Request contents:739 740 ==================================== ====== ==========================741 ``ETHTOOL_A_WOL_HEADER`` nested request header742 ``ETHTOOL_A_WOL_MODES`` bitset enabled WoL modes743 ``ETHTOOL_A_WOL_SOPASS`` binary SecureOn(tm) password744 ==================================== ====== ==========================745 746``ETHTOOL_A_WOL_SOPASS`` is only allowed for devices supporting747``WAKE_MAGICSECURE`` mode.748 749 750FEATURES_GET751============752 753Gets netdev features like ``ETHTOOL_GFEATURES`` ioctl request.754 755Request contents:756 757 ==================================== ====== ==========================758 ``ETHTOOL_A_FEATURES_HEADER`` nested request header759 ==================================== ====== ==========================760 761Kernel response contents:762 763 ==================================== ====== ==========================764 ``ETHTOOL_A_FEATURES_HEADER`` nested reply header765 ``ETHTOOL_A_FEATURES_HW`` bitset dev->hw_features766 ``ETHTOOL_A_FEATURES_WANTED`` bitset dev->wanted_features767 ``ETHTOOL_A_FEATURES_ACTIVE`` bitset dev->features768 ``ETHTOOL_A_FEATURES_NOCHANGE`` bitset NETIF_F_NEVER_CHANGE769 ==================================== ====== ==========================770 771Bitmaps in kernel response have the same meaning as bitmaps used in ioctl772interference but attribute names are different (they are based on773corresponding members of struct net_device). Legacy "flags" are not provided,774if userspace needs them (most likely only ethtool for backward compatibility),775it can calculate their values from related feature bits itself.776ETHA_FEATURES_HW uses mask consisting of all features recognized by kernel (to777provide all names when using verbose bitmap format), the other three use no778mask (simple bit lists).779 780 781FEATURES_SET782============783 784Request to set netdev features like ``ETHTOOL_SFEATURES`` ioctl request.785 786Request contents:787 788 ==================================== ====== ==========================789 ``ETHTOOL_A_FEATURES_HEADER`` nested request header790 ``ETHTOOL_A_FEATURES_WANTED`` bitset requested features791 ==================================== ====== ==========================792 793Kernel response contents:794 795 ==================================== ====== ==========================796 ``ETHTOOL_A_FEATURES_HEADER`` nested reply header797 ``ETHTOOL_A_FEATURES_WANTED`` bitset diff wanted vs. result798 ``ETHTOOL_A_FEATURES_ACTIVE`` bitset diff old vs. new active799 ==================================== ====== ==========================800 801Request contains only one bitset which can be either value/mask pair (request802to change specific feature bits and leave the rest) or only a value (request803to set all features to specified set).804 805As request is subject to netdev_change_features() sanity checks, optional806kernel reply (can be suppressed by ``ETHTOOL_FLAG_OMIT_REPLY`` flag in request807header) informs client about the actual result. ``ETHTOOL_A_FEATURES_WANTED``808reports the difference between client request and actual result: mask consists809of bits which differ between requested features and result (dev->features810after the operation), value consists of values of these bits in the request811(i.e. negated values from resulting features). ``ETHTOOL_A_FEATURES_ACTIVE``812reports the difference between old and new dev->features: mask consists of813bits which have changed, values are their values in new dev->features (after814the operation).815 816``ETHTOOL_MSG_FEATURES_NTF`` notification is sent not only if device features817are modified using ``ETHTOOL_MSG_FEATURES_SET`` request or on of ethtool ioctl818request but also each time features are modified with netdev_update_features()819or netdev_change_features().820 821 822PRIVFLAGS_GET823=============824 825Gets private flags like ``ETHTOOL_GPFLAGS`` ioctl request.826 827Request contents:828 829 ==================================== ====== ==========================830 ``ETHTOOL_A_PRIVFLAGS_HEADER`` nested request header831 ==================================== ====== ==========================832 833Kernel response contents:834 835 ==================================== ====== ==========================836 ``ETHTOOL_A_PRIVFLAGS_HEADER`` nested reply header837 ``ETHTOOL_A_PRIVFLAGS_FLAGS`` bitset private flags838 ==================================== ====== ==========================839 840``ETHTOOL_A_PRIVFLAGS_FLAGS`` is a bitset with values of device private flags.841These flags are defined by driver, their number and names (and also meaning)842are device dependent. For compact bitset format, names can be retrieved as843``ETH_SS_PRIV_FLAGS`` string set. If verbose bitset format is requested,844response uses all private flags supported by the device as mask so that client845gets the full information without having to fetch the string set with names.846 847 848PRIVFLAGS_SET849=============850 851Sets or modifies values of device private flags like ``ETHTOOL_SPFLAGS``852ioctl request.853 854Request contents:855 856 ==================================== ====== ==========================857 ``ETHTOOL_A_PRIVFLAGS_HEADER`` nested request header858 ``ETHTOOL_A_PRIVFLAGS_FLAGS`` bitset private flags859 ==================================== ====== ==========================860 861``ETHTOOL_A_PRIVFLAGS_FLAGS`` can either set the whole set of private flags or862modify only values of some of them.863 864 865RINGS_GET866=========867 868Gets ring sizes like ``ETHTOOL_GRINGPARAM`` ioctl request.869 870Request contents:871 872 ==================================== ====== ==========================873 ``ETHTOOL_A_RINGS_HEADER`` nested request header874 ==================================== ====== ==========================875 876Kernel response contents:877 878 ======================================= ====== ===========================879 ``ETHTOOL_A_RINGS_HEADER`` nested reply header880 ``ETHTOOL_A_RINGS_RX_MAX`` u32 max size of RX ring881 ``ETHTOOL_A_RINGS_RX_MINI_MAX`` u32 max size of RX mini ring882 ``ETHTOOL_A_RINGS_RX_JUMBO_MAX`` u32 max size of RX jumbo ring883 ``ETHTOOL_A_RINGS_TX_MAX`` u32 max size of TX ring884 ``ETHTOOL_A_RINGS_RX`` u32 size of RX ring885 ``ETHTOOL_A_RINGS_RX_MINI`` u32 size of RX mini ring886 ``ETHTOOL_A_RINGS_RX_JUMBO`` u32 size of RX jumbo ring887 ``ETHTOOL_A_RINGS_TX`` u32 size of TX ring888 ``ETHTOOL_A_RINGS_RX_BUF_LEN`` u32 size of buffers on the ring889 ``ETHTOOL_A_RINGS_TCP_DATA_SPLIT`` u8 TCP header / data split890 ``ETHTOOL_A_RINGS_CQE_SIZE`` u32 Size of TX/RX CQE891 ``ETHTOOL_A_RINGS_TX_PUSH`` u8 flag of TX Push mode892 ``ETHTOOL_A_RINGS_RX_PUSH`` u8 flag of RX Push mode893 ``ETHTOOL_A_RINGS_TX_PUSH_BUF_LEN`` u32 size of TX push buffer894 ``ETHTOOL_A_RINGS_TX_PUSH_BUF_LEN_MAX`` u32 max size of TX push buffer895 ======================================= ====== ===========================896 897``ETHTOOL_A_RINGS_TCP_DATA_SPLIT`` indicates whether the device is usable with898page-flipping TCP zero-copy receive (``getsockopt(TCP_ZEROCOPY_RECEIVE)``).899If enabled the device is configured to place frame headers and data into900separate buffers. The device configuration must make it possible to receive901full memory pages of data, for example because MTU is high enough or through902HW-GRO.903 904``ETHTOOL_A_RINGS_[RX|TX]_PUSH`` flag is used to enable descriptor fast905path to send or receive packets. In ordinary path, driver fills descriptors in DRAM and906notifies NIC hardware. In fast path, driver pushes descriptors to the device907through MMIO writes, thus reducing the latency. However, enabling this feature908may increase the CPU cost. Drivers may enforce additional per-packet909eligibility checks (e.g. on packet size).910 911``ETHTOOL_A_RINGS_TX_PUSH_BUF_LEN`` specifies the maximum number of bytes of a912transmitted packet a driver can push directly to the underlying device913('push' mode). Pushing some of the payload bytes to the device has the914advantages of reducing latency for small packets by avoiding DMA mapping (same915as ``ETHTOOL_A_RINGS_TX_PUSH`` parameter) as well as allowing the underlying916device to process packet headers ahead of fetching its payload.917This can help the device to make fast actions based on the packet's headers.918This is similar to the "tx-copybreak" parameter, which copies the packet to a919preallocated DMA memory area instead of mapping new memory. However,920tx-push-buff parameter copies the packet directly to the device to allow the921device to take faster actions on the packet.922 923RINGS_SET924=========925 926Sets ring sizes like ``ETHTOOL_SRINGPARAM`` ioctl request.927 928Request contents:929 930 ==================================== ====== ===========================931 ``ETHTOOL_A_RINGS_HEADER`` nested reply header932 ``ETHTOOL_A_RINGS_RX`` u32 size of RX ring933 ``ETHTOOL_A_RINGS_RX_MINI`` u32 size of RX mini ring934 ``ETHTOOL_A_RINGS_RX_JUMBO`` u32 size of RX jumbo ring935 ``ETHTOOL_A_RINGS_TX`` u32 size of TX ring936 ``ETHTOOL_A_RINGS_RX_BUF_LEN`` u32 size of buffers on the ring937 ``ETHTOOL_A_RINGS_CQE_SIZE`` u32 Size of TX/RX CQE938 ``ETHTOOL_A_RINGS_TX_PUSH`` u8 flag of TX Push mode939 ``ETHTOOL_A_RINGS_RX_PUSH`` u8 flag of RX Push mode940 ``ETHTOOL_A_RINGS_TX_PUSH_BUF_LEN`` u32 size of TX push buffer941 ==================================== ====== ===========================942 943Kernel checks that requested ring sizes do not exceed limits reported by944driver. Driver may impose additional constraints and may not support all945attributes.946 947 948``ETHTOOL_A_RINGS_CQE_SIZE`` specifies the completion queue event size.949Completion queue events (CQE) are the events posted by NIC to indicate the950completion status of a packet when the packet is sent (like send success or951error) or received (like pointers to packet fragments). The CQE size parameter952enables to modify the CQE size other than default size if NIC supports it.953A bigger CQE can have more receive buffer pointers, and in turn the NIC can954transfer a bigger frame from wire. Based on the NIC hardware, the overall955completion queue size can be adjusted in the driver if CQE size is modified.956 957CHANNELS_GET958============959 960Gets channel counts like ``ETHTOOL_GCHANNELS`` ioctl request.961 962Request contents:963 964 ==================================== ====== ==========================965 ``ETHTOOL_A_CHANNELS_HEADER`` nested request header966 ==================================== ====== ==========================967 968Kernel response contents:969 970 ===================================== ====== ==========================971 ``ETHTOOL_A_CHANNELS_HEADER`` nested reply header972 ``ETHTOOL_A_CHANNELS_RX_MAX`` u32 max receive channels973 ``ETHTOOL_A_CHANNELS_TX_MAX`` u32 max transmit channels974 ``ETHTOOL_A_CHANNELS_OTHER_MAX`` u32 max other channels975 ``ETHTOOL_A_CHANNELS_COMBINED_MAX`` u32 max combined channels976 ``ETHTOOL_A_CHANNELS_RX_COUNT`` u32 receive channel count977 ``ETHTOOL_A_CHANNELS_TX_COUNT`` u32 transmit channel count978 ``ETHTOOL_A_CHANNELS_OTHER_COUNT`` u32 other channel count979 ``ETHTOOL_A_CHANNELS_COMBINED_COUNT`` u32 combined channel count980 ===================================== ====== ==========================981 982 983CHANNELS_SET984============985 986Sets channel counts like ``ETHTOOL_SCHANNELS`` ioctl request.987 988Request contents:989 990 ===================================== ====== ==========================991 ``ETHTOOL_A_CHANNELS_HEADER`` nested request header992 ``ETHTOOL_A_CHANNELS_RX_COUNT`` u32 receive channel count993 ``ETHTOOL_A_CHANNELS_TX_COUNT`` u32 transmit channel count994 ``ETHTOOL_A_CHANNELS_OTHER_COUNT`` u32 other channel count995 ``ETHTOOL_A_CHANNELS_COMBINED_COUNT`` u32 combined channel count996 ===================================== ====== ==========================997 998Kernel checks that requested channel counts do not exceed limits reported by999driver. Driver may impose additional constraints and may not support all1000attributes.1001 1002 1003COALESCE_GET1004============1005 1006Gets coalescing parameters like ``ETHTOOL_GCOALESCE`` ioctl request.1007 1008Request contents:1009 1010 ==================================== ====== ==========================1011 ``ETHTOOL_A_COALESCE_HEADER`` nested request header1012 ==================================== ====== ==========================1013 1014Kernel response contents:1015 1016 =========================================== ====== =======================1017 ``ETHTOOL_A_COALESCE_HEADER`` nested reply header1018 ``ETHTOOL_A_COALESCE_RX_USECS`` u32 delay (us), normal Rx1019 ``ETHTOOL_A_COALESCE_RX_MAX_FRAMES`` u32 max packets, normal Rx1020 ``ETHTOOL_A_COALESCE_RX_USECS_IRQ`` u32 delay (us), Rx in IRQ1021 ``ETHTOOL_A_COALESCE_RX_MAX_FRAMES_IRQ`` u32 max packets, Rx in IRQ1022 ``ETHTOOL_A_COALESCE_TX_USECS`` u32 delay (us), normal Tx1023 ``ETHTOOL_A_COALESCE_TX_MAX_FRAMES`` u32 max packets, normal Tx1024 ``ETHTOOL_A_COALESCE_TX_USECS_IRQ`` u32 delay (us), Tx in IRQ1025 ``ETHTOOL_A_COALESCE_TX_MAX_FRAMES_IRQ`` u32 IRQ packets, Tx in IRQ1026 ``ETHTOOL_A_COALESCE_STATS_BLOCK_USECS`` u32 delay of stats update1027 ``ETHTOOL_A_COALESCE_USE_ADAPTIVE_RX`` bool adaptive Rx coalesce1028 ``ETHTOOL_A_COALESCE_USE_ADAPTIVE_TX`` bool adaptive Tx coalesce1029 ``ETHTOOL_A_COALESCE_PKT_RATE_LOW`` u32 threshold for low rate1030 ``ETHTOOL_A_COALESCE_RX_USECS_LOW`` u32 delay (us), low Rx1031 ``ETHTOOL_A_COALESCE_RX_MAX_FRAMES_LOW`` u32 max packets, low Rx1032 ``ETHTOOL_A_COALESCE_TX_USECS_LOW`` u32 delay (us), low Tx1033 ``ETHTOOL_A_COALESCE_TX_MAX_FRAMES_LOW`` u32 max packets, low Tx1034 ``ETHTOOL_A_COALESCE_PKT_RATE_HIGH`` u32 threshold for high rate1035 ``ETHTOOL_A_COALESCE_RX_USECS_HIGH`` u32 delay (us), high Rx1036 ``ETHTOOL_A_COALESCE_RX_MAX_FRAMES_HIGH`` u32 max packets, high Rx1037 ``ETHTOOL_A_COALESCE_TX_USECS_HIGH`` u32 delay (us), high Tx1038 ``ETHTOOL_A_COALESCE_TX_MAX_FRAMES_HIGH`` u32 max packets, high Tx1039 ``ETHTOOL_A_COALESCE_RATE_SAMPLE_INTERVAL`` u32 rate sampling interval1040 ``ETHTOOL_A_COALESCE_USE_CQE_TX`` bool timer reset mode, Tx1041 ``ETHTOOL_A_COALESCE_USE_CQE_RX`` bool timer reset mode, Rx1042 ``ETHTOOL_A_COALESCE_TX_AGGR_MAX_BYTES`` u32 max aggr size, Tx1043 ``ETHTOOL_A_COALESCE_TX_AGGR_MAX_FRAMES`` u32 max aggr packets, Tx1044 ``ETHTOOL_A_COALESCE_TX_AGGR_TIME_USECS`` u32 time (us), aggr, Tx1045 ``ETHTOOL_A_COALESCE_RX_PROFILE`` nested profile of DIM, Rx1046 ``ETHTOOL_A_COALESCE_TX_PROFILE`` nested profile of DIM, Tx1047 =========================================== ====== =======================1048 1049Attributes are only included in reply if their value is not zero or the1050corresponding bit in ``ethtool_ops::supported_coalesce_params`` is set (i.e.1051they are declared as supported by driver).1052 1053Timer reset mode (``ETHTOOL_A_COALESCE_USE_CQE_TX`` and1054``ETHTOOL_A_COALESCE_USE_CQE_RX``) controls the interaction between packet1055arrival and the various time based delay parameters. By default timers are1056expected to limit the max delay between any packet arrival/departure and a1057corresponding interrupt. In this mode timer should be started by packet1058arrival (sometimes delivery of previous interrupt) and reset when interrupt1059is delivered.1060Setting the appropriate attribute to 1 will enable ``CQE`` mode, where1061each packet event resets the timer. In this mode timer is used to force1062the interrupt if queue goes idle, while busy queues depend on the packet1063limit to trigger interrupts.1064 1065Tx aggregation consists of copying frames into a contiguous buffer so that they1066can be submitted as a single IO operation. ``ETHTOOL_A_COALESCE_TX_AGGR_MAX_BYTES``1067describes the maximum size in bytes for the submitted buffer.1068``ETHTOOL_A_COALESCE_TX_AGGR_MAX_FRAMES`` describes the maximum number of frames1069that can be aggregated into a single buffer.1070``ETHTOOL_A_COALESCE_TX_AGGR_TIME_USECS`` describes the amount of time in usecs,1071counted since the first packet arrival in an aggregated block, after which the1072block should be sent.1073This feature is mainly of interest for specific USB devices which does not cope1074well with frequent small-sized URBs transmissions.1075 1076``ETHTOOL_A_COALESCE_RX_PROFILE`` and ``ETHTOOL_A_COALESCE_TX_PROFILE`` refer1077to DIM parameters, see `Generic Network Dynamic Interrupt Moderation (Net DIM)1078<https://www.kernel.org/doc/Documentation/networking/net_dim.rst>`_.1079 1080COALESCE_SET1081============1082 1083Sets coalescing parameters like ``ETHTOOL_SCOALESCE`` ioctl request.1084 1085Request contents:1086 1087 =========================================== ====== =======================1088 ``ETHTOOL_A_COALESCE_HEADER`` nested request header1089 ``ETHTOOL_A_COALESCE_RX_USECS`` u32 delay (us), normal Rx1090 ``ETHTOOL_A_COALESCE_RX_MAX_FRAMES`` u32 max packets, normal Rx1091 ``ETHTOOL_A_COALESCE_RX_USECS_IRQ`` u32 delay (us), Rx in IRQ1092 ``ETHTOOL_A_COALESCE_RX_MAX_FRAMES_IRQ`` u32 max packets, Rx in IRQ1093 ``ETHTOOL_A_COALESCE_TX_USECS`` u32 delay (us), normal Tx1094 ``ETHTOOL_A_COALESCE_TX_MAX_FRAMES`` u32 max packets, normal Tx1095 ``ETHTOOL_A_COALESCE_TX_USECS_IRQ`` u32 delay (us), Tx in IRQ1096 ``ETHTOOL_A_COALESCE_TX_MAX_FRAMES_IRQ`` u32 IRQ packets, Tx in IRQ1097 ``ETHTOOL_A_COALESCE_STATS_BLOCK_USECS`` u32 delay of stats update1098 ``ETHTOOL_A_COALESCE_USE_ADAPTIVE_RX`` bool adaptive Rx coalesce1099 ``ETHTOOL_A_COALESCE_USE_ADAPTIVE_TX`` bool adaptive Tx coalesce1100 ``ETHTOOL_A_COALESCE_PKT_RATE_LOW`` u32 threshold for low rate1101 ``ETHTOOL_A_COALESCE_RX_USECS_LOW`` u32 delay (us), low Rx1102 ``ETHTOOL_A_COALESCE_RX_MAX_FRAMES_LOW`` u32 max packets, low Rx1103 ``ETHTOOL_A_COALESCE_TX_USECS_LOW`` u32 delay (us), low Tx1104 ``ETHTOOL_A_COALESCE_TX_MAX_FRAMES_LOW`` u32 max packets, low Tx1105 ``ETHTOOL_A_COALESCE_PKT_RATE_HIGH`` u32 threshold for high rate1106 ``ETHTOOL_A_COALESCE_RX_USECS_HIGH`` u32 delay (us), high Rx1107 ``ETHTOOL_A_COALESCE_RX_MAX_FRAMES_HIGH`` u32 max packets, high Rx1108 ``ETHTOOL_A_COALESCE_TX_USECS_HIGH`` u32 delay (us), high Tx1109 ``ETHTOOL_A_COALESCE_TX_MAX_FRAMES_HIGH`` u32 max packets, high Tx1110 ``ETHTOOL_A_COALESCE_RATE_SAMPLE_INTERVAL`` u32 rate sampling interval1111 ``ETHTOOL_A_COALESCE_USE_CQE_TX`` bool timer reset mode, Tx1112 ``ETHTOOL_A_COALESCE_USE_CQE_RX`` bool timer reset mode, Rx1113 ``ETHTOOL_A_COALESCE_TX_AGGR_MAX_BYTES`` u32 max aggr size, Tx1114 ``ETHTOOL_A_COALESCE_TX_AGGR_MAX_FRAMES`` u32 max aggr packets, Tx1115 ``ETHTOOL_A_COALESCE_TX_AGGR_TIME_USECS`` u32 time (us), aggr, Tx1116 ``ETHTOOL_A_COALESCE_RX_PROFILE`` nested profile of DIM, Rx1117 ``ETHTOOL_A_COALESCE_TX_PROFILE`` nested profile of DIM, Tx1118 =========================================== ====== =======================1119 1120Request is rejected if it attributes declared as unsupported by driver (i.e.1121such that the corresponding bit in ``ethtool_ops::supported_coalesce_params``1122is not set), regardless of their values. Driver may impose additional1123constraints on coalescing parameters and their values.1124 1125Compared to requests issued via the ``ioctl()`` netlink version of this request1126will try harder to make sure that values specified by the user have been applied1127and may call the driver twice.1128 1129 1130PAUSE_GET1131=========1132 1133Gets pause frame settings like ``ETHTOOL_GPAUSEPARAM`` ioctl request.1134 1135Request contents:1136 1137 ===================================== ====== ==========================1138 ``ETHTOOL_A_PAUSE_HEADER`` nested request header1139 ``ETHTOOL_A_PAUSE_STATS_SRC`` u32 source of statistics1140 ===================================== ====== ==========================1141 1142``ETHTOOL_A_PAUSE_STATS_SRC`` is optional. It takes values from:1143 1144.. kernel-doc:: include/uapi/linux/ethtool.h1145 :identifiers: ethtool_mac_stats_src1146 1147If absent from the request, stats will be provided with1148an ``ETHTOOL_A_PAUSE_STATS_SRC`` attribute in the response equal to1149``ETHTOOL_MAC_STATS_SRC_AGGREGATE``.1150 1151Kernel response contents:1152 1153 ===================================== ====== ==========================1154 ``ETHTOOL_A_PAUSE_HEADER`` nested request header1155 ``ETHTOOL_A_PAUSE_AUTONEG`` bool pause autonegotiation1156 ``ETHTOOL_A_PAUSE_RX`` bool receive pause frames1157 ``ETHTOOL_A_PAUSE_TX`` bool transmit pause frames1158 ``ETHTOOL_A_PAUSE_STATS`` nested pause statistics1159 ===================================== ====== ==========================1160 1161``ETHTOOL_A_PAUSE_STATS`` are reported if ``ETHTOOL_FLAG_STATS`` was set1162in ``ETHTOOL_A_HEADER_FLAGS``.1163It will be empty if driver did not report any statistics. Drivers fill in1164the statistics in the following structure:1165 1166.. kernel-doc:: include/linux/ethtool.h1167 :identifiers: ethtool_pause_stats1168 1169Each member has a corresponding attribute defined.1170 1171PAUSE_SET1172=========1173 1174Sets pause parameters like ``ETHTOOL_GPAUSEPARAM`` ioctl request.1175 1176Request contents:1177 1178 ===================================== ====== ==========================1179 ``ETHTOOL_A_PAUSE_HEADER`` nested request header1180 ``ETHTOOL_A_PAUSE_AUTONEG`` bool pause autonegotiation1181 ``ETHTOOL_A_PAUSE_RX`` bool receive pause frames1182 ``ETHTOOL_A_PAUSE_TX`` bool transmit pause frames1183 ===================================== ====== ==========================1184 1185 1186EEE_GET1187=======1188 1189Gets Energy Efficient Ethernet settings like ``ETHTOOL_GEEE`` ioctl request.1190 1191Request contents:1192 1193 ===================================== ====== ==========================1194 ``ETHTOOL_A_EEE_HEADER`` nested request header1195 ===================================== ====== ==========================1196 1197Kernel response contents:1198 1199 ===================================== ====== ==========================1200 ``ETHTOOL_A_EEE_HEADER`` nested request header1201 ``ETHTOOL_A_EEE_MODES_OURS`` bool supported/advertised modes1202 ``ETHTOOL_A_EEE_MODES_PEER`` bool peer advertised link modes1203 ``ETHTOOL_A_EEE_ACTIVE`` bool EEE is actively used1204 ``ETHTOOL_A_EEE_ENABLED`` bool EEE is enabled1205 ``ETHTOOL_A_EEE_TX_LPI_ENABLED`` bool Tx lpi enabled1206 ``ETHTOOL_A_EEE_TX_LPI_TIMER`` u32 Tx lpi timeout (in us)1207 ===================================== ====== ==========================1208 1209In ``ETHTOOL_A_EEE_MODES_OURS``, mask consists of link modes for which EEE is1210enabled, value of link modes for which EEE is advertised. Link modes for which1211peer advertises EEE are listed in ``ETHTOOL_A_EEE_MODES_PEER`` (no mask). The1212netlink interface allows reporting EEE status for all link modes but only1213first 32 are provided by the ``ethtool_ops`` callback.1214 1215 1216EEE_SET1217=======1218 1219Sets Energy Efficient Ethernet parameters like ``ETHTOOL_SEEE`` ioctl request.1220 1221Request contents:1222 1223 ===================================== ====== ==========================1224 ``ETHTOOL_A_EEE_HEADER`` nested request header1225 ``ETHTOOL_A_EEE_MODES_OURS`` bool advertised modes1226 ``ETHTOOL_A_EEE_ENABLED`` bool EEE is enabled1227 ``ETHTOOL_A_EEE_TX_LPI_ENABLED`` bool Tx lpi enabled1228 ``ETHTOOL_A_EEE_TX_LPI_TIMER`` u32 Tx lpi timeout (in us)1229 ===================================== ====== ==========================1230 1231``ETHTOOL_A_EEE_MODES_OURS`` is used to either list link modes to advertise1232EEE for (if there is no mask) or specify changes to the list (if there is1233a mask). The netlink interface allows reporting EEE status for all link modes1234but only first 32 can be set at the moment as that is what the ``ethtool_ops``1235callback supports.1236 1237 1238TSINFO_GET1239==========1240 1241Gets timestamping information like ``ETHTOOL_GET_TS_INFO`` ioctl request.1242 1243Request contents:1244 1245 ===================================== ====== ==========================1246 ``ETHTOOL_A_TSINFO_HEADER`` nested request header1247 ===================================== ====== ==========================1248 1249Kernel response contents:1250 1251 ===================================== ====== ==========================1252 ``ETHTOOL_A_TSINFO_HEADER`` nested request header1253 ``ETHTOOL_A_TSINFO_TIMESTAMPING`` bitset SO_TIMESTAMPING flags1254 ``ETHTOOL_A_TSINFO_TX_TYPES`` bitset supported Tx types1255 ``ETHTOOL_A_TSINFO_RX_FILTERS`` bitset supported Rx filters1256 ``ETHTOOL_A_TSINFO_PHC_INDEX`` u32 PTP hw clock index1257 ``ETHTOOL_A_TSINFO_STATS`` nested HW timestamping statistics1258 ===================================== ====== ==========================1259 1260``ETHTOOL_A_TSINFO_PHC_INDEX`` is absent if there is no associated PHC (there1261is no special value for this case). The bitset attributes are omitted if they1262would be empty (no bit set).1263 1264Additional hardware timestamping statistics response contents:1265 1266 ===================================== ====== ===================================1267 ``ETHTOOL_A_TS_STAT_TX_PKTS`` uint Packets with Tx HW timestamps1268 ``ETHTOOL_A_TS_STAT_TX_LOST`` uint Tx HW timestamp not arrived count1269 ``ETHTOOL_A_TS_STAT_TX_ERR`` uint HW error request Tx timestamp count1270 ===================================== ====== ===================================1271 1272CABLE_TEST1273==========1274 1275Start a cable test.1276 1277Request contents:1278 1279 ==================================== ====== ==========================1280 ``ETHTOOL_A_CABLE_TEST_HEADER`` nested request header1281 ==================================== ====== ==========================1282 1283Notification contents:1284 1285An Ethernet cable typically contains 1, 2 or 4 pairs. The length of1286the pair can only be measured when there is a fault in the pair and1287hence a reflection. Information about the fault may not be available,1288depending on the specific hardware. Hence the contents of the notify1289message are mostly optional. The attributes can be repeated an1290arbitrary number of times, in an arbitrary order, for an arbitrary1291number of pairs.1292 1293The example shows the notification sent when the test is completed for1294a T2 cable, i.e. two pairs. One pair is OK and hence has no length1295information. The second pair has a fault and does have length1296information.1297 1298 +---------------------------------------------+--------+---------------------+1299 | ``ETHTOOL_A_CABLE_TEST_HEADER`` | nested | reply header |1300 +---------------------------------------------+--------+---------------------+1301 | ``ETHTOOL_A_CABLE_TEST_STATUS`` | u8 | completed |1302 +---------------------------------------------+--------+---------------------+1303 | ``ETHTOOL_A_CABLE_TEST_NTF_NEST`` | nested | all the results |1304 +-+-------------------------------------------+--------+---------------------+1305 | | ``ETHTOOL_A_CABLE_NEST_RESULT`` | nested | cable test result |1306 +-+-+-----------------------------------------+--------+---------------------+1307 | | | ``ETHTOOL_A_CABLE_RESULTS_PAIR`` | u8 | pair number |1308 +-+-+-----------------------------------------+--------+---------------------+1309 | | | ``ETHTOOL_A_CABLE_RESULTS_CODE`` | u8 | result code |1310 +-+-+-----------------------------------------+--------+---------------------+1311 | | ``ETHTOOL_A_CABLE_NEST_RESULT`` | nested | cable test results |1312 +-+-+-----------------------------------------+--------+---------------------+1313 | | | ``ETHTOOL_A_CABLE_RESULTS_PAIR`` | u8 | pair number |1314 +-+-+-----------------------------------------+--------+---------------------+1315 | | | ``ETHTOOL_A_CABLE_RESULTS_CODE`` | u8 | result code |1316 +-+-+-----------------------------------------+--------+---------------------+1317 | | | ``ETHTOOL_A_CABLE_RESULT_SRC`` | u32 | information source |1318 +-+-+-----------------------------------------+--------+---------------------+1319 | | ``ETHTOOL_A_CABLE_NEST_FAULT_LENGTH`` | nested | cable length |1320 +-+-+-----------------------------------------+--------+---------------------+1321 | | | ``ETHTOOL_A_CABLE_FAULT_LENGTH_PAIR`` | u8 | pair number |1322 +-+-+-----------------------------------------+--------+---------------------+1323 | | | ``ETHTOOL_A_CABLE_FAULT_LENGTH_CM`` | u32 | length in cm |1324 +-+-+-----------------------------------------+--------+---------------------+1325 | | | ``ETHTOOL_A_CABLE_FAULT_LENGTH_SRC`` | u32 | information source |1326 +-+-+-----------------------------------------+--------+---------------------+1327 1328 1329CABLE_TEST TDR1330==============1331 1332Start a cable test and report raw TDR data1333 1334Request contents:1335 1336 +--------------------------------------------+--------+-----------------------+1337 | ``ETHTOOL_A_CABLE_TEST_TDR_HEADER`` | nested | reply header |1338 +--------------------------------------------+--------+-----------------------+1339 | ``ETHTOOL_A_CABLE_TEST_TDR_CFG`` | nested | test configuration |1340 +-+------------------------------------------+--------+-----------------------+1341 | | ``ETHTOOL_A_CABLE_STEP_FIRST_DISTANCE`` | u32 | first data distance |1342 +-+-+----------------------------------------+--------+-----------------------+1343 | | ``ETHTOOL_A_CABLE_STEP_LAST_DISTANCE`` | u32 | last data distance |1344 +-+-+----------------------------------------+--------+-----------------------+1345 | | ``ETHTOOL_A_CABLE_STEP_STEP_DISTANCE`` | u32 | distance of each step |1346 +-+-+----------------------------------------+--------+-----------------------+1347 | | ``ETHTOOL_A_CABLE_TEST_TDR_CFG_PAIR`` | u8 | pair to test |1348 +-+-+----------------------------------------+--------+-----------------------+1349 1350The ETHTOOL_A_CABLE_TEST_TDR_CFG is optional, as well as all members1351of the nest. All distances are expressed in centimeters. The PHY takes1352the distances as a guide, and rounds to the nearest distance it1353actually supports. If a pair is passed, only that one pair will be1354tested. Otherwise all pairs are tested.1355 1356Notification contents:1357 1358Raw TDR data is gathered by sending a pulse down the cable and1359recording the amplitude of the reflected pulse for a given distance.1360 1361It can take a number of seconds to collect TDR data, especial if the1362full 100 meters is probed at 1 meter intervals. When the test is1363started a notification will be sent containing just1364ETHTOOL_A_CABLE_TEST_TDR_STATUS with the value1365ETHTOOL_A_CABLE_TEST_NTF_STATUS_STARTED.1366 1367When the test has completed a second notification will be sent1368containing ETHTOOL_A_CABLE_TEST_TDR_STATUS with the value1369ETHTOOL_A_CABLE_TEST_NTF_STATUS_COMPLETED and the TDR data.1370 1371The message may optionally contain the amplitude of the pulse send1372down the cable. This is measured in mV. A reflection should not be1373bigger than transmitted pulse.1374 1375Before the raw TDR data should be an ETHTOOL_A_CABLE_TDR_NEST_STEP1376nest containing information about the distance along the cable for the1377first reading, the last reading, and the step between each1378reading. Distances are measured in centimeters. These should be the1379exact values the PHY used. These may be different to what the user1380requested, if the native measurement resolution is greater than 1 cm.1381 1382For each step along the cable, a ETHTOOL_A_CABLE_TDR_NEST_AMPLITUDE is1383used to report the amplitude of the reflection for a given pair.1384 1385 +---------------------------------------------+--------+----------------------+1386 | ``ETHTOOL_A_CABLE_TEST_TDR_HEADER`` | nested | reply header |1387 +---------------------------------------------+--------+----------------------+1388 | ``ETHTOOL_A_CABLE_TEST_TDR_STATUS`` | u8 | completed |1389 +---------------------------------------------+--------+----------------------+1390 | ``ETHTOOL_A_CABLE_TEST_TDR_NTF_NEST`` | nested | all the results |1391 +-+-------------------------------------------+--------+----------------------+1392 | | ``ETHTOOL_A_CABLE_TDR_NEST_PULSE`` | nested | TX Pulse amplitude |1393 +-+-+-----------------------------------------+--------+----------------------+1394 | | | ``ETHTOOL_A_CABLE_PULSE_mV`` | s16 | Pulse amplitude |1395 +-+-+-----------------------------------------+--------+----------------------+1396 | | ``ETHTOOL_A_CABLE_NEST_STEP`` | nested | TDR step info |1397 +-+-+-----------------------------------------+--------+----------------------+1398 | | | ``ETHTOOL_A_CABLE_STEP_FIRST_DISTANCE`` | u32 | First data distance |1399 +-+-+-----------------------------------------+--------+----------------------+1400 | | | ``ETHTOOL_A_CABLE_STEP_LAST_DISTANCE`` | u32 | Last data distance |1401 +-+-+-----------------------------------------+--------+----------------------+1402 | | | ``ETHTOOL_A_CABLE_STEP_STEP_DISTANCE`` | u32 | distance of each step|1403 +-+-+-----------------------------------------+--------+----------------------+1404 | | ``ETHTOOL_A_CABLE_TDR_NEST_AMPLITUDE`` | nested | Reflection amplitude |1405 +-+-+-----------------------------------------+--------+----------------------+1406 | | | ``ETHTOOL_A_CABLE_RESULTS_PAIR`` | u8 | pair number |1407 +-+-+-----------------------------------------+--------+----------------------+1408 | | | ``ETHTOOL_A_CABLE_AMPLITUDE_mV`` | s16 | Reflection amplitude |1409 +-+-+-----------------------------------------+--------+----------------------+1410 | | ``ETHTOOL_A_CABLE_TDR_NEST_AMPLITUDE`` | nested | Reflection amplitude |1411 +-+-+-----------------------------------------+--------+----------------------+1412 | | | ``ETHTOOL_A_CABLE_RESULTS_PAIR`` | u8 | pair number |1413 +-+-+-----------------------------------------+--------+----------------------+1414 | | | ``ETHTOOL_A_CABLE_AMPLITUDE_mV`` | s16 | Reflection amplitude |1415 +-+-+-----------------------------------------+--------+----------------------+1416 | | ``ETHTOOL_A_CABLE_TDR_NEST_AMPLITUDE`` | nested | Reflection amplitude |1417 +-+-+-----------------------------------------+--------+----------------------+1418 | | | ``ETHTOOL_A_CABLE_RESULTS_PAIR`` | u8 | pair number |1419 +-+-+-----------------------------------------+--------+----------------------+1420 | | | ``ETHTOOL_A_CABLE_AMPLITUDE_mV`` | s16 | Reflection amplitude |1421 +-+-+-----------------------------------------+--------+----------------------+1422 1423TUNNEL_INFO1424===========1425 1426Gets information about the tunnel state NIC is aware of.1427 1428Request contents:1429 1430 ===================================== ====== ==========================1431 ``ETHTOOL_A_TUNNEL_INFO_HEADER`` nested request header1432 ===================================== ====== ==========================1433 1434Kernel response contents:1435 1436 +---------------------------------------------+--------+---------------------+1437 | ``ETHTOOL_A_TUNNEL_INFO_HEADER`` | nested | reply header |1438 +---------------------------------------------+--------+---------------------+1439 | ``ETHTOOL_A_TUNNEL_INFO_UDP_PORTS`` | nested | all UDP port tables |1440 +-+-------------------------------------------+--------+---------------------+1441 | | ``ETHTOOL_A_TUNNEL_UDP_TABLE`` | nested | one UDP port table |1442 +-+-+-----------------------------------------+--------+---------------------+1443 | | | ``ETHTOOL_A_TUNNEL_UDP_TABLE_SIZE`` | u32 | max size of the |1444 | | | | | table |1445 +-+-+-----------------------------------------+--------+---------------------+1446 | | | ``ETHTOOL_A_TUNNEL_UDP_TABLE_TYPES`` | bitset | tunnel types which |1447 | | | | | table can hold |1448 +-+-+-----------------------------------------+--------+---------------------+1449 | | | ``ETHTOOL_A_TUNNEL_UDP_TABLE_ENTRY`` | nested | offloaded UDP port |1450 +-+-+-+---------------------------------------+--------+---------------------+1451 | | | | ``ETHTOOL_A_TUNNEL_UDP_ENTRY_PORT`` | be16 | UDP port |1452 +-+-+-+---------------------------------------+--------+---------------------+1453 | | | | ``ETHTOOL_A_TUNNEL_UDP_ENTRY_TYPE`` | u32 | tunnel type |1454 +-+-+-+---------------------------------------+--------+---------------------+1455 1456For UDP tunnel table empty ``ETHTOOL_A_TUNNEL_UDP_TABLE_TYPES`` indicates that1457the table contains static entries, hard-coded by the NIC.1458 1459FEC_GET1460=======1461 1462Gets FEC configuration and state like ``ETHTOOL_GFECPARAM`` ioctl request.1463 1464Request contents:1465 1466 ===================================== ====== ==========================1467 ``ETHTOOL_A_FEC_HEADER`` nested request header1468 ===================================== ====== ==========================1469 1470Kernel response contents:1471 1472 ===================================== ====== ==========================1473 ``ETHTOOL_A_FEC_HEADER`` nested request header1474 ``ETHTOOL_A_FEC_MODES`` bitset configured modes1475 ``ETHTOOL_A_FEC_AUTO`` bool FEC mode auto selection1476 ``ETHTOOL_A_FEC_ACTIVE`` u32 index of active FEC mode1477 ``ETHTOOL_A_FEC_STATS`` nested FEC statistics1478 ===================================== ====== ==========================1479 1480``ETHTOOL_A_FEC_ACTIVE`` is the bit index of the FEC link mode currently1481active on the interface. This attribute may not be present if device does1482not support FEC.1483 1484``ETHTOOL_A_FEC_MODES`` and ``ETHTOOL_A_FEC_AUTO`` are only meaningful when1485autonegotiation is disabled. If ``ETHTOOL_A_FEC_AUTO`` is non-zero driver will1486select the FEC mode automatically based on the parameters of the SFP module.1487This is equivalent to the ``ETHTOOL_FEC_AUTO`` bit of the ioctl interface.1488``ETHTOOL_A_FEC_MODES`` carry the current FEC configuration using link mode1489bits (rather than old ``ETHTOOL_FEC_*`` bits).1490 1491``ETHTOOL_A_FEC_STATS`` are reported if ``ETHTOOL_FLAG_STATS`` was set in1492``ETHTOOL_A_HEADER_FLAGS``.1493Each attribute carries an array of 64bit statistics. First entry in the array1494contains the total number of events on the port, while the following entries1495are counters corresponding to lanes/PCS instances. The number of entries in1496the array will be:1497 1498+--------------+---------------------------------------------+1499| `0` | device does not support FEC statistics |1500+--------------+---------------------------------------------+1501| `1` | device does not support per-lane break down |1502+--------------+---------------------------------------------+1503| `1 + #lanes` | device has full support for FEC stats |1504+--------------+---------------------------------------------+1505 1506Drivers fill in the statistics in the following structure:1507 1508.. kernel-doc:: include/linux/ethtool.h1509 :identifiers: ethtool_fec_stats1510 1511FEC_SET1512=======1513 1514Sets FEC parameters like ``ETHTOOL_SFECPARAM`` ioctl request.1515 1516Request contents:1517 1518 ===================================== ====== ==========================1519 ``ETHTOOL_A_FEC_HEADER`` nested request header1520 ``ETHTOOL_A_FEC_MODES`` bitset configured modes1521 ``ETHTOOL_A_FEC_AUTO`` bool FEC mode auto selection1522 ===================================== ====== ==========================1523 1524``FEC_SET`` is only meaningful when autonegotiation is disabled. Otherwise1525FEC mode is selected as part of autonegotiation.1526 1527``ETHTOOL_A_FEC_MODES`` selects which FEC mode should be used. It's recommended1528to set only one bit, if multiple bits are set driver may choose between them1529in an implementation specific way.1530 1531``ETHTOOL_A_FEC_AUTO`` requests the driver to choose FEC mode based on SFP1532module parameters. This does not mean autonegotiation.1533 1534MODULE_EEPROM_GET1535=================1536 1537Fetch module EEPROM data dump.1538This interface is designed to allow dumps of at most 1/2 page at once. This1539means only dumps of 128 (or less) bytes are allowed, without crossing half page1540boundary located at offset 128. For pages other than 0 only high 128 bytes are1541accessible.1542 1543Request contents:1544 1545 ======================================= ====== ==========================1546 ``ETHTOOL_A_MODULE_EEPROM_HEADER`` nested request header1547 ``ETHTOOL_A_MODULE_EEPROM_OFFSET`` u32 offset within a page1548 ``ETHTOOL_A_MODULE_EEPROM_LENGTH`` u32 amount of bytes to read1549 ``ETHTOOL_A_MODULE_EEPROM_PAGE`` u8 page number1550 ``ETHTOOL_A_MODULE_EEPROM_BANK`` u8 bank number1551 ``ETHTOOL_A_MODULE_EEPROM_I2C_ADDRESS`` u8 page I2C address1552 ======================================= ====== ==========================1553 1554If ``ETHTOOL_A_MODULE_EEPROM_BANK`` is not specified, bank 0 is assumed.1555 1556Kernel response contents:1557 1558 +---------------------------------------------+--------+---------------------+1559 | ``ETHTOOL_A_MODULE_EEPROM_HEADER`` | nested | reply header |1560 +---------------------------------------------+--------+---------------------+1561 | ``ETHTOOL_A_MODULE_EEPROM_DATA`` | binary | array of bytes from |1562 | | | module EEPROM |1563 +---------------------------------------------+--------+---------------------+1564 1565``ETHTOOL_A_MODULE_EEPROM_DATA`` has an attribute length equal to the amount of1566bytes driver actually read.1567 1568STATS_GET1569=========1570 1571Get standard statistics for the interface. Note that this is not1572a re-implementation of ``ETHTOOL_GSTATS`` which exposed driver-defined1573stats.1574 1575Request contents:1576 1577 ======================================= ====== ==========================1578 ``ETHTOOL_A_STATS_HEADER`` nested request header1579 ``ETHTOOL_A_STATS_SRC`` u32 source of statistics1580 ``ETHTOOL_A_STATS_GROUPS`` bitset requested groups of stats1581 ======================================= ====== ==========================1582 1583Kernel response contents:1584 1585 +-----------------------------------+--------+--------------------------------+1586 | ``ETHTOOL_A_STATS_HEADER`` | nested | reply header |1587 +-----------------------------------+--------+--------------------------------+1588 | ``ETHTOOL_A_STATS_SRC`` | u32 | source of statistics |1589 +-----------------------------------+--------+--------------------------------+1590 | ``ETHTOOL_A_STATS_GRP`` | nested | one or more group of stats |1591 +-+---------------------------------+--------+--------------------------------+1592 | | ``ETHTOOL_A_STATS_GRP_ID`` | u32 | group ID - ``ETHTOOL_STATS_*`` |1593 +-+---------------------------------+--------+--------------------------------+1594 | | ``ETHTOOL_A_STATS_GRP_SS_ID`` | u32 | string set ID for names |1595 +-+---------------------------------+--------+--------------------------------+1596 | | ``ETHTOOL_A_STATS_GRP_STAT`` | nested | nest containing a statistic |1597 +-+---------------------------------+--------+--------------------------------+1598 | | ``ETHTOOL_A_STATS_GRP_HIST_RX`` | nested | histogram statistic (Rx) |1599 +-+---------------------------------+--------+--------------------------------+1600 | | ``ETHTOOL_A_STATS_GRP_HIST_TX`` | nested | histogram statistic (Tx) |1601 +-+---------------------------------+--------+--------------------------------+1602 1603Users specify which groups of statistics they are requesting via1604the ``ETHTOOL_A_STATS_GROUPS`` bitset. Currently defined values are:1605 1606 ====================== ======== ===============================================1607 ETHTOOL_STATS_ETH_MAC eth-mac Basic IEEE 802.3 MAC statistics (30.3.1.1.*)1608 ETHTOOL_STATS_ETH_PHY eth-phy Basic IEEE 802.3 PHY statistics (30.3.2.1.*)1609 ETHTOOL_STATS_ETH_CTRL eth-ctrl Basic IEEE 802.3 MAC Ctrl statistics (30.3.3.*)1610 ETHTOOL_STATS_RMON rmon RMON (RFC 2819) statistics1611 ====================== ======== ===============================================1612 1613Each group should have a corresponding ``ETHTOOL_A_STATS_GRP`` in the reply.1614``ETHTOOL_A_STATS_GRP_ID`` identifies which group's statistics nest contains.1615``ETHTOOL_A_STATS_GRP_SS_ID`` identifies the string set ID for the names of1616the statistics in the group, if available.1617 1618Statistics are added to the ``ETHTOOL_A_STATS_GRP`` nest under1619``ETHTOOL_A_STATS_GRP_STAT``. ``ETHTOOL_A_STATS_GRP_STAT`` should contain1620single 8 byte (u64) attribute inside - the type of that attribute is1621the statistic ID and the value is the value of the statistic.1622Each group has its own interpretation of statistic IDs.1623Attribute IDs correspond to strings from the string set identified1624by ``ETHTOOL_A_STATS_GRP_SS_ID``. Complex statistics (such as RMON histogram1625entries) are also listed inside ``ETHTOOL_A_STATS_GRP`` and do not have1626a string defined in the string set.1627 1628RMON "histogram" counters count number of packets within given size range.1629Because RFC does not specify the ranges beyond the standard 1518 MTU devices1630differ in definition of buckets. For this reason the definition of packet ranges1631is left to each driver.1632 1633``ETHTOOL_A_STATS_GRP_HIST_RX`` and ``ETHTOOL_A_STATS_GRP_HIST_TX`` nests1634contain the following attributes:1635 1636 ================================= ====== ===================================1637 ETHTOOL_A_STATS_RMON_HIST_BKT_LOW u32 low bound of the packet size bucket1638 ETHTOOL_A_STATS_RMON_HIST_BKT_HI u32 high bound of the bucket1639 ETHTOOL_A_STATS_RMON_HIST_VAL u64 packet counter1640 ================================= ====== ===================================1641 1642Low and high bounds are inclusive, for example:1643 1644 ============================= ==== ====1645 RFC statistic low high1646 ============================= ==== ====1647 etherStatsPkts64Octets 0 641648 etherStatsPkts512to1023Octets 512 10231649 ============================= ==== ====1650 1651``ETHTOOL_A_STATS_SRC`` is optional. Similar to ``PAUSE_GET``, it takes values1652from ``enum ethtool_mac_stats_src``. If absent from the request, stats will be1653provided with an ``ETHTOOL_A_STATS_SRC`` attribute in the response equal to1654``ETHTOOL_MAC_STATS_SRC_AGGREGATE``.1655 1656PHC_VCLOCKS_GET1657===============1658 1659Query device PHC virtual clocks information.1660 1661Request contents:1662 1663 ==================================== ====== ==========================1664 ``ETHTOOL_A_PHC_VCLOCKS_HEADER`` nested request header1665 ==================================== ====== ==========================1666 1667Kernel response contents:1668 1669 ==================================== ====== ==========================1670 ``ETHTOOL_A_PHC_VCLOCKS_HEADER`` nested reply header1671 ``ETHTOOL_A_PHC_VCLOCKS_NUM`` u32 PHC virtual clocks number1672 ``ETHTOOL_A_PHC_VCLOCKS_INDEX`` s32 PHC index array1673 ==================================== ====== ==========================1674 1675MODULE_GET1676==========1677 1678Gets transceiver module parameters.1679 1680Request contents:1681 1682 ===================================== ====== ==========================1683 ``ETHTOOL_A_MODULE_HEADER`` nested request header1684 ===================================== ====== ==========================1685 1686Kernel response contents:1687 1688 ====================================== ====== ==========================1689 ``ETHTOOL_A_MODULE_HEADER`` nested reply header1690 ``ETHTOOL_A_MODULE_POWER_MODE_POLICY`` u8 power mode policy1691 ``ETHTOOL_A_MODULE_POWER_MODE`` u8 operational power mode1692 ====================================== ====== ==========================1693 1694The optional ``ETHTOOL_A_MODULE_POWER_MODE_POLICY`` attribute encodes the1695transceiver module power mode policy enforced by the host. The default policy1696is driver-dependent, but "auto" is the recommended default and it should be1697implemented by new drivers and drivers where conformance to a legacy behavior1698is not critical.1699 1700The optional ``ETHTHOOL_A_MODULE_POWER_MODE`` attribute encodes the operational1701power mode policy of the transceiver module. It is only reported when a module1702is plugged-in. Possible values are:1703 1704.. kernel-doc:: include/uapi/linux/ethtool.h1705 :identifiers: ethtool_module_power_mode1706 1707MODULE_SET1708==========1709 1710Sets transceiver module parameters.1711 1712Request contents:1713 1714 ====================================== ====== ==========================1715 ``ETHTOOL_A_MODULE_HEADER`` nested request header1716 ``ETHTOOL_A_MODULE_POWER_MODE_POLICY`` u8 power mode policy1717 ====================================== ====== ==========================1718 1719When set, the optional ``ETHTOOL_A_MODULE_POWER_MODE_POLICY`` attribute is used1720to set the transceiver module power policy enforced by the host. Possible1721values are:1722 1723.. kernel-doc:: include/uapi/linux/ethtool.h1724 :identifiers: ethtool_module_power_mode_policy1725 1726For SFF-8636 modules, low power mode is forced by the host according to table17276-10 in revision 2.10a of the specification.1728 1729For CMIS modules, low power mode is forced by the host according to table 6-121730in revision 5.0 of the specification.1731 1732PSE_GET1733=======1734 1735Gets PSE attributes.1736 1737Request contents:1738 1739 ===================================== ====== ==========================1740 ``ETHTOOL_A_PSE_HEADER`` nested request header1741 ===================================== ====== ==========================1742 1743Kernel response contents:1744 1745 ========================================== ====== =============================1746 ``ETHTOOL_A_PSE_HEADER`` nested reply header1747 ``ETHTOOL_A_PODL_PSE_ADMIN_STATE`` u32 Operational state of the PoDL1748 PSE functions1749 ``ETHTOOL_A_PODL_PSE_PW_D_STATUS`` u32 power detection status of the1750 PoDL PSE.1751 ``ETHTOOL_A_C33_PSE_ADMIN_STATE`` u32 Operational state of the PoE1752 PSE functions.1753 ``ETHTOOL_A_C33_PSE_PW_D_STATUS`` u32 power detection status of the1754 PoE PSE.1755 ``ETHTOOL_A_C33_PSE_PW_CLASS`` u32 power class of the PoE PSE.1756 ``ETHTOOL_A_C33_PSE_ACTUAL_PW`` u32 actual power drawn on the1757 PoE PSE.1758 ``ETHTOOL_A_C33_PSE_EXT_STATE`` u32 power extended state of the1759 PoE PSE.1760 ``ETHTOOL_A_C33_PSE_EXT_SUBSTATE`` u32 power extended substatus of1761 the PoE PSE.1762 ``ETHTOOL_A_C33_PSE_AVAIL_PW_LIMIT`` u32 currently configured power1763 limit of the PoE PSE.1764 ``ETHTOOL_A_C33_PSE_PW_LIMIT_RANGES`` nested Supported power limit1765 configuration ranges.1766 ========================================== ====== =============================1767 1768When set, the optional ``ETHTOOL_A_PODL_PSE_ADMIN_STATE`` attribute identifies1769the operational state of the PoDL PSE functions. The operational state of the1770PSE function can be changed using the ``ETHTOOL_A_PODL_PSE_ADMIN_CONTROL``1771action. This attribute corresponds to ``IEEE 802.3-2018`` 30.15.1.1.21772aPoDLPSEAdminState. Possible values are:1773 1774.. kernel-doc:: include/uapi/linux/ethtool.h1775 :identifiers: ethtool_podl_pse_admin_state1776 1777The same goes for ``ETHTOOL_A_C33_PSE_ADMIN_STATE`` implementing1778``IEEE 802.3-2022`` 30.9.1.1.2 aPSEAdminState.1779 1780.. kernel-doc:: include/uapi/linux/ethtool.h1781 :identifiers: ethtool_c33_pse_admin_state1782 1783When set, the optional ``ETHTOOL_A_PODL_PSE_PW_D_STATUS`` attribute identifies1784the power detection status of the PoDL PSE. The status depend on internal PSE1785state machine and automatic PD classification support. This attribute1786corresponds to ``IEEE 802.3-2018`` 30.15.1.1.3 aPoDLPSEPowerDetectionStatus.1787Possible values are:1788 1789.. kernel-doc:: include/uapi/linux/ethtool.h1790 :identifiers: ethtool_podl_pse_pw_d_status1791 1792The same goes for ``ETHTOOL_A_C33_PSE_ADMIN_PW_D_STATUS`` implementing1793``IEEE 802.3-2022`` 30.9.1.1.5 aPSEPowerDetectionStatus.1794 1795.. kernel-doc:: include/uapi/linux/ethtool.h1796 :identifiers: ethtool_c33_pse_pw_d_status1797 1798When set, the optional ``ETHTOOL_A_C33_PSE_PW_CLASS`` attribute identifies1799the power class of the C33 PSE. It depends on the class negotiated between1800the PSE and the PD. This attribute corresponds to ``IEEE 802.3-2022``180130.9.1.1.8 aPSEPowerClassification.1802 1803When set, the optional ``ETHTOOL_A_C33_PSE_ACTUAL_PW`` attribute identifies1804the actual power drawn by the C33 PSE. This attribute corresponds to1805``IEEE 802.3-2022`` 30.9.1.1.23 aPSEActualPower. Actual power is reported1806in mW.1807 1808When set, the optional ``ETHTOOL_A_C33_PSE_EXT_STATE`` attribute identifies1809the extended error state of the C33 PSE. Possible values are:1810 1811.. kernel-doc:: include/uapi/linux/ethtool.h1812 :identifiers: ethtool_c33_pse_ext_state1813 1814When set, the optional ``ETHTOOL_A_C33_PSE_EXT_SUBSTATE`` attribute identifies1815the extended error state of the C33 PSE. Possible values are:1816Possible values are:1817 1818.. kernel-doc:: include/uapi/linux/ethtool.h1819 :identifiers: ethtool_c33_pse_ext_substate_class_num_events1820 ethtool_c33_pse_ext_substate_error_condition1821 ethtool_c33_pse_ext_substate_mr_pse_enable1822 ethtool_c33_pse_ext_substate_option_detect_ted1823 ethtool_c33_pse_ext_substate_option_vport_lim1824 ethtool_c33_pse_ext_substate_ovld_detected1825 ethtool_c33_pse_ext_substate_pd_dll_power_type1826 ethtool_c33_pse_ext_substate_power_not_available1827 ethtool_c33_pse_ext_substate_short_detected1828 1829When set, the optional ``ETHTOOL_A_C33_PSE_AVAIL_PW_LIMIT`` attribute1830identifies the C33 PSE power limit in mW.1831 1832When set the optional ``ETHTOOL_A_C33_PSE_PW_LIMIT_RANGES`` nested attribute1833identifies the C33 PSE power limit ranges through1834``ETHTOOL_A_C33_PSE_PWR_VAL_LIMIT_RANGE_MIN`` and1835``ETHTOOL_A_C33_PSE_PWR_VAL_LIMIT_RANGE_MAX``.1836If the controller works with fixed classes, the min and max values will be1837equal.1838 1839PSE_SET1840=======1841 1842Sets PSE parameters.1843 1844Request contents:1845 1846 ====================================== ====== =============================1847 ``ETHTOOL_A_PSE_HEADER`` nested request header1848 ``ETHTOOL_A_PODL_PSE_ADMIN_CONTROL`` u32 Control PoDL PSE Admin state1849 ``ETHTOOL_A_C33_PSE_ADMIN_CONTROL`` u32 Control PSE Admin state1850 ``ETHTOOL_A_C33_PSE_AVAIL_PWR_LIMIT`` u32 Control PoE PSE available1851 power limit1852 ====================================== ====== =============================1853 1854When set, the optional ``ETHTOOL_A_PODL_PSE_ADMIN_CONTROL`` attribute is used1855to control PoDL PSE Admin functions. This option implements1856``IEEE 802.3-2018`` 30.15.1.2.1 acPoDLPSEAdminControl. See1857``ETHTOOL_A_PODL_PSE_ADMIN_STATE`` for supported values.1858 1859The same goes for ``ETHTOOL_A_C33_PSE_ADMIN_CONTROL`` implementing1860``IEEE 802.3-2022`` 30.9.1.2.1 acPSEAdminControl.1861 1862When set, the optional ``ETHTOOL_A_C33_PSE_AVAIL_PWR_LIMIT`` attribute is1863used to control the available power value limit for C33 PSE in milliwatts.1864This attribute corresponds to the `pse_available_power` variable described in1865``IEEE 802.3-2022`` 33.2.4.4 Variables and `pse_avail_pwr` in 145.2.5.41866Variables, which are described in power classes.1867 1868It was decided to use milliwatts for this interface to unify it with other1869power monitoring interfaces, which also use milliwatts, and to align with1870various existing products that document power consumption in watts rather than1871classes. If power limit configuration based on classes is needed, the1872conversion can be done in user space, for example by ethtool.1873 1874RSS_GET1875=======1876 1877Get indirection table, hash key and hash function info associated with a1878RSS context of an interface similar to ``ETHTOOL_GRSSH`` ioctl request.1879 1880Request contents:1881 1882===================================== ====== ============================1883 ``ETHTOOL_A_RSS_HEADER`` nested request header1884 ``ETHTOOL_A_RSS_CONTEXT`` u32 context number1885 ``ETHTOOL_A_RSS_START_CONTEXT`` u32 start context number (dumps)1886===================================== ====== ============================1887 1888``ETHTOOL_A_RSS_CONTEXT`` specifies which RSS context number to query,1889if not set context 0 (the main context) is queried. Dumps can be filtered1890by device (only listing contexts of a given netdev). Filtering single1891context number is not supported but ``ETHTOOL_A_RSS_START_CONTEXT``1892can be used to start dumping context from the given number (primarily1893used to ignore context 0s and only dump additional contexts).1894 1895Kernel response contents:1896 1897===================================== ====== ==========================1898 ``ETHTOOL_A_RSS_HEADER`` nested reply header1899 ``ETHTOOL_A_RSS_CONTEXT`` u32 context number1900 ``ETHTOOL_A_RSS_HFUNC`` u32 RSS hash func1901 ``ETHTOOL_A_RSS_INDIR`` binary Indir table bytes1902 ``ETHTOOL_A_RSS_HKEY`` binary Hash key bytes1903 ``ETHTOOL_A_RSS_INPUT_XFRM`` u32 RSS input data transformation1904===================================== ====== ==========================1905 1906ETHTOOL_A_RSS_HFUNC attribute is bitmap indicating the hash function1907being used. Current supported options are toeplitz, xor or crc32.1908ETHTOOL_A_RSS_INDIR attribute returns RSS indirection table where each byte1909indicates queue number.1910ETHTOOL_A_RSS_INPUT_XFRM attribute is a bitmap indicating the type of1911transformation applied to the input protocol fields before given to the RSS1912hfunc. Current supported option is symmetric-xor.1913 1914PLCA_GET_CFG1915============1916 1917Gets the IEEE 802.3cg-2019 Clause 148 Physical Layer Collision Avoidance1918(PLCA) Reconciliation Sublayer (RS) attributes.1919 1920Request contents:1921 1922 ===================================== ====== ==========================1923 ``ETHTOOL_A_PLCA_HEADER`` nested request header1924 ===================================== ====== ==========================1925 1926Kernel response contents:1927 1928 ====================================== ====== =============================1929 ``ETHTOOL_A_PLCA_HEADER`` nested reply header1930 ``ETHTOOL_A_PLCA_VERSION`` u16 Supported PLCA management1931 interface standard/version1932 ``ETHTOOL_A_PLCA_ENABLED`` u8 PLCA Admin State1933 ``ETHTOOL_A_PLCA_NODE_ID`` u32 PLCA unique local node ID1934 ``ETHTOOL_A_PLCA_NODE_CNT`` u32 Number of PLCA nodes on the1935 network, including the1936 coordinator1937 ``ETHTOOL_A_PLCA_TO_TMR`` u32 Transmit Opportunity Timer1938 value in bit-times (BT)1939 ``ETHTOOL_A_PLCA_BURST_CNT`` u32 Number of additional packets1940 the node is allowed to send1941 within a single TO1942 ``ETHTOOL_A_PLCA_BURST_TMR`` u32 Time to wait for the MAC to1943 transmit a new frame before1944 terminating the burst1945 ====================================== ====== =============================1946 1947When set, the optional ``ETHTOOL_A_PLCA_VERSION`` attribute indicates which1948standard and version the PLCA management interface complies to. When not set,1949the interface is vendor-specific and (possibly) supplied by the driver.1950The OPEN Alliance SIG specifies a standard register map for 10BASE-T1S PHYs1951embedding the PLCA Reconciliation Sublayer. See "10BASE-T1S PLCA Management1952Registers" at https://www.opensig.org/about/specifications/.1953 1954When set, the optional ``ETHTOOL_A_PLCA_ENABLED`` attribute indicates the1955administrative state of the PLCA RS. When not set, the node operates in "plain"1956CSMA/CD mode. This option is corresponding to ``IEEE 802.3cg-2019`` 30.16.1.1.11957aPLCAAdminState / 30.16.1.2.1 acPLCAAdminControl.1958 1959When set, the optional ``ETHTOOL_A_PLCA_NODE_ID`` attribute indicates the1960configured local node ID of the PHY. This ID determines which transmit1961opportunity (TO) is reserved for the node to transmit into. This option is1962corresponding to ``IEEE 802.3cg-2019`` 30.16.1.1.4 aPLCALocalNodeID. The valid1963range for this attribute is [0 .. 255] where 255 means "not configured".1964 1965When set, the optional ``ETHTOOL_A_PLCA_NODE_CNT`` attribute indicates the1966configured maximum number of PLCA nodes on the mixing-segment. This number1967determines the total number of transmit opportunities generated during a1968PLCA cycle. This attribute is relevant only for the PLCA coordinator, which is1969the node with aPLCALocalNodeID set to 0. Follower nodes ignore this setting.1970This option is corresponding to ``IEEE 802.3cg-2019`` 30.16.1.1.31971aPLCANodeCount. The valid range for this attribute is [1 .. 255].1972 1973When set, the optional ``ETHTOOL_A_PLCA_TO_TMR`` attribute indicates the1974configured value of the transmit opportunity timer in bit-times. This value1975must be set equal across all nodes sharing the medium for PLCA to work1976correctly. This option is corresponding to ``IEEE 802.3cg-2019`` 30.16.1.1.51977aPLCATransmitOpportunityTimer. The valid range for this attribute is1978[0 .. 255].1979 1980When set, the optional ``ETHTOOL_A_PLCA_BURST_CNT`` attribute indicates the1981configured number of extra packets that the node is allowed to send during a1982single transmit opportunity. By default, this attribute is 0, meaning that1983the node can only send a single frame per TO. When greater than 0, the PLCA RS1984keeps the TO after any transmission, waiting for the MAC to send a new frame1985for up to aPLCABurstTimer BTs. This can only happen a number of times per PLCA1986cycle up to the value of this parameter. After that, the burst is over and the1987normal counting of TOs resumes. This option is corresponding to1988``IEEE 802.3cg-2019`` 30.16.1.1.6 aPLCAMaxBurstCount. The valid range for this1989attribute is [0 .. 255].1990 1991When set, the optional ``ETHTOOL_A_PLCA_BURST_TMR`` attribute indicates how1992many bit-times the PLCA RS waits for the MAC to initiate a new transmission1993when aPLCAMaxBurstCount is greater than 0. If the MAC fails to send a new1994frame within this time, the burst ends and the counting of TOs resumes.1995Otherwise, the new frame is sent as part of the current burst. This option1996is corresponding to ``IEEE 802.3cg-2019`` 30.16.1.1.7 aPLCABurstTimer. The1997valid range for this attribute is [0 .. 255]. Although, the value should be1998set greater than the Inter-Frame-Gap (IFG) time of the MAC (plus some margin)1999for PLCA burst mode to work as intended.2000 2001PLCA_SET_CFG2002============2003 2004Sets PLCA RS parameters.2005 2006Request contents:2007 2008 ====================================== ====== =============================2009 ``ETHTOOL_A_PLCA_HEADER`` nested request header2010 ``ETHTOOL_A_PLCA_ENABLED`` u8 PLCA Admin State2011 ``ETHTOOL_A_PLCA_NODE_ID`` u8 PLCA unique local node ID2012 ``ETHTOOL_A_PLCA_NODE_CNT`` u8 Number of PLCA nodes on the2013 network, including the2014 coordinator2015 ``ETHTOOL_A_PLCA_TO_TMR`` u8 Transmit Opportunity Timer2016 value in bit-times (BT)2017 ``ETHTOOL_A_PLCA_BURST_CNT`` u8 Number of additional packets2018 the node is allowed to send2019 within a single TO2020 ``ETHTOOL_A_PLCA_BURST_TMR`` u8 Time to wait for the MAC to2021 transmit a new frame before2022 terminating the burst2023 ====================================== ====== =============================2024 2025For a description of each attribute, see ``PLCA_GET_CFG``.2026 2027PLCA_GET_STATUS2028===============2029 2030Gets PLCA RS status information.2031 2032Request contents:2033 2034 ===================================== ====== ==========================2035 ``ETHTOOL_A_PLCA_HEADER`` nested request header2036 ===================================== ====== ==========================2037 2038Kernel response contents:2039 2040 ====================================== ====== =============================2041 ``ETHTOOL_A_PLCA_HEADER`` nested reply header2042 ``ETHTOOL_A_PLCA_STATUS`` u8 PLCA RS operational status2043 ====================================== ====== =============================2044 2045When set, the ``ETHTOOL_A_PLCA_STATUS`` attribute indicates whether the node is2046detecting the presence of the BEACON on the network. This flag is2047corresponding to ``IEEE 802.3cg-2019`` 30.16.1.1.2 aPLCAStatus.2048 2049MM_GET2050======2051 2052Retrieve 802.3 MAC Merge parameters.2053 2054Request contents:2055 2056 ==================================== ====== ==========================2057 ``ETHTOOL_A_MM_HEADER`` nested request header2058 ==================================== ====== ==========================2059 2060Kernel response contents:2061 2062 ================================= ====== ===================================2063 ``ETHTOOL_A_MM_HEADER`` nested request header2064 ``ETHTOOL_A_MM_PMAC_ENABLED`` bool set if RX of preemptible and SMD-V2065 frames is enabled2066 ``ETHTOOL_A_MM_TX_ENABLED`` bool set if TX of preemptible frames is2067 administratively enabled (might be2068 inactive if verification failed)2069 ``ETHTOOL_A_MM_TX_ACTIVE`` bool set if TX of preemptible frames is2070 operationally enabled2071 ``ETHTOOL_A_MM_TX_MIN_FRAG_SIZE`` u32 minimum size of transmitted2072 non-final fragments, in octets2073 ``ETHTOOL_A_MM_RX_MIN_FRAG_SIZE`` u32 minimum size of received non-final2074 fragments, in octets2075 ``ETHTOOL_A_MM_VERIFY_ENABLED`` bool set if TX of SMD-V frames is2076 administratively enabled2077 ``ETHTOOL_A_MM_VERIFY_STATUS`` u8 state of the verification function2078 ``ETHTOOL_A_MM_VERIFY_TIME`` u32 delay between verification attempts2079 ``ETHTOOL_A_MM_MAX_VERIFY_TIME``` u32 maximum verification interval2080 supported by device2081 ``ETHTOOL_A_MM_STATS`` nested IEEE 802.3-2018 subclause 30.14.12082 oMACMergeEntity statistics counters2083 ================================= ====== ===================================2084 2085The attributes are populated by the device driver through the following2086structure:2087 2088.. kernel-doc:: include/linux/ethtool.h2089 :identifiers: ethtool_mm_state2090 2091The ``ETHTOOL_A_MM_VERIFY_STATUS`` will report one of the values from2092 2093.. kernel-doc:: include/uapi/linux/ethtool.h2094 :identifiers: ethtool_mm_verify_status2095 2096If ``ETHTOOL_A_MM_VERIFY_ENABLED`` was passed as false in the ``MM_SET``2097command, ``ETHTOOL_A_MM_VERIFY_STATUS`` will report either2098``ETHTOOL_MM_VERIFY_STATUS_INITIAL`` or ``ETHTOOL_MM_VERIFY_STATUS_DISABLED``,2099otherwise it should report one of the other states.2100 2101It is recommended that drivers start with the pMAC disabled, and enable it upon2102user space request. It is also recommended that user space does not depend upon2103the default values from ``ETHTOOL_MSG_MM_GET`` requests.2104 2105``ETHTOOL_A_MM_STATS`` are reported if ``ETHTOOL_FLAG_STATS`` was set in2106``ETHTOOL_A_HEADER_FLAGS``. The attribute will be empty if driver did not2107report any statistics. Drivers fill in the statistics in the following2108structure:2109 2110.. kernel-doc:: include/linux/ethtool.h2111 :identifiers: ethtool_mm_stats2112 2113MM_SET2114======2115 2116Modifies the configuration of the 802.3 MAC Merge layer.2117 2118Request contents:2119 2120 ================================= ====== ==========================2121 ``ETHTOOL_A_MM_VERIFY_TIME`` u32 see MM_GET description2122 ``ETHTOOL_A_MM_VERIFY_ENABLED`` bool see MM_GET description2123 ``ETHTOOL_A_MM_TX_ENABLED`` bool see MM_GET description2124 ``ETHTOOL_A_MM_PMAC_ENABLED`` bool see MM_GET description2125 ``ETHTOOL_A_MM_TX_MIN_FRAG_SIZE`` u32 see MM_GET description2126 ================================= ====== ==========================2127 2128The attributes are propagated to the driver through the following structure:2129 2130.. kernel-doc:: include/linux/ethtool.h2131 :identifiers: ethtool_mm_cfg2132 2133MODULE_FW_FLASH_ACT2134===================2135 2136Flashes transceiver module firmware.2137 2138Request contents:2139 2140 ======================================= ====== ===========================2141 ``ETHTOOL_A_MODULE_FW_FLASH_HEADER`` nested request header2142 ``ETHTOOL_A_MODULE_FW_FLASH_FILE_NAME`` string firmware image file name2143 ``ETHTOOL_A_MODULE_FW_FLASH_PASSWORD`` u32 transceiver module password2144 ======================================= ====== ===========================2145 2146The firmware update process consists of three logical steps:2147 21481. Downloading a firmware image to the transceiver module and validating it.21492. Running the firmware image.21503. Committing the firmware image so that it is run upon reset.2151 2152When flash command is given, those three steps are taken in that order.2153 2154This message merely schedules the update process and returns immediately2155without blocking. The process then runs asynchronously.2156Since it can take several minutes to complete, during the update process2157notifications are emitted from the kernel to user space updating it about2158the status and progress.2159 2160The ``ETHTOOL_A_MODULE_FW_FLASH_FILE_NAME`` attribute encodes the firmware2161image file name. The firmware image is downloaded to the transceiver module,2162validated, run and committed.2163 2164The optional ``ETHTOOL_A_MODULE_FW_FLASH_PASSWORD`` attribute encodes a password2165that might be required as part of the transceiver module firmware update2166process.2167 2168The firmware update process can take several minutes to complete. Therefore,2169during the update process notifications are emitted from the kernel to user2170space updating it about the status and progress.2171 2172 2173 2174Notification contents:2175 2176 +---------------------------------------------------+--------+----------------+2177 | ``ETHTOOL_A_MODULE_FW_FLASH_HEADER`` | nested | reply header |2178 +---------------------------------------------------+--------+----------------+2179 | ``ETHTOOL_A_MODULE_FW_FLASH_STATUS`` | u32 | status |2180 +---------------------------------------------------+--------+----------------+2181 | ``ETHTOOL_A_MODULE_FW_FLASH_STATUS_MSG`` | string | status message |2182 +---------------------------------------------------+--------+----------------+2183 | ``ETHTOOL_A_MODULE_FW_FLASH_DONE`` | uint | progress |2184 +---------------------------------------------------+--------+----------------+2185 | ``ETHTOOL_A_MODULE_FW_FLASH_TOTAL`` | uint | total |2186 +---------------------------------------------------+--------+----------------+2187 2188The ``ETHTOOL_A_MODULE_FW_FLASH_STATUS`` attribute encodes the current status2189of the firmware update process. Possible values are:2190 2191.. kernel-doc:: include/uapi/linux/ethtool.h2192 :identifiers: ethtool_module_fw_flash_status2193 2194The ``ETHTOOL_A_MODULE_FW_FLASH_STATUS_MSG`` attribute encodes a status message2195string.2196 2197The ``ETHTOOL_A_MODULE_FW_FLASH_DONE`` and ``ETHTOOL_A_MODULE_FW_FLASH_TOTAL``2198attributes encode the completed and total amount of work, respectively.2199 2200PHY_GET2201=======2202 2203Retrieve information about a given Ethernet PHY sitting on the link. The DO2204operation returns all available information about dev->phydev. User can also2205specify a PHY_INDEX, in which case the DO request returns information about that2206specific PHY.2207 2208As there can be more than one PHY, the DUMP operation can be used to list the PHYs2209present on a given interface, by passing an interface index or name in2210the dump request.2211 2212For more information, refer to :ref:`phy_link_topology`2213 2214Request contents:2215 2216 ==================================== ====== ==========================2217 ``ETHTOOL_A_PHY_HEADER`` nested request header2218 ==================================== ====== ==========================2219 2220Kernel response contents:2221 2222 ===================================== ====== ===============================2223 ``ETHTOOL_A_PHY_HEADER`` nested request header2224 ``ETHTOOL_A_PHY_INDEX`` u32 the phy's unique index, that can2225 be used for phy-specific2226 requests2227 ``ETHTOOL_A_PHY_DRVNAME`` string the phy driver name2228 ``ETHTOOL_A_PHY_NAME`` string the phy device name2229 ``ETHTOOL_A_PHY_UPSTREAM_TYPE`` u32 the type of device this phy is2230 connected to2231 ``ETHTOOL_A_PHY_UPSTREAM_INDEX`` u32 the PHY index of the upstream2232 PHY2233 ``ETHTOOL_A_PHY_UPSTREAM_SFP_NAME`` string if this PHY is connected to2234 its parent PHY through an SFP2235 bus, the name of this sfp bus2236 ``ETHTOOL_A_PHY_DOWNSTREAM_SFP_NAME`` string if the phy controls an sfp bus,2237 the name of the sfp bus2238 ===================================== ====== ===============================2239 2240When ``ETHTOOL_A_PHY_UPSTREAM_TYPE`` is PHY_UPSTREAM_PHY, the PHY's parent is2241another PHY.2242 2243Request translation2244===================2245 2246The following table maps ioctl commands to netlink commands providing their2247functionality. Entries with "n/a" in right column are commands which do not2248have their netlink replacement yet. Entries which "n/a" in the left column2249are netlink only.2250 2251 =================================== =====================================2252 ioctl command netlink command2253 =================================== =====================================2254 ``ETHTOOL_GSET`` ``ETHTOOL_MSG_LINKINFO_GET``2255 ``ETHTOOL_MSG_LINKMODES_GET``2256 ``ETHTOOL_SSET`` ``ETHTOOL_MSG_LINKINFO_SET``2257 ``ETHTOOL_MSG_LINKMODES_SET``2258 ``ETHTOOL_GDRVINFO`` n/a2259 ``ETHTOOL_GREGS`` n/a2260 ``ETHTOOL_GWOL`` ``ETHTOOL_MSG_WOL_GET``2261 ``ETHTOOL_SWOL`` ``ETHTOOL_MSG_WOL_SET``2262 ``ETHTOOL_GMSGLVL`` ``ETHTOOL_MSG_DEBUG_GET``2263 ``ETHTOOL_SMSGLVL`` ``ETHTOOL_MSG_DEBUG_SET``2264 ``ETHTOOL_NWAY_RST`` n/a2265 ``ETHTOOL_GLINK`` ``ETHTOOL_MSG_LINKSTATE_GET``2266 ``ETHTOOL_GEEPROM`` n/a2267 ``ETHTOOL_SEEPROM`` n/a2268 ``ETHTOOL_GCOALESCE`` ``ETHTOOL_MSG_COALESCE_GET``2269 ``ETHTOOL_SCOALESCE`` ``ETHTOOL_MSG_COALESCE_SET``2270 ``ETHTOOL_GRINGPARAM`` ``ETHTOOL_MSG_RINGS_GET``2271 ``ETHTOOL_SRINGPARAM`` ``ETHTOOL_MSG_RINGS_SET``2272 ``ETHTOOL_GPAUSEPARAM`` ``ETHTOOL_MSG_PAUSE_GET``2273 ``ETHTOOL_SPAUSEPARAM`` ``ETHTOOL_MSG_PAUSE_SET``2274 ``ETHTOOL_GRXCSUM`` ``ETHTOOL_MSG_FEATURES_GET``2275 ``ETHTOOL_SRXCSUM`` ``ETHTOOL_MSG_FEATURES_SET``2276 ``ETHTOOL_GTXCSUM`` ``ETHTOOL_MSG_FEATURES_GET``2277 ``ETHTOOL_STXCSUM`` ``ETHTOOL_MSG_FEATURES_SET``2278 ``ETHTOOL_GSG`` ``ETHTOOL_MSG_FEATURES_GET``2279 ``ETHTOOL_SSG`` ``ETHTOOL_MSG_FEATURES_SET``2280 ``ETHTOOL_TEST`` n/a2281 ``ETHTOOL_GSTRINGS`` ``ETHTOOL_MSG_STRSET_GET``2282 ``ETHTOOL_PHYS_ID`` n/a2283 ``ETHTOOL_GSTATS`` n/a2284 ``ETHTOOL_GTSO`` ``ETHTOOL_MSG_FEATURES_GET``2285 ``ETHTOOL_STSO`` ``ETHTOOL_MSG_FEATURES_SET``2286 ``ETHTOOL_GPERMADDR`` rtnetlink ``RTM_GETLINK``2287 ``ETHTOOL_GUFO`` ``ETHTOOL_MSG_FEATURES_GET``2288 ``ETHTOOL_SUFO`` ``ETHTOOL_MSG_FEATURES_SET``2289 ``ETHTOOL_GGSO`` ``ETHTOOL_MSG_FEATURES_GET``2290 ``ETHTOOL_SGSO`` ``ETHTOOL_MSG_FEATURES_SET``2291 ``ETHTOOL_GFLAGS`` ``ETHTOOL_MSG_FEATURES_GET``2292 ``ETHTOOL_SFLAGS`` ``ETHTOOL_MSG_FEATURES_SET``2293 ``ETHTOOL_GPFLAGS`` ``ETHTOOL_MSG_PRIVFLAGS_GET``2294 ``ETHTOOL_SPFLAGS`` ``ETHTOOL_MSG_PRIVFLAGS_SET``2295 ``ETHTOOL_GRXFH`` n/a2296 ``ETHTOOL_SRXFH`` n/a2297 ``ETHTOOL_GGRO`` ``ETHTOOL_MSG_FEATURES_GET``2298 ``ETHTOOL_SGRO`` ``ETHTOOL_MSG_FEATURES_SET``2299 ``ETHTOOL_GRXRINGS`` n/a2300 ``ETHTOOL_GRXCLSRLCNT`` n/a2301 ``ETHTOOL_GRXCLSRULE`` n/a2302 ``ETHTOOL_GRXCLSRLALL`` n/a2303 ``ETHTOOL_SRXCLSRLDEL`` n/a2304 ``ETHTOOL_SRXCLSRLINS`` n/a2305 ``ETHTOOL_FLASHDEV`` n/a2306 ``ETHTOOL_RESET`` n/a2307 ``ETHTOOL_SRXNTUPLE`` n/a2308 ``ETHTOOL_GRXNTUPLE`` n/a2309 ``ETHTOOL_GSSET_INFO`` ``ETHTOOL_MSG_STRSET_GET``2310 ``ETHTOOL_GRXFHINDIR`` n/a2311 ``ETHTOOL_SRXFHINDIR`` n/a2312 ``ETHTOOL_GFEATURES`` ``ETHTOOL_MSG_FEATURES_GET``2313 ``ETHTOOL_SFEATURES`` ``ETHTOOL_MSG_FEATURES_SET``2314 ``ETHTOOL_GCHANNELS`` ``ETHTOOL_MSG_CHANNELS_GET``2315 ``ETHTOOL_SCHANNELS`` ``ETHTOOL_MSG_CHANNELS_SET``2316 ``ETHTOOL_SET_DUMP`` n/a2317 ``ETHTOOL_GET_DUMP_FLAG`` n/a2318 ``ETHTOOL_GET_DUMP_DATA`` n/a2319 ``ETHTOOL_GET_TS_INFO`` ``ETHTOOL_MSG_TSINFO_GET``2320 ``ETHTOOL_GMODULEINFO`` ``ETHTOOL_MSG_MODULE_EEPROM_GET``2321 ``ETHTOOL_GMODULEEEPROM`` ``ETHTOOL_MSG_MODULE_EEPROM_GET``2322 ``ETHTOOL_GEEE`` ``ETHTOOL_MSG_EEE_GET``2323 ``ETHTOOL_SEEE`` ``ETHTOOL_MSG_EEE_SET``2324 ``ETHTOOL_GRSSH`` ``ETHTOOL_MSG_RSS_GET``2325 ``ETHTOOL_SRSSH`` n/a2326 ``ETHTOOL_GTUNABLE`` n/a2327 ``ETHTOOL_STUNABLE`` n/a2328 ``ETHTOOL_GPHYSTATS`` n/a2329 ``ETHTOOL_PERQUEUE`` n/a2330 ``ETHTOOL_GLINKSETTINGS`` ``ETHTOOL_MSG_LINKINFO_GET``2331 ``ETHTOOL_MSG_LINKMODES_GET``2332 ``ETHTOOL_SLINKSETTINGS`` ``ETHTOOL_MSG_LINKINFO_SET``2333 ``ETHTOOL_MSG_LINKMODES_SET``2334 ``ETHTOOL_PHY_GTUNABLE`` n/a2335 ``ETHTOOL_PHY_STUNABLE`` n/a2336 ``ETHTOOL_GFECPARAM`` ``ETHTOOL_MSG_FEC_GET``2337 ``ETHTOOL_SFECPARAM`` ``ETHTOOL_MSG_FEC_SET``2338 n/a ``ETHTOOL_MSG_CABLE_TEST_ACT``2339 n/a ``ETHTOOL_MSG_CABLE_TEST_TDR_ACT``2340 n/a ``ETHTOOL_MSG_TUNNEL_INFO_GET``2341 n/a ``ETHTOOL_MSG_PHC_VCLOCKS_GET``2342 n/a ``ETHTOOL_MSG_MODULE_GET``2343 n/a ``ETHTOOL_MSG_MODULE_SET``2344 n/a ``ETHTOOL_MSG_PLCA_GET_CFG``2345 n/a ``ETHTOOL_MSG_PLCA_SET_CFG``2346 n/a ``ETHTOOL_MSG_PLCA_GET_STATUS``2347 n/a ``ETHTOOL_MSG_MM_GET``2348 n/a ``ETHTOOL_MSG_MM_SET``2349 n/a ``ETHTOOL_MSG_MODULE_FW_FLASH_ACT``2350 n/a ``ETHTOOL_MSG_PHY_GET``2351 =================================== =====================================2352