2019-12-27 22:55:18 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
|
|
|
|
/*
|
|
|
|
* include/uapi/linux/ethtool_netlink.h - netlink interface for ethtool
|
|
|
|
*
|
2020-04-15 00:48:35 +08:00
|
|
|
* See Documentation/networking/ethtool-netlink.rst in kernel source tree for
|
2019-12-27 22:55:18 +08:00
|
|
|
* doucumentation of the interface.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _UAPI_LINUX_ETHTOOL_NETLINK_H_
|
|
|
|
#define _UAPI_LINUX_ETHTOOL_NETLINK_H_
|
|
|
|
|
|
|
|
#include <linux/ethtool.h>
|
|
|
|
|
|
|
|
/* message types - userspace to kernel */
|
|
|
|
enum {
|
|
|
|
ETHTOOL_MSG_USER_NONE,
|
2019-12-27 22:55:43 +08:00
|
|
|
ETHTOOL_MSG_STRSET_GET,
|
2019-12-27 22:55:48 +08:00
|
|
|
ETHTOOL_MSG_LINKINFO_GET,
|
2019-12-27 22:55:53 +08:00
|
|
|
ETHTOOL_MSG_LINKINFO_SET,
|
2019-12-27 22:56:08 +08:00
|
|
|
ETHTOOL_MSG_LINKMODES_GET,
|
2019-12-27 22:56:13 +08:00
|
|
|
ETHTOOL_MSG_LINKMODES_SET,
|
2019-12-27 22:56:23 +08:00
|
|
|
ETHTOOL_MSG_LINKSTATE_GET,
|
2020-01-27 06:11:04 +08:00
|
|
|
ETHTOOL_MSG_DEBUG_GET,
|
2020-01-27 06:11:07 +08:00
|
|
|
ETHTOOL_MSG_DEBUG_SET,
|
2020-01-27 06:11:13 +08:00
|
|
|
ETHTOOL_MSG_WOL_GET,
|
2020-01-27 06:11:16 +08:00
|
|
|
ETHTOOL_MSG_WOL_SET,
|
2020-03-13 04:07:48 +08:00
|
|
|
ETHTOOL_MSG_FEATURES_GET,
|
2020-03-13 04:07:58 +08:00
|
|
|
ETHTOOL_MSG_FEATURES_SET,
|
2020-03-13 04:08:08 +08:00
|
|
|
ETHTOOL_MSG_PRIVFLAGS_GET,
|
2020-03-13 04:08:13 +08:00
|
|
|
ETHTOOL_MSG_PRIVFLAGS_SET,
|
2020-03-13 04:08:23 +08:00
|
|
|
ETHTOOL_MSG_RINGS_GET,
|
2020-03-13 04:08:28 +08:00
|
|
|
ETHTOOL_MSG_RINGS_SET,
|
2020-03-13 04:08:38 +08:00
|
|
|
ETHTOOL_MSG_CHANNELS_GET,
|
2020-03-13 04:08:43 +08:00
|
|
|
ETHTOOL_MSG_CHANNELS_SET,
|
2020-03-28 07:01:08 +08:00
|
|
|
ETHTOOL_MSG_COALESCE_GET,
|
2020-03-28 07:01:13 +08:00
|
|
|
ETHTOOL_MSG_COALESCE_SET,
|
2020-03-28 07:01:23 +08:00
|
|
|
ETHTOOL_MSG_PAUSE_GET,
|
2020-03-28 07:01:28 +08:00
|
|
|
ETHTOOL_MSG_PAUSE_SET,
|
2020-03-28 07:01:38 +08:00
|
|
|
ETHTOOL_MSG_EEE_GET,
|
2020-03-28 07:01:43 +08:00
|
|
|
ETHTOOL_MSG_EEE_SET,
|
2020-03-28 07:01:58 +08:00
|
|
|
ETHTOOL_MSG_TSINFO_GET,
|
2020-05-11 03:12:33 +08:00
|
|
|
ETHTOOL_MSG_CABLE_TEST_ACT,
|
2020-05-27 06:21:37 +08:00
|
|
|
ETHTOOL_MSG_CABLE_TEST_TDR_ACT,
|
2020-07-10 08:42:47 +08:00
|
|
|
ETHTOOL_MSG_TUNNEL_INFO_GET,
|
2021-03-30 11:59:52 +08:00
|
|
|
ETHTOOL_MSG_FEC_GET,
|
|
|
|
ETHTOOL_MSG_FEC_SET,
|
2021-04-09 16:06:34 +08:00
|
|
|
ETHTOOL_MSG_MODULE_EEPROM_GET,
|
2021-04-17 03:27:39 +08:00
|
|
|
ETHTOOL_MSG_STATS_GET,
|
2021-06-30 16:11:56 +08:00
|
|
|
ETHTOOL_MSG_PHC_VCLOCKS_GET,
|
ethtool: Add ability to control transceiver modules' power mode
Add a pair of new ethtool messages, 'ETHTOOL_MSG_MODULE_SET' and
'ETHTOOL_MSG_MODULE_GET', that can be used to control transceiver
modules parameters and retrieve their status.
The first parameter to control is the power mode of the module. It is
only relevant for paged memory modules, as flat memory modules always
operate in low power mode.
When a paged memory module is in low power mode, its power consumption
is reduced to the minimum, the management interface towards the host is
available and the data path is deactivated.
User space can choose to put modules that are not currently in use in
low power mode and transition them to high power mode before putting the
associated ports administratively up. This is useful for user space that
favors reduced power consumption and lower temperatures over reduced
link up times. In QSFP-DD modules the transition from low power mode to
high power mode can take a few seconds and this transition is only
expected to get longer with future / more complex modules.
User space can control the power mode of the module via the power mode
policy attribute ('ETHTOOL_A_MODULE_POWER_MODE_POLICY'). Possible
values:
* high: Module is always in high power mode.
* auto: Module is transitioned by the host to high power mode when the
first port using it is put administratively up and to low power mode
when the last port using it is put administratively down.
The operational power mode of the module is available to user space via
the 'ETHTOOL_A_MODULE_POWER_MODE' attribute. The attribute is not
reported to user space when a module is not plugged-in.
The user API is designed to be generic enough so that it could be used
for modules with different memory maps (e.g., SFF-8636, CMIS).
The only implementation of the device driver API in this series is for a
MAC driver (mlxsw) where the module is controlled by the device's
firmware, but it is designed to be generic enough so that it could also
be used by implementations where the module is controlled by the CPU.
CMIS testing
============
# ethtool -m swp11
Identifier : 0x18 (QSFP-DD Double Density 8X Pluggable Transceiver (INF-8628))
...
Module State : 0x03 (ModuleReady)
LowPwrAllowRequestHW : Off
LowPwrRequestSW : Off
The module is not in low power mode, as it is not forced by hardware
(LowPwrAllowRequestHW is off) or by software (LowPwrRequestSW is off).
The power mode can be queried from the kernel. In case
LowPwrAllowRequestHW was on, the kernel would need to take into account
the state of the LowPwrRequestHW signal, which is not visible to user
space.
$ ethtool --show-module swp11
Module parameters for swp11:
power-mode-policy high
power-mode high
Change the power mode policy to 'auto':
# ethtool --set-module swp11 power-mode-policy auto
Query the power mode again:
$ ethtool --show-module swp11
Module parameters for swp11:
power-mode-policy auto
power-mode low
Verify with the data read from the EEPROM:
# ethtool -m swp11
Identifier : 0x18 (QSFP-DD Double Density 8X Pluggable Transceiver (INF-8628))
...
Module State : 0x01 (ModuleLowPwr)
LowPwrAllowRequestHW : Off
LowPwrRequestSW : On
Put the associated port administratively up which will instruct the host
to transition the module to high power mode:
# ip link set dev swp11 up
Query the power mode again:
$ ethtool --show-module swp11
Module parameters for swp11:
power-mode-policy auto
power-mode high
Verify with the data read from the EEPROM:
# ethtool -m swp11
Identifier : 0x18 (QSFP-DD Double Density 8X Pluggable Transceiver (INF-8628))
...
Module State : 0x03 (ModuleReady)
LowPwrAllowRequestHW : Off
LowPwrRequestSW : Off
Put the associated port administratively down which will instruct the
host to transition the module to low power mode:
# ip link set dev swp11 down
Query the power mode again:
$ ethtool --show-module swp11
Module parameters for swp11:
power-mode-policy auto
power-mode low
Verify with the data read from the EEPROM:
# ethtool -m swp11
Identifier : 0x18 (QSFP-DD Double Density 8X Pluggable Transceiver (INF-8628))
...
Module State : 0x01 (ModuleLowPwr)
LowPwrAllowRequestHW : Off
LowPwrRequestSW : On
SFF-8636 testing
================
# ethtool -m swp13
Identifier : 0x11 (QSFP28)
...
Extended identifier description : 5.0W max. Power consumption, High Power Class (> 3.5 W) enabled
Power set : Off
Power override : On
...
Transmit avg optical power (Channel 1) : 0.7733 mW / -1.12 dBm
Transmit avg optical power (Channel 2) : 0.7649 mW / -1.16 dBm
Transmit avg optical power (Channel 3) : 0.7790 mW / -1.08 dBm
Transmit avg optical power (Channel 4) : 0.7837 mW / -1.06 dBm
Rcvr signal avg optical power(Channel 1) : 0.9302 mW / -0.31 dBm
Rcvr signal avg optical power(Channel 2) : 0.9079 mW / -0.42 dBm
Rcvr signal avg optical power(Channel 3) : 0.8993 mW / -0.46 dBm
Rcvr signal avg optical power(Channel 4) : 0.8778 mW / -0.57 dBm
The module is not in low power mode, as it is not forced by hardware
(Power override is on) or by software (Power set is off).
The power mode can be queried from the kernel. In case Power override
was off, the kernel would need to take into account the state of the
LPMode signal, which is not visible to user space.
$ ethtool --show-module swp13
Module parameters for swp13:
power-mode-policy high
power-mode high
Change the power mode policy to 'auto':
# ethtool --set-module swp13 power-mode-policy auto
Query the power mode again:
$ ethtool --show-module swp13
Module parameters for swp13:
power-mode-policy auto
power-mode low
Verify with the data read from the EEPROM:
# ethtool -m swp13
Identifier : 0x11 (QSFP28)
Extended identifier description : 5.0W max. Power consumption, High Power Class (> 3.5 W) not enabled
Power set : On
Power override : On
...
Transmit avg optical power (Channel 1) : 0.0000 mW / -inf dBm
Transmit avg optical power (Channel 2) : 0.0000 mW / -inf dBm
Transmit avg optical power (Channel 3) : 0.0000 mW / -inf dBm
Transmit avg optical power (Channel 4) : 0.0000 mW / -inf dBm
Rcvr signal avg optical power(Channel 1) : 0.0000 mW / -inf dBm
Rcvr signal avg optical power(Channel 2) : 0.0000 mW / -inf dBm
Rcvr signal avg optical power(Channel 3) : 0.0000 mW / -inf dBm
Rcvr signal avg optical power(Channel 4) : 0.0000 mW / -inf dBm
Put the associated port administratively up which will instruct the host
to transition the module to high power mode:
# ip link set dev swp13 up
Query the power mode again:
$ ethtool --show-module swp13
Module parameters for swp13:
power-mode-policy auto
power-mode high
Verify with the data read from the EEPROM:
# ethtool -m swp13
Identifier : 0x11 (QSFP28)
...
Extended identifier description : 5.0W max. Power consumption, High Power Class (> 3.5 W) enabled
Power set : Off
Power override : On
...
Transmit avg optical power (Channel 1) : 0.7934 mW / -1.01 dBm
Transmit avg optical power (Channel 2) : 0.7859 mW / -1.05 dBm
Transmit avg optical power (Channel 3) : 0.7885 mW / -1.03 dBm
Transmit avg optical power (Channel 4) : 0.7985 mW / -0.98 dBm
Rcvr signal avg optical power(Channel 1) : 0.9325 mW / -0.30 dBm
Rcvr signal avg optical power(Channel 2) : 0.9034 mW / -0.44 dBm
Rcvr signal avg optical power(Channel 3) : 0.9086 mW / -0.42 dBm
Rcvr signal avg optical power(Channel 4) : 0.8885 mW / -0.51 dBm
Put the associated port administratively down which will instruct the
host to transition the module to low power mode:
# ip link set dev swp13 down
Query the power mode again:
$ ethtool --show-module swp13
Module parameters for swp13:
power-mode-policy auto
power-mode low
Verify with the data read from the EEPROM:
# ethtool -m swp13
Identifier : 0x11 (QSFP28)
...
Extended identifier description : 5.0W max. Power consumption, High Power Class (> 3.5 W) not enabled
Power set : On
Power override : On
...
Transmit avg optical power (Channel 1) : 0.0000 mW / -inf dBm
Transmit avg optical power (Channel 2) : 0.0000 mW / -inf dBm
Transmit avg optical power (Channel 3) : 0.0000 mW / -inf dBm
Transmit avg optical power (Channel 4) : 0.0000 mW / -inf dBm
Rcvr signal avg optical power(Channel 1) : 0.0000 mW / -inf dBm
Rcvr signal avg optical power(Channel 2) : 0.0000 mW / -inf dBm
Rcvr signal avg optical power(Channel 3) : 0.0000 mW / -inf dBm
Rcvr signal avg optical power(Channel 4) : 0.0000 mW / -inf dBm
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2021-10-06 18:46:42 +08:00
|
|
|
ETHTOOL_MSG_MODULE_GET,
|
|
|
|
ETHTOOL_MSG_MODULE_SET,
|
2022-10-03 14:52:00 +08:00
|
|
|
ETHTOOL_MSG_PSE_GET,
|
|
|
|
ETHTOOL_MSG_PSE_SET,
|
2022-12-02 08:25:55 +08:00
|
|
|
ETHTOOL_MSG_RSS_GET,
|
2023-01-10 00:59:39 +08:00
|
|
|
ETHTOOL_MSG_PLCA_GET_CFG,
|
|
|
|
ETHTOOL_MSG_PLCA_SET_CFG,
|
|
|
|
ETHTOOL_MSG_PLCA_GET_STATUS,
|
net: ethtool: add support for MAC Merge layer
The MAC merge sublayer (IEEE 802.3-2018 clause 99) is one of 2
specifications (the other being Frame Preemption; IEEE 802.1Q-2018
clause 6.7.2), which work together to minimize latency caused by frame
interference at TX. The overall goal of TSN is for normal traffic and
traffic with a bounded deadline to be able to cohabitate on the same L2
network and not bother each other too much.
The standards achieve this (partly) by introducing the concept of
preemptible traffic, i.e. Ethernet frames that have a custom value for
the Start-of-Frame-Delimiter (SFD), and these frames can be fragmented
and reassembled at L2 on a link-local basis. The non-preemptible frames
are called express traffic, they are transmitted using a normal SFD, and
they can preempt preemptible frames, therefore having lower latency,
which can matter at lower (100 Mbps) link speeds, or at high MTUs (jumbo
frames around 9K). Preemption is not recursive, i.e. a P frame cannot
preempt another P frame. Preemption also does not depend upon priority,
or otherwise said, an E frame with prio 0 will still preempt a P frame
with prio 7.
In terms of implementation, the standards talk about the presence of an
express MAC (eMAC) which handles express traffic, and a preemptible MAC
(pMAC) which handles preemptible traffic, and these MACs are multiplexed
on the same MII by a MAC merge layer.
To support frame preemption, the definition of the SFD was generalized
to SMD (Start-of-mPacket-Delimiter), where an mPacket is essentially an
Ethernet frame fragment, or a complete frame. Stations unaware of an SMD
value different from the standard SFD will treat P frames as error
frames. To prevent that from happening, a negotiation process is
defined.
On RX, packets are dispatched to the eMAC or pMAC after being filtered
by their SMD. On TX, the eMAC/pMAC classification decision is taken by
the 802.1Q spec, based on packet priority (each of the 8 user priority
values may have an admin-status of preemptible or express).
The MAC Merge layer and the Frame Preemption parameters have some degree
of independence in terms of how software stacks are supposed to deal
with them. The activation of the MM layer is supposed to be controlled
by an LLDP daemon (after it has been communicated that the link partner
also supports it), after which a (hardware-based or not) verification
handshake takes place, before actually enabling the feature. So the
process is intended to be relatively plug-and-play. Whereas FP settings
are supposed to be coordinated across a network using something
approximating NETCONF.
The support contained here is exclusively for the 802.3 (MAC Merge)
portions and not for the 802.1Q (Frame Preemption) parts. This API is
sufficient for an LLDP daemon to do its job. The FP adminStatus variable
from 802.1Q is outside the scope of an LLDP daemon.
I have taken a few creative licenses and augmented the Linux kernel UAPI
compared to the standard managed objects recommended by IEEE 802.3.
These are:
- ETHTOOL_A_MM_PMAC_ENABLED: According to Figure 99-6: Receive
Processing state diagram, a MAC Merge layer is always supposed to be
able to receive P frames. However, this implies keeping the pMAC
powered on, which will consume needless power in applications where FP
will never be used. If LLDP is used, the reception of an Additional
Ethernet Capabilities TLV from the link partner is sufficient
indication that the pMAC should be enabled. So my proposal is that in
Linux, we keep the pMAC turned off by default and that user space
turns it on when needed.
- ETHTOOL_A_MM_VERIFY_ENABLED: The IEEE managed object is called
aMACMergeVerifyDisableTx. I opted for consistency (positive logic) in
the boolean netlink attributes offered, so this is also positive here.
Other than the meaning being reversed, they correspond to the same
thing.
- ETHTOOL_A_MM_MAX_VERIFY_TIME: I found it most reasonable for a LLDP
daemon to maximize the verifyTime variable (delay between SMD-V
transmissions), to maximize its chances that the LP replies. IEEE says
that the verifyTime can range between 1 and 128 ms, but the NXP ENETC
stupidly keeps this variable in a 7 bit register, so the maximum
supported value is 127 ms. I could have chosen to hardcode this in the
LLDP daemon to a lower value, but why not let the kernel expose its
supported range directly.
- ETHTOOL_A_MM_TX_MIN_FRAG_SIZE: the standard managed object is called
aMACMergeAddFragSize, and expresses the "additional" fragment size
(on top of ETH_ZLEN), whereas this expresses the absolute value of the
fragment size.
- ETHTOOL_A_MM_RX_MIN_FRAG_SIZE: there doesn't appear to exist a managed
object mandated by the standard, but user space clearly needs to know
what is the minimum supported fragment size of our local receiver,
since LLDP must advertise a value no lower than that.
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2023-01-19 20:26:54 +08:00
|
|
|
ETHTOOL_MSG_MM_GET,
|
|
|
|
ETHTOOL_MSG_MM_SET,
|
2019-12-27 22:55:18 +08:00
|
|
|
|
|
|
|
/* add new constants above here */
|
|
|
|
__ETHTOOL_MSG_USER_CNT,
|
|
|
|
ETHTOOL_MSG_USER_MAX = __ETHTOOL_MSG_USER_CNT - 1
|
|
|
|
};
|
|
|
|
|
|
|
|
/* message types - kernel to userspace */
|
|
|
|
enum {
|
|
|
|
ETHTOOL_MSG_KERNEL_NONE,
|
2019-12-27 22:55:43 +08:00
|
|
|
ETHTOOL_MSG_STRSET_GET_REPLY,
|
2019-12-27 22:55:48 +08:00
|
|
|
ETHTOOL_MSG_LINKINFO_GET_REPLY,
|
2019-12-27 22:56:03 +08:00
|
|
|
ETHTOOL_MSG_LINKINFO_NTF,
|
2019-12-27 22:56:08 +08:00
|
|
|
ETHTOOL_MSG_LINKMODES_GET_REPLY,
|
2019-12-27 22:56:18 +08:00
|
|
|
ETHTOOL_MSG_LINKMODES_NTF,
|
2019-12-27 22:56:23 +08:00
|
|
|
ETHTOOL_MSG_LINKSTATE_GET_REPLY,
|
2020-01-27 06:11:04 +08:00
|
|
|
ETHTOOL_MSG_DEBUG_GET_REPLY,
|
2020-01-27 06:11:10 +08:00
|
|
|
ETHTOOL_MSG_DEBUG_NTF,
|
2020-01-27 06:11:13 +08:00
|
|
|
ETHTOOL_MSG_WOL_GET_REPLY,
|
2020-01-27 06:11:19 +08:00
|
|
|
ETHTOOL_MSG_WOL_NTF,
|
2020-03-13 04:07:48 +08:00
|
|
|
ETHTOOL_MSG_FEATURES_GET_REPLY,
|
2020-03-13 04:07:58 +08:00
|
|
|
ETHTOOL_MSG_FEATURES_SET_REPLY,
|
2020-03-13 04:08:03 +08:00
|
|
|
ETHTOOL_MSG_FEATURES_NTF,
|
2020-03-13 04:08:08 +08:00
|
|
|
ETHTOOL_MSG_PRIVFLAGS_GET_REPLY,
|
2020-03-13 04:08:18 +08:00
|
|
|
ETHTOOL_MSG_PRIVFLAGS_NTF,
|
2020-03-13 04:08:23 +08:00
|
|
|
ETHTOOL_MSG_RINGS_GET_REPLY,
|
2020-03-13 04:08:33 +08:00
|
|
|
ETHTOOL_MSG_RINGS_NTF,
|
2020-03-13 04:08:38 +08:00
|
|
|
ETHTOOL_MSG_CHANNELS_GET_REPLY,
|
2020-03-13 04:08:48 +08:00
|
|
|
ETHTOOL_MSG_CHANNELS_NTF,
|
2020-03-28 07:01:08 +08:00
|
|
|
ETHTOOL_MSG_COALESCE_GET_REPLY,
|
2020-03-28 07:01:18 +08:00
|
|
|
ETHTOOL_MSG_COALESCE_NTF,
|
2020-03-28 07:01:23 +08:00
|
|
|
ETHTOOL_MSG_PAUSE_GET_REPLY,
|
2020-03-28 07:01:33 +08:00
|
|
|
ETHTOOL_MSG_PAUSE_NTF,
|
2020-03-28 07:01:38 +08:00
|
|
|
ETHTOOL_MSG_EEE_GET_REPLY,
|
2020-03-28 07:01:48 +08:00
|
|
|
ETHTOOL_MSG_EEE_NTF,
|
2020-03-28 07:01:58 +08:00
|
|
|
ETHTOOL_MSG_TSINFO_GET_REPLY,
|
2020-05-11 03:12:34 +08:00
|
|
|
ETHTOOL_MSG_CABLE_TEST_NTF,
|
2020-05-27 06:21:37 +08:00
|
|
|
ETHTOOL_MSG_CABLE_TEST_TDR_NTF,
|
2020-09-17 07:04:10 +08:00
|
|
|
ETHTOOL_MSG_TUNNEL_INFO_GET_REPLY,
|
2021-03-30 11:59:52 +08:00
|
|
|
ETHTOOL_MSG_FEC_GET_REPLY,
|
|
|
|
ETHTOOL_MSG_FEC_NTF,
|
2021-04-09 16:06:34 +08:00
|
|
|
ETHTOOL_MSG_MODULE_EEPROM_GET_REPLY,
|
2021-04-17 03:27:39 +08:00
|
|
|
ETHTOOL_MSG_STATS_GET_REPLY,
|
2021-06-30 16:11:56 +08:00
|
|
|
ETHTOOL_MSG_PHC_VCLOCKS_GET_REPLY,
|
ethtool: Add ability to control transceiver modules' power mode
Add a pair of new ethtool messages, 'ETHTOOL_MSG_MODULE_SET' and
'ETHTOOL_MSG_MODULE_GET', that can be used to control transceiver
modules parameters and retrieve their status.
The first parameter to control is the power mode of the module. It is
only relevant for paged memory modules, as flat memory modules always
operate in low power mode.
When a paged memory module is in low power mode, its power consumption
is reduced to the minimum, the management interface towards the host is
available and the data path is deactivated.
User space can choose to put modules that are not currently in use in
low power mode and transition them to high power mode before putting the
associated ports administratively up. This is useful for user space that
favors reduced power consumption and lower temperatures over reduced
link up times. In QSFP-DD modules the transition from low power mode to
high power mode can take a few seconds and this transition is only
expected to get longer with future / more complex modules.
User space can control the power mode of the module via the power mode
policy attribute ('ETHTOOL_A_MODULE_POWER_MODE_POLICY'). Possible
values:
* high: Module is always in high power mode.
* auto: Module is transitioned by the host to high power mode when the
first port using it is put administratively up and to low power mode
when the last port using it is put administratively down.
The operational power mode of the module is available to user space via
the 'ETHTOOL_A_MODULE_POWER_MODE' attribute. The attribute is not
reported to user space when a module is not plugged-in.
The user API is designed to be generic enough so that it could be used
for modules with different memory maps (e.g., SFF-8636, CMIS).
The only implementation of the device driver API in this series is for a
MAC driver (mlxsw) where the module is controlled by the device's
firmware, but it is designed to be generic enough so that it could also
be used by implementations where the module is controlled by the CPU.
CMIS testing
============
# ethtool -m swp11
Identifier : 0x18 (QSFP-DD Double Density 8X Pluggable Transceiver (INF-8628))
...
Module State : 0x03 (ModuleReady)
LowPwrAllowRequestHW : Off
LowPwrRequestSW : Off
The module is not in low power mode, as it is not forced by hardware
(LowPwrAllowRequestHW is off) or by software (LowPwrRequestSW is off).
The power mode can be queried from the kernel. In case
LowPwrAllowRequestHW was on, the kernel would need to take into account
the state of the LowPwrRequestHW signal, which is not visible to user
space.
$ ethtool --show-module swp11
Module parameters for swp11:
power-mode-policy high
power-mode high
Change the power mode policy to 'auto':
# ethtool --set-module swp11 power-mode-policy auto
Query the power mode again:
$ ethtool --show-module swp11
Module parameters for swp11:
power-mode-policy auto
power-mode low
Verify with the data read from the EEPROM:
# ethtool -m swp11
Identifier : 0x18 (QSFP-DD Double Density 8X Pluggable Transceiver (INF-8628))
...
Module State : 0x01 (ModuleLowPwr)
LowPwrAllowRequestHW : Off
LowPwrRequestSW : On
Put the associated port administratively up which will instruct the host
to transition the module to high power mode:
# ip link set dev swp11 up
Query the power mode again:
$ ethtool --show-module swp11
Module parameters for swp11:
power-mode-policy auto
power-mode high
Verify with the data read from the EEPROM:
# ethtool -m swp11
Identifier : 0x18 (QSFP-DD Double Density 8X Pluggable Transceiver (INF-8628))
...
Module State : 0x03 (ModuleReady)
LowPwrAllowRequestHW : Off
LowPwrRequestSW : Off
Put the associated port administratively down which will instruct the
host to transition the module to low power mode:
# ip link set dev swp11 down
Query the power mode again:
$ ethtool --show-module swp11
Module parameters for swp11:
power-mode-policy auto
power-mode low
Verify with the data read from the EEPROM:
# ethtool -m swp11
Identifier : 0x18 (QSFP-DD Double Density 8X Pluggable Transceiver (INF-8628))
...
Module State : 0x01 (ModuleLowPwr)
LowPwrAllowRequestHW : Off
LowPwrRequestSW : On
SFF-8636 testing
================
# ethtool -m swp13
Identifier : 0x11 (QSFP28)
...
Extended identifier description : 5.0W max. Power consumption, High Power Class (> 3.5 W) enabled
Power set : Off
Power override : On
...
Transmit avg optical power (Channel 1) : 0.7733 mW / -1.12 dBm
Transmit avg optical power (Channel 2) : 0.7649 mW / -1.16 dBm
Transmit avg optical power (Channel 3) : 0.7790 mW / -1.08 dBm
Transmit avg optical power (Channel 4) : 0.7837 mW / -1.06 dBm
Rcvr signal avg optical power(Channel 1) : 0.9302 mW / -0.31 dBm
Rcvr signal avg optical power(Channel 2) : 0.9079 mW / -0.42 dBm
Rcvr signal avg optical power(Channel 3) : 0.8993 mW / -0.46 dBm
Rcvr signal avg optical power(Channel 4) : 0.8778 mW / -0.57 dBm
The module is not in low power mode, as it is not forced by hardware
(Power override is on) or by software (Power set is off).
The power mode can be queried from the kernel. In case Power override
was off, the kernel would need to take into account the state of the
LPMode signal, which is not visible to user space.
$ ethtool --show-module swp13
Module parameters for swp13:
power-mode-policy high
power-mode high
Change the power mode policy to 'auto':
# ethtool --set-module swp13 power-mode-policy auto
Query the power mode again:
$ ethtool --show-module swp13
Module parameters for swp13:
power-mode-policy auto
power-mode low
Verify with the data read from the EEPROM:
# ethtool -m swp13
Identifier : 0x11 (QSFP28)
Extended identifier description : 5.0W max. Power consumption, High Power Class (> 3.5 W) not enabled
Power set : On
Power override : On
...
Transmit avg optical power (Channel 1) : 0.0000 mW / -inf dBm
Transmit avg optical power (Channel 2) : 0.0000 mW / -inf dBm
Transmit avg optical power (Channel 3) : 0.0000 mW / -inf dBm
Transmit avg optical power (Channel 4) : 0.0000 mW / -inf dBm
Rcvr signal avg optical power(Channel 1) : 0.0000 mW / -inf dBm
Rcvr signal avg optical power(Channel 2) : 0.0000 mW / -inf dBm
Rcvr signal avg optical power(Channel 3) : 0.0000 mW / -inf dBm
Rcvr signal avg optical power(Channel 4) : 0.0000 mW / -inf dBm
Put the associated port administratively up which will instruct the host
to transition the module to high power mode:
# ip link set dev swp13 up
Query the power mode again:
$ ethtool --show-module swp13
Module parameters for swp13:
power-mode-policy auto
power-mode high
Verify with the data read from the EEPROM:
# ethtool -m swp13
Identifier : 0x11 (QSFP28)
...
Extended identifier description : 5.0W max. Power consumption, High Power Class (> 3.5 W) enabled
Power set : Off
Power override : On
...
Transmit avg optical power (Channel 1) : 0.7934 mW / -1.01 dBm
Transmit avg optical power (Channel 2) : 0.7859 mW / -1.05 dBm
Transmit avg optical power (Channel 3) : 0.7885 mW / -1.03 dBm
Transmit avg optical power (Channel 4) : 0.7985 mW / -0.98 dBm
Rcvr signal avg optical power(Channel 1) : 0.9325 mW / -0.30 dBm
Rcvr signal avg optical power(Channel 2) : 0.9034 mW / -0.44 dBm
Rcvr signal avg optical power(Channel 3) : 0.9086 mW / -0.42 dBm
Rcvr signal avg optical power(Channel 4) : 0.8885 mW / -0.51 dBm
Put the associated port administratively down which will instruct the
host to transition the module to low power mode:
# ip link set dev swp13 down
Query the power mode again:
$ ethtool --show-module swp13
Module parameters for swp13:
power-mode-policy auto
power-mode low
Verify with the data read from the EEPROM:
# ethtool -m swp13
Identifier : 0x11 (QSFP28)
...
Extended identifier description : 5.0W max. Power consumption, High Power Class (> 3.5 W) not enabled
Power set : On
Power override : On
...
Transmit avg optical power (Channel 1) : 0.0000 mW / -inf dBm
Transmit avg optical power (Channel 2) : 0.0000 mW / -inf dBm
Transmit avg optical power (Channel 3) : 0.0000 mW / -inf dBm
Transmit avg optical power (Channel 4) : 0.0000 mW / -inf dBm
Rcvr signal avg optical power(Channel 1) : 0.0000 mW / -inf dBm
Rcvr signal avg optical power(Channel 2) : 0.0000 mW / -inf dBm
Rcvr signal avg optical power(Channel 3) : 0.0000 mW / -inf dBm
Rcvr signal avg optical power(Channel 4) : 0.0000 mW / -inf dBm
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2021-10-06 18:46:42 +08:00
|
|
|
ETHTOOL_MSG_MODULE_GET_REPLY,
|
|
|
|
ETHTOOL_MSG_MODULE_NTF,
|
2022-10-03 14:52:00 +08:00
|
|
|
ETHTOOL_MSG_PSE_GET_REPLY,
|
2022-12-02 08:25:55 +08:00
|
|
|
ETHTOOL_MSG_RSS_GET_REPLY,
|
2023-01-10 00:59:39 +08:00
|
|
|
ETHTOOL_MSG_PLCA_GET_CFG_REPLY,
|
|
|
|
ETHTOOL_MSG_PLCA_GET_STATUS_REPLY,
|
|
|
|
ETHTOOL_MSG_PLCA_NTF,
|
net: ethtool: add support for MAC Merge layer
The MAC merge sublayer (IEEE 802.3-2018 clause 99) is one of 2
specifications (the other being Frame Preemption; IEEE 802.1Q-2018
clause 6.7.2), which work together to minimize latency caused by frame
interference at TX. The overall goal of TSN is for normal traffic and
traffic with a bounded deadline to be able to cohabitate on the same L2
network and not bother each other too much.
The standards achieve this (partly) by introducing the concept of
preemptible traffic, i.e. Ethernet frames that have a custom value for
the Start-of-Frame-Delimiter (SFD), and these frames can be fragmented
and reassembled at L2 on a link-local basis. The non-preemptible frames
are called express traffic, they are transmitted using a normal SFD, and
they can preempt preemptible frames, therefore having lower latency,
which can matter at lower (100 Mbps) link speeds, or at high MTUs (jumbo
frames around 9K). Preemption is not recursive, i.e. a P frame cannot
preempt another P frame. Preemption also does not depend upon priority,
or otherwise said, an E frame with prio 0 will still preempt a P frame
with prio 7.
In terms of implementation, the standards talk about the presence of an
express MAC (eMAC) which handles express traffic, and a preemptible MAC
(pMAC) which handles preemptible traffic, and these MACs are multiplexed
on the same MII by a MAC merge layer.
To support frame preemption, the definition of the SFD was generalized
to SMD (Start-of-mPacket-Delimiter), where an mPacket is essentially an
Ethernet frame fragment, or a complete frame. Stations unaware of an SMD
value different from the standard SFD will treat P frames as error
frames. To prevent that from happening, a negotiation process is
defined.
On RX, packets are dispatched to the eMAC or pMAC after being filtered
by their SMD. On TX, the eMAC/pMAC classification decision is taken by
the 802.1Q spec, based on packet priority (each of the 8 user priority
values may have an admin-status of preemptible or express).
The MAC Merge layer and the Frame Preemption parameters have some degree
of independence in terms of how software stacks are supposed to deal
with them. The activation of the MM layer is supposed to be controlled
by an LLDP daemon (after it has been communicated that the link partner
also supports it), after which a (hardware-based or not) verification
handshake takes place, before actually enabling the feature. So the
process is intended to be relatively plug-and-play. Whereas FP settings
are supposed to be coordinated across a network using something
approximating NETCONF.
The support contained here is exclusively for the 802.3 (MAC Merge)
portions and not for the 802.1Q (Frame Preemption) parts. This API is
sufficient for an LLDP daemon to do its job. The FP adminStatus variable
from 802.1Q is outside the scope of an LLDP daemon.
I have taken a few creative licenses and augmented the Linux kernel UAPI
compared to the standard managed objects recommended by IEEE 802.3.
These are:
- ETHTOOL_A_MM_PMAC_ENABLED: According to Figure 99-6: Receive
Processing state diagram, a MAC Merge layer is always supposed to be
able to receive P frames. However, this implies keeping the pMAC
powered on, which will consume needless power in applications where FP
will never be used. If LLDP is used, the reception of an Additional
Ethernet Capabilities TLV from the link partner is sufficient
indication that the pMAC should be enabled. So my proposal is that in
Linux, we keep the pMAC turned off by default and that user space
turns it on when needed.
- ETHTOOL_A_MM_VERIFY_ENABLED: The IEEE managed object is called
aMACMergeVerifyDisableTx. I opted for consistency (positive logic) in
the boolean netlink attributes offered, so this is also positive here.
Other than the meaning being reversed, they correspond to the same
thing.
- ETHTOOL_A_MM_MAX_VERIFY_TIME: I found it most reasonable for a LLDP
daemon to maximize the verifyTime variable (delay between SMD-V
transmissions), to maximize its chances that the LP replies. IEEE says
that the verifyTime can range between 1 and 128 ms, but the NXP ENETC
stupidly keeps this variable in a 7 bit register, so the maximum
supported value is 127 ms. I could have chosen to hardcode this in the
LLDP daemon to a lower value, but why not let the kernel expose its
supported range directly.
- ETHTOOL_A_MM_TX_MIN_FRAG_SIZE: the standard managed object is called
aMACMergeAddFragSize, and expresses the "additional" fragment size
(on top of ETH_ZLEN), whereas this expresses the absolute value of the
fragment size.
- ETHTOOL_A_MM_RX_MIN_FRAG_SIZE: there doesn't appear to exist a managed
object mandated by the standard, but user space clearly needs to know
what is the minimum supported fragment size of our local receiver,
since LLDP must advertise a value no lower than that.
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2023-01-19 20:26:54 +08:00
|
|
|
ETHTOOL_MSG_MM_GET_REPLY,
|
|
|
|
ETHTOOL_MSG_MM_NTF,
|
2019-12-27 22:55:18 +08:00
|
|
|
|
|
|
|
/* add new constants above here */
|
|
|
|
__ETHTOOL_MSG_KERNEL_CNT,
|
|
|
|
ETHTOOL_MSG_KERNEL_MAX = __ETHTOOL_MSG_KERNEL_CNT - 1
|
|
|
|
};
|
|
|
|
|
2019-12-27 22:55:23 +08:00
|
|
|
/* request header */
|
|
|
|
|
|
|
|
/* use compact bitsets in reply */
|
|
|
|
#define ETHTOOL_FLAG_COMPACT_BITSETS (1 << 0)
|
|
|
|
/* provide optional reply for SET or ACT requests */
|
|
|
|
#define ETHTOOL_FLAG_OMIT_REPLY (1 << 1)
|
2020-09-15 08:11:52 +08:00
|
|
|
/* request statistics, if supported by the driver */
|
|
|
|
#define ETHTOOL_FLAG_STATS (1 << 2)
|
2019-12-27 22:55:23 +08:00
|
|
|
|
|
|
|
#define ETHTOOL_FLAG_ALL (ETHTOOL_FLAG_COMPACT_BITSETS | \
|
2020-09-15 08:11:52 +08:00
|
|
|
ETHTOOL_FLAG_OMIT_REPLY | \
|
|
|
|
ETHTOOL_FLAG_STATS)
|
2019-12-27 22:55:23 +08:00
|
|
|
|
|
|
|
enum {
|
|
|
|
ETHTOOL_A_HEADER_UNSPEC,
|
|
|
|
ETHTOOL_A_HEADER_DEV_INDEX, /* u32 */
|
|
|
|
ETHTOOL_A_HEADER_DEV_NAME, /* string */
|
|
|
|
ETHTOOL_A_HEADER_FLAGS, /* u32 - ETHTOOL_FLAG_* */
|
|
|
|
|
|
|
|
/* add new constants above here */
|
|
|
|
__ETHTOOL_A_HEADER_CNT,
|
|
|
|
ETHTOOL_A_HEADER_MAX = __ETHTOOL_A_HEADER_CNT - 1
|
|
|
|
};
|
|
|
|
|
2019-12-27 22:55:28 +08:00
|
|
|
/* bit sets */
|
|
|
|
|
|
|
|
enum {
|
|
|
|
ETHTOOL_A_BITSET_BIT_UNSPEC,
|
|
|
|
ETHTOOL_A_BITSET_BIT_INDEX, /* u32 */
|
|
|
|
ETHTOOL_A_BITSET_BIT_NAME, /* string */
|
|
|
|
ETHTOOL_A_BITSET_BIT_VALUE, /* flag */
|
|
|
|
|
|
|
|
/* add new constants above here */
|
|
|
|
__ETHTOOL_A_BITSET_BIT_CNT,
|
|
|
|
ETHTOOL_A_BITSET_BIT_MAX = __ETHTOOL_A_BITSET_BIT_CNT - 1
|
|
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
|
|
ETHTOOL_A_BITSET_BITS_UNSPEC,
|
|
|
|
ETHTOOL_A_BITSET_BITS_BIT, /* nest - _A_BITSET_BIT_* */
|
|
|
|
|
|
|
|
/* add new constants above here */
|
|
|
|
__ETHTOOL_A_BITSET_BITS_CNT,
|
|
|
|
ETHTOOL_A_BITSET_BITS_MAX = __ETHTOOL_A_BITSET_BITS_CNT - 1
|
|
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
|
|
ETHTOOL_A_BITSET_UNSPEC,
|
|
|
|
ETHTOOL_A_BITSET_NOMASK, /* flag */
|
|
|
|
ETHTOOL_A_BITSET_SIZE, /* u32 */
|
|
|
|
ETHTOOL_A_BITSET_BITS, /* nest - _A_BITSET_BITS_* */
|
|
|
|
ETHTOOL_A_BITSET_VALUE, /* binary */
|
|
|
|
ETHTOOL_A_BITSET_MASK, /* binary */
|
|
|
|
|
|
|
|
/* add new constants above here */
|
|
|
|
__ETHTOOL_A_BITSET_CNT,
|
|
|
|
ETHTOOL_A_BITSET_MAX = __ETHTOOL_A_BITSET_CNT - 1
|
|
|
|
};
|
|
|
|
|
2019-12-27 22:55:43 +08:00
|
|
|
/* string sets */
|
|
|
|
|
|
|
|
enum {
|
|
|
|
ETHTOOL_A_STRING_UNSPEC,
|
|
|
|
ETHTOOL_A_STRING_INDEX, /* u32 */
|
|
|
|
ETHTOOL_A_STRING_VALUE, /* string */
|
|
|
|
|
|
|
|
/* add new constants above here */
|
|
|
|
__ETHTOOL_A_STRING_CNT,
|
|
|
|
ETHTOOL_A_STRING_MAX = __ETHTOOL_A_STRING_CNT - 1
|
|
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
|
|
ETHTOOL_A_STRINGS_UNSPEC,
|
|
|
|
ETHTOOL_A_STRINGS_STRING, /* nest - _A_STRINGS_* */
|
|
|
|
|
|
|
|
/* add new constants above here */
|
|
|
|
__ETHTOOL_A_STRINGS_CNT,
|
|
|
|
ETHTOOL_A_STRINGS_MAX = __ETHTOOL_A_STRINGS_CNT - 1
|
|
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
|
|
ETHTOOL_A_STRINGSET_UNSPEC,
|
|
|
|
ETHTOOL_A_STRINGSET_ID, /* u32 */
|
|
|
|
ETHTOOL_A_STRINGSET_COUNT, /* u32 */
|
|
|
|
ETHTOOL_A_STRINGSET_STRINGS, /* nest - _A_STRINGS_* */
|
|
|
|
|
|
|
|
/* add new constants above here */
|
|
|
|
__ETHTOOL_A_STRINGSET_CNT,
|
|
|
|
ETHTOOL_A_STRINGSET_MAX = __ETHTOOL_A_STRINGSET_CNT - 1
|
|
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
|
|
ETHTOOL_A_STRINGSETS_UNSPEC,
|
|
|
|
ETHTOOL_A_STRINGSETS_STRINGSET, /* nest - _A_STRINGSET_* */
|
|
|
|
|
|
|
|
/* add new constants above here */
|
|
|
|
__ETHTOOL_A_STRINGSETS_CNT,
|
|
|
|
ETHTOOL_A_STRINGSETS_MAX = __ETHTOOL_A_STRINGSETS_CNT - 1
|
|
|
|
};
|
|
|
|
|
|
|
|
/* STRSET */
|
|
|
|
|
|
|
|
enum {
|
|
|
|
ETHTOOL_A_STRSET_UNSPEC,
|
|
|
|
ETHTOOL_A_STRSET_HEADER, /* nest - _A_HEADER_* */
|
|
|
|
ETHTOOL_A_STRSET_STRINGSETS, /* nest - _A_STRINGSETS_* */
|
|
|
|
ETHTOOL_A_STRSET_COUNTS_ONLY, /* flag */
|
|
|
|
|
|
|
|
/* add new constants above here */
|
|
|
|
__ETHTOOL_A_STRSET_CNT,
|
|
|
|
ETHTOOL_A_STRSET_MAX = __ETHTOOL_A_STRSET_CNT - 1
|
|
|
|
};
|
|
|
|
|
2019-12-27 22:55:48 +08:00
|
|
|
/* LINKINFO */
|
|
|
|
|
|
|
|
enum {
|
|
|
|
ETHTOOL_A_LINKINFO_UNSPEC,
|
|
|
|
ETHTOOL_A_LINKINFO_HEADER, /* nest - _A_HEADER_* */
|
|
|
|
ETHTOOL_A_LINKINFO_PORT, /* u8 */
|
|
|
|
ETHTOOL_A_LINKINFO_PHYADDR, /* u8 */
|
|
|
|
ETHTOOL_A_LINKINFO_TP_MDIX, /* u8 */
|
|
|
|
ETHTOOL_A_LINKINFO_TP_MDIX_CTRL, /* u8 */
|
|
|
|
ETHTOOL_A_LINKINFO_TRANSCEIVER, /* u8 */
|
|
|
|
|
|
|
|
/* add new constants above here */
|
|
|
|
__ETHTOOL_A_LINKINFO_CNT,
|
|
|
|
ETHTOOL_A_LINKINFO_MAX = __ETHTOOL_A_LINKINFO_CNT - 1
|
|
|
|
};
|
|
|
|
|
2019-12-27 22:56:08 +08:00
|
|
|
/* LINKMODES */
|
|
|
|
|
|
|
|
enum {
|
|
|
|
ETHTOOL_A_LINKMODES_UNSPEC,
|
|
|
|
ETHTOOL_A_LINKMODES_HEADER, /* nest - _A_HEADER_* */
|
|
|
|
ETHTOOL_A_LINKMODES_AUTONEG, /* u8 */
|
|
|
|
ETHTOOL_A_LINKMODES_OURS, /* bitset */
|
|
|
|
ETHTOOL_A_LINKMODES_PEER, /* bitset */
|
|
|
|
ETHTOOL_A_LINKMODES_SPEED, /* u32 */
|
|
|
|
ETHTOOL_A_LINKMODES_DUPLEX, /* u8 */
|
2020-05-05 14:35:05 +08:00
|
|
|
ETHTOOL_A_LINKMODES_MASTER_SLAVE_CFG, /* u8 */
|
|
|
|
ETHTOOL_A_LINKMODES_MASTER_SLAVE_STATE, /* u8 */
|
2021-02-03 02:06:06 +08:00
|
|
|
ETHTOOL_A_LINKMODES_LANES, /* u32 */
|
net: phy: Add support for rate matching
This adds support for rate matching (also known as rate adaptation) to
the phy subsystem. The general idea is that the phy interface runs at
one speed, and the MAC throttles the rate at which it sends packets to
the link speed. There's a good overview of several techniques for
achieving this at [1]. This patch adds support for three: pause-frame
based (such as in Aquantia phys), CRS-based (such as in 10PASS-TS and
2BASE-TL), and open-loop-based (such as in 10GBASE-W).
This patch makes a few assumptions and a few non assumptions about the
types of rate matching available. First, it assumes that different phys
may use different forms of rate matching. Second, it assumes that phys
can use rate matching for any of their supported link speeds (e.g. if a
phy supports 10BASE-T and XGMII, then it can adapt XGMII to 10BASE-T).
Third, it does not assume that all interface modes will use the same
form of rate matching. Fourth, it does not assume that all phy devices
will support rate matching (even if some do). Relaxing or strengthening
these (non-)assumptions could result in a different API. For example, if
all interface modes were assumed to use the same form of rate matching,
then a bitmask of interface modes supportting rate matching would
suffice.
For some better visibility into the process, the current rate matching
mode is exposed as part of the ethtool ksettings. For the moment, only
read access is supported. I'm not sure what userspace might want to
configure yet (disable it altogether, disable just one mode, specify the
mode to use, etc.). For the moment, since only pause-based rate
adaptation support is added in the next few commits, rate matching can
be disabled altogether by adjusting the advertisement.
802.3 calls this feature "rate adaptation" in clause 49 (10GBASE-R) and
"rate matching" in clause 61 (10PASS-TL and 2BASE-TS). Aquantia also calls
this feature "rate adaptation". I chose "rate matching" because it is
shorter, and because Russell doesn't think "adaptation" is correct in this
context.
Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2022-09-21 06:12:31 +08:00
|
|
|
ETHTOOL_A_LINKMODES_RATE_MATCHING, /* u8 */
|
2019-12-27 22:56:08 +08:00
|
|
|
|
|
|
|
/* add new constants above here */
|
|
|
|
__ETHTOOL_A_LINKMODES_CNT,
|
|
|
|
ETHTOOL_A_LINKMODES_MAX = __ETHTOOL_A_LINKMODES_CNT - 1
|
|
|
|
};
|
|
|
|
|
2019-12-27 22:56:23 +08:00
|
|
|
/* LINKSTATE */
|
|
|
|
|
|
|
|
enum {
|
|
|
|
ETHTOOL_A_LINKSTATE_UNSPEC,
|
|
|
|
ETHTOOL_A_LINKSTATE_HEADER, /* nest - _A_HEADER_* */
|
|
|
|
ETHTOOL_A_LINKSTATE_LINK, /* u8 */
|
2020-05-20 14:29:14 +08:00
|
|
|
ETHTOOL_A_LINKSTATE_SQI, /* u32 */
|
|
|
|
ETHTOOL_A_LINKSTATE_SQI_MAX, /* u32 */
|
2020-06-30 04:46:16 +08:00
|
|
|
ETHTOOL_A_LINKSTATE_EXT_STATE, /* u8 */
|
|
|
|
ETHTOOL_A_LINKSTATE_EXT_SUBSTATE, /* u8 */
|
2022-11-05 03:01:25 +08:00
|
|
|
ETHTOOL_A_LINKSTATE_EXT_DOWN_CNT, /* u32 */
|
2019-12-27 22:56:23 +08:00
|
|
|
|
|
|
|
/* add new constants above here */
|
|
|
|
__ETHTOOL_A_LINKSTATE_CNT,
|
|
|
|
ETHTOOL_A_LINKSTATE_MAX = __ETHTOOL_A_LINKSTATE_CNT - 1
|
|
|
|
};
|
|
|
|
|
2020-01-27 06:11:04 +08:00
|
|
|
/* DEBUG */
|
|
|
|
|
|
|
|
enum {
|
|
|
|
ETHTOOL_A_DEBUG_UNSPEC,
|
|
|
|
ETHTOOL_A_DEBUG_HEADER, /* nest - _A_HEADER_* */
|
|
|
|
ETHTOOL_A_DEBUG_MSGMASK, /* bitset */
|
|
|
|
|
|
|
|
/* add new constants above here */
|
|
|
|
__ETHTOOL_A_DEBUG_CNT,
|
|
|
|
ETHTOOL_A_DEBUG_MAX = __ETHTOOL_A_DEBUG_CNT - 1
|
|
|
|
};
|
|
|
|
|
2020-01-27 06:11:13 +08:00
|
|
|
/* WOL */
|
|
|
|
|
|
|
|
enum {
|
|
|
|
ETHTOOL_A_WOL_UNSPEC,
|
|
|
|
ETHTOOL_A_WOL_HEADER, /* nest - _A_HEADER_* */
|
|
|
|
ETHTOOL_A_WOL_MODES, /* bitset */
|
|
|
|
ETHTOOL_A_WOL_SOPASS, /* binary */
|
|
|
|
|
|
|
|
/* add new constants above here */
|
|
|
|
__ETHTOOL_A_WOL_CNT,
|
|
|
|
ETHTOOL_A_WOL_MAX = __ETHTOOL_A_WOL_CNT - 1
|
|
|
|
};
|
|
|
|
|
2020-03-13 04:07:48 +08:00
|
|
|
/* FEATURES */
|
|
|
|
|
|
|
|
enum {
|
|
|
|
ETHTOOL_A_FEATURES_UNSPEC,
|
|
|
|
ETHTOOL_A_FEATURES_HEADER, /* nest - _A_HEADER_* */
|
|
|
|
ETHTOOL_A_FEATURES_HW, /* bitset */
|
|
|
|
ETHTOOL_A_FEATURES_WANTED, /* bitset */
|
|
|
|
ETHTOOL_A_FEATURES_ACTIVE, /* bitset */
|
|
|
|
ETHTOOL_A_FEATURES_NOCHANGE, /* bitset */
|
|
|
|
|
|
|
|
/* add new constants above here */
|
|
|
|
__ETHTOOL_A_FEATURES_CNT,
|
|
|
|
ETHTOOL_A_FEATURES_MAX = __ETHTOOL_A_FEATURES_CNT - 1
|
|
|
|
};
|
|
|
|
|
2020-03-13 04:08:08 +08:00
|
|
|
/* PRIVFLAGS */
|
|
|
|
|
|
|
|
enum {
|
|
|
|
ETHTOOL_A_PRIVFLAGS_UNSPEC,
|
|
|
|
ETHTOOL_A_PRIVFLAGS_HEADER, /* nest - _A_HEADER_* */
|
|
|
|
ETHTOOL_A_PRIVFLAGS_FLAGS, /* bitset */
|
|
|
|
|
|
|
|
/* add new constants above here */
|
|
|
|
__ETHTOOL_A_PRIVFLAGS_CNT,
|
|
|
|
ETHTOOL_A_PRIVFLAGS_MAX = __ETHTOOL_A_PRIVFLAGS_CNT - 1
|
|
|
|
};
|
|
|
|
|
2020-03-13 04:08:23 +08:00
|
|
|
/* RINGS */
|
|
|
|
|
2022-01-28 02:42:59 +08:00
|
|
|
enum {
|
|
|
|
ETHTOOL_TCP_DATA_SPLIT_UNKNOWN = 0,
|
|
|
|
ETHTOOL_TCP_DATA_SPLIT_DISABLED,
|
|
|
|
ETHTOOL_TCP_DATA_SPLIT_ENABLED,
|
|
|
|
};
|
|
|
|
|
2020-03-13 04:08:23 +08:00
|
|
|
enum {
|
|
|
|
ETHTOOL_A_RINGS_UNSPEC,
|
|
|
|
ETHTOOL_A_RINGS_HEADER, /* nest - _A_HEADER_* */
|
|
|
|
ETHTOOL_A_RINGS_RX_MAX, /* u32 */
|
|
|
|
ETHTOOL_A_RINGS_RX_MINI_MAX, /* u32 */
|
|
|
|
ETHTOOL_A_RINGS_RX_JUMBO_MAX, /* u32 */
|
|
|
|
ETHTOOL_A_RINGS_TX_MAX, /* u32 */
|
|
|
|
ETHTOOL_A_RINGS_RX, /* u32 */
|
|
|
|
ETHTOOL_A_RINGS_RX_MINI, /* u32 */
|
|
|
|
ETHTOOL_A_RINGS_RX_JUMBO, /* u32 */
|
|
|
|
ETHTOOL_A_RINGS_TX, /* u32 */
|
2021-11-18 20:12:42 +08:00
|
|
|
ETHTOOL_A_RINGS_RX_BUF_LEN, /* u32 */
|
2022-01-28 02:42:59 +08:00
|
|
|
ETHTOOL_A_RINGS_TCP_DATA_SPLIT, /* u8 */
|
2022-02-23 02:39:12 +08:00
|
|
|
ETHTOOL_A_RINGS_CQE_SIZE, /* u32 */
|
2022-04-12 10:01:19 +08:00
|
|
|
ETHTOOL_A_RINGS_TX_PUSH, /* u8 */
|
2020-03-13 04:08:23 +08:00
|
|
|
|
|
|
|
/* add new constants above here */
|
|
|
|
__ETHTOOL_A_RINGS_CNT,
|
|
|
|
ETHTOOL_A_RINGS_MAX = (__ETHTOOL_A_RINGS_CNT - 1)
|
|
|
|
};
|
|
|
|
|
2020-03-13 04:08:38 +08:00
|
|
|
/* CHANNELS */
|
|
|
|
|
|
|
|
enum {
|
|
|
|
ETHTOOL_A_CHANNELS_UNSPEC,
|
|
|
|
ETHTOOL_A_CHANNELS_HEADER, /* nest - _A_HEADER_* */
|
|
|
|
ETHTOOL_A_CHANNELS_RX_MAX, /* u32 */
|
|
|
|
ETHTOOL_A_CHANNELS_TX_MAX, /* u32 */
|
|
|
|
ETHTOOL_A_CHANNELS_OTHER_MAX, /* u32 */
|
|
|
|
ETHTOOL_A_CHANNELS_COMBINED_MAX, /* u32 */
|
|
|
|
ETHTOOL_A_CHANNELS_RX_COUNT, /* u32 */
|
|
|
|
ETHTOOL_A_CHANNELS_TX_COUNT, /* u32 */
|
|
|
|
ETHTOOL_A_CHANNELS_OTHER_COUNT, /* u32 */
|
|
|
|
ETHTOOL_A_CHANNELS_COMBINED_COUNT, /* u32 */
|
|
|
|
|
|
|
|
/* add new constants above here */
|
|
|
|
__ETHTOOL_A_CHANNELS_CNT,
|
|
|
|
ETHTOOL_A_CHANNELS_MAX = (__ETHTOOL_A_CHANNELS_CNT - 1)
|
|
|
|
};
|
|
|
|
|
2020-03-28 07:01:08 +08:00
|
|
|
/* COALESCE */
|
|
|
|
|
|
|
|
enum {
|
|
|
|
ETHTOOL_A_COALESCE_UNSPEC,
|
|
|
|
ETHTOOL_A_COALESCE_HEADER, /* nest - _A_HEADER_* */
|
|
|
|
ETHTOOL_A_COALESCE_RX_USECS, /* u32 */
|
|
|
|
ETHTOOL_A_COALESCE_RX_MAX_FRAMES, /* u32 */
|
|
|
|
ETHTOOL_A_COALESCE_RX_USECS_IRQ, /* u32 */
|
|
|
|
ETHTOOL_A_COALESCE_RX_MAX_FRAMES_IRQ, /* u32 */
|
|
|
|
ETHTOOL_A_COALESCE_TX_USECS, /* u32 */
|
|
|
|
ETHTOOL_A_COALESCE_TX_MAX_FRAMES, /* u32 */
|
|
|
|
ETHTOOL_A_COALESCE_TX_USECS_IRQ, /* u32 */
|
|
|
|
ETHTOOL_A_COALESCE_TX_MAX_FRAMES_IRQ, /* u32 */
|
|
|
|
ETHTOOL_A_COALESCE_STATS_BLOCK_USECS, /* u32 */
|
|
|
|
ETHTOOL_A_COALESCE_USE_ADAPTIVE_RX, /* u8 */
|
|
|
|
ETHTOOL_A_COALESCE_USE_ADAPTIVE_TX, /* u8 */
|
|
|
|
ETHTOOL_A_COALESCE_PKT_RATE_LOW, /* u32 */
|
|
|
|
ETHTOOL_A_COALESCE_RX_USECS_LOW, /* u32 */
|
|
|
|
ETHTOOL_A_COALESCE_RX_MAX_FRAMES_LOW, /* u32 */
|
|
|
|
ETHTOOL_A_COALESCE_TX_USECS_LOW, /* u32 */
|
|
|
|
ETHTOOL_A_COALESCE_TX_MAX_FRAMES_LOW, /* u32 */
|
|
|
|
ETHTOOL_A_COALESCE_PKT_RATE_HIGH, /* u32 */
|
|
|
|
ETHTOOL_A_COALESCE_RX_USECS_HIGH, /* u32 */
|
|
|
|
ETHTOOL_A_COALESCE_RX_MAX_FRAMES_HIGH, /* u32 */
|
|
|
|
ETHTOOL_A_COALESCE_TX_USECS_HIGH, /* u32 */
|
|
|
|
ETHTOOL_A_COALESCE_TX_MAX_FRAMES_HIGH, /* u32 */
|
|
|
|
ETHTOOL_A_COALESCE_RATE_SAMPLE_INTERVAL, /* u32 */
|
2021-08-20 15:35:17 +08:00
|
|
|
ETHTOOL_A_COALESCE_USE_CQE_MODE_TX, /* u8 */
|
|
|
|
ETHTOOL_A_COALESCE_USE_CQE_MODE_RX, /* u8 */
|
2023-01-11 21:05:18 +08:00
|
|
|
ETHTOOL_A_COALESCE_TX_AGGR_MAX_BYTES, /* u32 */
|
|
|
|
ETHTOOL_A_COALESCE_TX_AGGR_MAX_FRAMES, /* u32 */
|
|
|
|
ETHTOOL_A_COALESCE_TX_AGGR_TIME_USECS, /* u32 */
|
2020-03-28 07:01:08 +08:00
|
|
|
|
|
|
|
/* add new constants above here */
|
|
|
|
__ETHTOOL_A_COALESCE_CNT,
|
|
|
|
ETHTOOL_A_COALESCE_MAX = (__ETHTOOL_A_COALESCE_CNT - 1)
|
|
|
|
};
|
|
|
|
|
2020-03-28 07:01:23 +08:00
|
|
|
/* PAUSE */
|
|
|
|
|
|
|
|
enum {
|
|
|
|
ETHTOOL_A_PAUSE_UNSPEC,
|
|
|
|
ETHTOOL_A_PAUSE_HEADER, /* nest - _A_HEADER_* */
|
|
|
|
ETHTOOL_A_PAUSE_AUTONEG, /* u8 */
|
|
|
|
ETHTOOL_A_PAUSE_RX, /* u8 */
|
|
|
|
ETHTOOL_A_PAUSE_TX, /* u8 */
|
2020-09-15 08:11:52 +08:00
|
|
|
ETHTOOL_A_PAUSE_STATS, /* nest - _PAUSE_STAT_* */
|
2020-03-28 07:01:23 +08:00
|
|
|
|
|
|
|
/* add new constants above here */
|
|
|
|
__ETHTOOL_A_PAUSE_CNT,
|
|
|
|
ETHTOOL_A_PAUSE_MAX = (__ETHTOOL_A_PAUSE_CNT - 1)
|
|
|
|
};
|
|
|
|
|
2020-09-15 08:11:52 +08:00
|
|
|
enum {
|
|
|
|
ETHTOOL_A_PAUSE_STAT_UNSPEC,
|
|
|
|
ETHTOOL_A_PAUSE_STAT_PAD,
|
|
|
|
|
|
|
|
ETHTOOL_A_PAUSE_STAT_TX_FRAMES,
|
|
|
|
ETHTOOL_A_PAUSE_STAT_RX_FRAMES,
|
|
|
|
|
2021-11-03 06:02:36 +08:00
|
|
|
/* add new constants above here
|
|
|
|
* adjust ETHTOOL_PAUSE_STAT_CNT if adding non-stats!
|
|
|
|
*/
|
2020-09-15 08:11:52 +08:00
|
|
|
__ETHTOOL_A_PAUSE_STAT_CNT,
|
|
|
|
ETHTOOL_A_PAUSE_STAT_MAX = (__ETHTOOL_A_PAUSE_STAT_CNT - 1)
|
|
|
|
};
|
|
|
|
|
2020-03-28 07:01:38 +08:00
|
|
|
/* EEE */
|
|
|
|
|
|
|
|
enum {
|
|
|
|
ETHTOOL_A_EEE_UNSPEC,
|
|
|
|
ETHTOOL_A_EEE_HEADER, /* nest - _A_HEADER_* */
|
|
|
|
ETHTOOL_A_EEE_MODES_OURS, /* bitset */
|
|
|
|
ETHTOOL_A_EEE_MODES_PEER, /* bitset */
|
|
|
|
ETHTOOL_A_EEE_ACTIVE, /* u8 */
|
|
|
|
ETHTOOL_A_EEE_ENABLED, /* u8 */
|
|
|
|
ETHTOOL_A_EEE_TX_LPI_ENABLED, /* u8 */
|
|
|
|
ETHTOOL_A_EEE_TX_LPI_TIMER, /* u32 */
|
|
|
|
|
|
|
|
/* add new constants above here */
|
|
|
|
__ETHTOOL_A_EEE_CNT,
|
|
|
|
ETHTOOL_A_EEE_MAX = (__ETHTOOL_A_EEE_CNT - 1)
|
|
|
|
};
|
|
|
|
|
2020-03-28 07:01:58 +08:00
|
|
|
/* TSINFO */
|
|
|
|
|
|
|
|
enum {
|
|
|
|
ETHTOOL_A_TSINFO_UNSPEC,
|
|
|
|
ETHTOOL_A_TSINFO_HEADER, /* nest - _A_HEADER_* */
|
|
|
|
ETHTOOL_A_TSINFO_TIMESTAMPING, /* bitset */
|
|
|
|
ETHTOOL_A_TSINFO_TX_TYPES, /* bitset */
|
|
|
|
ETHTOOL_A_TSINFO_RX_FILTERS, /* bitset */
|
|
|
|
ETHTOOL_A_TSINFO_PHC_INDEX, /* u32 */
|
|
|
|
|
|
|
|
/* add new constants above here */
|
|
|
|
__ETHTOOL_A_TSINFO_CNT,
|
|
|
|
ETHTOOL_A_TSINFO_MAX = (__ETHTOOL_A_TSINFO_CNT - 1)
|
|
|
|
};
|
|
|
|
|
2021-06-30 16:11:56 +08:00
|
|
|
/* PHC VCLOCKS */
|
|
|
|
|
|
|
|
enum {
|
|
|
|
ETHTOOL_A_PHC_VCLOCKS_UNSPEC,
|
|
|
|
ETHTOOL_A_PHC_VCLOCKS_HEADER, /* nest - _A_HEADER_* */
|
|
|
|
ETHTOOL_A_PHC_VCLOCKS_NUM, /* u32 */
|
|
|
|
ETHTOOL_A_PHC_VCLOCKS_INDEX, /* array, s32 */
|
|
|
|
|
|
|
|
/* add new constants above here */
|
|
|
|
__ETHTOOL_A_PHC_VCLOCKS_CNT,
|
|
|
|
ETHTOOL_A_PHC_VCLOCKS_MAX = (__ETHTOOL_A_PHC_VCLOCKS_CNT - 1)
|
|
|
|
};
|
|
|
|
|
2020-05-11 03:12:33 +08:00
|
|
|
/* CABLE TEST */
|
|
|
|
|
|
|
|
enum {
|
|
|
|
ETHTOOL_A_CABLE_TEST_UNSPEC,
|
|
|
|
ETHTOOL_A_CABLE_TEST_HEADER, /* nest - _A_HEADER_* */
|
|
|
|
|
|
|
|
/* add new constants above here */
|
|
|
|
__ETHTOOL_A_CABLE_TEST_CNT,
|
|
|
|
ETHTOOL_A_CABLE_TEST_MAX = __ETHTOOL_A_CABLE_TEST_CNT - 1
|
|
|
|
};
|
|
|
|
|
2020-05-11 03:12:34 +08:00
|
|
|
/* CABLE TEST NOTIFY */
|
|
|
|
enum {
|
|
|
|
ETHTOOL_A_CABLE_RESULT_CODE_UNSPEC,
|
|
|
|
ETHTOOL_A_CABLE_RESULT_CODE_OK,
|
|
|
|
ETHTOOL_A_CABLE_RESULT_CODE_OPEN,
|
|
|
|
ETHTOOL_A_CABLE_RESULT_CODE_SAME_SHORT,
|
|
|
|
ETHTOOL_A_CABLE_RESULT_CODE_CROSS_SHORT,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
|
|
ETHTOOL_A_CABLE_PAIR_A,
|
|
|
|
ETHTOOL_A_CABLE_PAIR_B,
|
|
|
|
ETHTOOL_A_CABLE_PAIR_C,
|
|
|
|
ETHTOOL_A_CABLE_PAIR_D,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
|
|
ETHTOOL_A_CABLE_RESULT_UNSPEC,
|
|
|
|
ETHTOOL_A_CABLE_RESULT_PAIR, /* u8 ETHTOOL_A_CABLE_PAIR_ */
|
|
|
|
ETHTOOL_A_CABLE_RESULT_CODE, /* u8 ETHTOOL_A_CABLE_RESULT_CODE_ */
|
|
|
|
|
|
|
|
__ETHTOOL_A_CABLE_RESULT_CNT,
|
|
|
|
ETHTOOL_A_CABLE_RESULT_MAX = (__ETHTOOL_A_CABLE_RESULT_CNT - 1)
|
|
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
|
|
ETHTOOL_A_CABLE_FAULT_LENGTH_UNSPEC,
|
|
|
|
ETHTOOL_A_CABLE_FAULT_LENGTH_PAIR, /* u8 ETHTOOL_A_CABLE_PAIR_ */
|
|
|
|
ETHTOOL_A_CABLE_FAULT_LENGTH_CM, /* u32 */
|
|
|
|
|
|
|
|
__ETHTOOL_A_CABLE_FAULT_LENGTH_CNT,
|
|
|
|
ETHTOOL_A_CABLE_FAULT_LENGTH_MAX = (__ETHTOOL_A_CABLE_FAULT_LENGTH_CNT - 1)
|
|
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
|
|
ETHTOOL_A_CABLE_TEST_NTF_STATUS_UNSPEC,
|
|
|
|
ETHTOOL_A_CABLE_TEST_NTF_STATUS_STARTED,
|
|
|
|
ETHTOOL_A_CABLE_TEST_NTF_STATUS_COMPLETED
|
|
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
|
|
ETHTOOL_A_CABLE_NEST_UNSPEC,
|
|
|
|
ETHTOOL_A_CABLE_NEST_RESULT, /* nest - ETHTOOL_A_CABLE_RESULT_ */
|
|
|
|
ETHTOOL_A_CABLE_NEST_FAULT_LENGTH, /* nest - ETHTOOL_A_CABLE_FAULT_LENGTH_ */
|
|
|
|
__ETHTOOL_A_CABLE_NEST_CNT,
|
|
|
|
ETHTOOL_A_CABLE_NEST_MAX = (__ETHTOOL_A_CABLE_NEST_CNT - 1)
|
|
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
|
|
ETHTOOL_A_CABLE_TEST_NTF_UNSPEC,
|
|
|
|
ETHTOOL_A_CABLE_TEST_NTF_HEADER, /* nest - ETHTOOL_A_HEADER_* */
|
|
|
|
ETHTOOL_A_CABLE_TEST_NTF_STATUS, /* u8 - _STARTED/_COMPLETE */
|
|
|
|
ETHTOOL_A_CABLE_TEST_NTF_NEST, /* nest - of results: */
|
|
|
|
|
|
|
|
__ETHTOOL_A_CABLE_TEST_NTF_CNT,
|
|
|
|
ETHTOOL_A_CABLE_TEST_NTF_MAX = (__ETHTOOL_A_CABLE_TEST_NTF_CNT - 1)
|
|
|
|
};
|
|
|
|
|
2020-05-27 06:21:37 +08:00
|
|
|
/* CABLE TEST TDR */
|
|
|
|
|
2020-05-27 06:21:41 +08:00
|
|
|
enum {
|
|
|
|
ETHTOOL_A_CABLE_TEST_TDR_CFG_UNSPEC,
|
|
|
|
ETHTOOL_A_CABLE_TEST_TDR_CFG_FIRST, /* u32 */
|
|
|
|
ETHTOOL_A_CABLE_TEST_TDR_CFG_LAST, /* u32 */
|
|
|
|
ETHTOOL_A_CABLE_TEST_TDR_CFG_STEP, /* u32 */
|
|
|
|
ETHTOOL_A_CABLE_TEST_TDR_CFG_PAIR, /* u8 */
|
|
|
|
|
|
|
|
/* add new constants above here */
|
|
|
|
__ETHTOOL_A_CABLE_TEST_TDR_CFG_CNT,
|
|
|
|
ETHTOOL_A_CABLE_TEST_TDR_CFG_MAX = __ETHTOOL_A_CABLE_TEST_TDR_CFG_CNT - 1
|
|
|
|
};
|
|
|
|
|
2020-05-27 06:21:37 +08:00
|
|
|
enum {
|
|
|
|
ETHTOOL_A_CABLE_TEST_TDR_UNSPEC,
|
|
|
|
ETHTOOL_A_CABLE_TEST_TDR_HEADER, /* nest - _A_HEADER_* */
|
2020-05-27 06:21:41 +08:00
|
|
|
ETHTOOL_A_CABLE_TEST_TDR_CFG, /* nest - *_TDR_CFG_* */
|
2020-05-27 06:21:37 +08:00
|
|
|
|
|
|
|
/* add new constants above here */
|
|
|
|
__ETHTOOL_A_CABLE_TEST_TDR_CNT,
|
|
|
|
ETHTOOL_A_CABLE_TEST_TDR_MAX = __ETHTOOL_A_CABLE_TEST_TDR_CNT - 1
|
|
|
|
};
|
|
|
|
|
|
|
|
/* CABLE TEST TDR NOTIFY */
|
|
|
|
|
|
|
|
enum {
|
|
|
|
ETHTOOL_A_CABLE_AMPLITUDE_UNSPEC,
|
|
|
|
ETHTOOL_A_CABLE_AMPLITUDE_PAIR, /* u8 */
|
|
|
|
ETHTOOL_A_CABLE_AMPLITUDE_mV, /* s16 */
|
|
|
|
|
|
|
|
__ETHTOOL_A_CABLE_AMPLITUDE_CNT,
|
|
|
|
ETHTOOL_A_CABLE_AMPLITUDE_MAX = (__ETHTOOL_A_CABLE_AMPLITUDE_CNT - 1)
|
|
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
|
|
ETHTOOL_A_CABLE_PULSE_UNSPEC,
|
|
|
|
ETHTOOL_A_CABLE_PULSE_mV, /* s16 */
|
|
|
|
|
|
|
|
__ETHTOOL_A_CABLE_PULSE_CNT,
|
|
|
|
ETHTOOL_A_CABLE_PULSE_MAX = (__ETHTOOL_A_CABLE_PULSE_CNT - 1)
|
|
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
|
|
ETHTOOL_A_CABLE_STEP_UNSPEC,
|
|
|
|
ETHTOOL_A_CABLE_STEP_FIRST_DISTANCE, /* u32 */
|
|
|
|
ETHTOOL_A_CABLE_STEP_LAST_DISTANCE, /* u32 */
|
|
|
|
ETHTOOL_A_CABLE_STEP_STEP_DISTANCE, /* u32 */
|
|
|
|
|
|
|
|
__ETHTOOL_A_CABLE_STEP_CNT,
|
|
|
|
ETHTOOL_A_CABLE_STEP_MAX = (__ETHTOOL_A_CABLE_STEP_CNT - 1)
|
|
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
|
|
ETHTOOL_A_CABLE_TDR_NEST_UNSPEC,
|
|
|
|
ETHTOOL_A_CABLE_TDR_NEST_STEP, /* nest - ETHTTOOL_A_CABLE_STEP */
|
|
|
|
ETHTOOL_A_CABLE_TDR_NEST_AMPLITUDE, /* nest - ETHTOOL_A_CABLE_AMPLITUDE */
|
|
|
|
ETHTOOL_A_CABLE_TDR_NEST_PULSE, /* nest - ETHTOOL_A_CABLE_PULSE */
|
|
|
|
|
|
|
|
__ETHTOOL_A_CABLE_TDR_NEST_CNT,
|
|
|
|
ETHTOOL_A_CABLE_TDR_NEST_MAX = (__ETHTOOL_A_CABLE_TDR_NEST_CNT - 1)
|
|
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
|
|
ETHTOOL_A_CABLE_TEST_TDR_NTF_UNSPEC,
|
|
|
|
ETHTOOL_A_CABLE_TEST_TDR_NTF_HEADER, /* nest - ETHTOOL_A_HEADER_* */
|
|
|
|
ETHTOOL_A_CABLE_TEST_TDR_NTF_STATUS, /* u8 - _STARTED/_COMPLETE */
|
|
|
|
ETHTOOL_A_CABLE_TEST_TDR_NTF_NEST, /* nest - of results: */
|
|
|
|
|
|
|
|
/* add new constants above here */
|
|
|
|
__ETHTOOL_A_CABLE_TEST_TDR_NTF_CNT,
|
|
|
|
ETHTOOL_A_CABLE_TEST_TDR_NTF_MAX = __ETHTOOL_A_CABLE_TEST_TDR_NTF_CNT - 1
|
|
|
|
};
|
|
|
|
|
2020-07-10 08:42:47 +08:00
|
|
|
/* TUNNEL INFO */
|
|
|
|
|
|
|
|
enum {
|
|
|
|
ETHTOOL_UDP_TUNNEL_TYPE_VXLAN,
|
|
|
|
ETHTOOL_UDP_TUNNEL_TYPE_GENEVE,
|
|
|
|
ETHTOOL_UDP_TUNNEL_TYPE_VXLAN_GPE,
|
|
|
|
|
|
|
|
__ETHTOOL_UDP_TUNNEL_TYPE_CNT
|
|
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
|
|
ETHTOOL_A_TUNNEL_UDP_ENTRY_UNSPEC,
|
|
|
|
|
|
|
|
ETHTOOL_A_TUNNEL_UDP_ENTRY_PORT, /* be16 */
|
|
|
|
ETHTOOL_A_TUNNEL_UDP_ENTRY_TYPE, /* u32 */
|
|
|
|
|
|
|
|
/* add new constants above here */
|
|
|
|
__ETHTOOL_A_TUNNEL_UDP_ENTRY_CNT,
|
|
|
|
ETHTOOL_A_TUNNEL_UDP_ENTRY_MAX = (__ETHTOOL_A_TUNNEL_UDP_ENTRY_CNT - 1)
|
|
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
|
|
ETHTOOL_A_TUNNEL_UDP_TABLE_UNSPEC,
|
|
|
|
|
|
|
|
ETHTOOL_A_TUNNEL_UDP_TABLE_SIZE, /* u32 */
|
|
|
|
ETHTOOL_A_TUNNEL_UDP_TABLE_TYPES, /* bitset */
|
|
|
|
ETHTOOL_A_TUNNEL_UDP_TABLE_ENTRY, /* nest - _UDP_ENTRY_* */
|
|
|
|
|
|
|
|
/* add new constants above here */
|
|
|
|
__ETHTOOL_A_TUNNEL_UDP_TABLE_CNT,
|
|
|
|
ETHTOOL_A_TUNNEL_UDP_TABLE_MAX = (__ETHTOOL_A_TUNNEL_UDP_TABLE_CNT - 1)
|
|
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
|
|
ETHTOOL_A_TUNNEL_UDP_UNSPEC,
|
|
|
|
|
|
|
|
ETHTOOL_A_TUNNEL_UDP_TABLE, /* nest - _UDP_TABLE_* */
|
|
|
|
|
|
|
|
/* add new constants above here */
|
|
|
|
__ETHTOOL_A_TUNNEL_UDP_CNT,
|
|
|
|
ETHTOOL_A_TUNNEL_UDP_MAX = (__ETHTOOL_A_TUNNEL_UDP_CNT - 1)
|
|
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
|
|
ETHTOOL_A_TUNNEL_INFO_UNSPEC,
|
|
|
|
ETHTOOL_A_TUNNEL_INFO_HEADER, /* nest - _A_HEADER_* */
|
|
|
|
|
|
|
|
ETHTOOL_A_TUNNEL_INFO_UDP_PORTS, /* nest - _UDP_TABLE */
|
|
|
|
|
|
|
|
/* add new constants above here */
|
|
|
|
__ETHTOOL_A_TUNNEL_INFO_CNT,
|
|
|
|
ETHTOOL_A_TUNNEL_INFO_MAX = (__ETHTOOL_A_TUNNEL_INFO_CNT - 1)
|
|
|
|
};
|
|
|
|
|
2021-03-30 11:59:52 +08:00
|
|
|
/* FEC */
|
|
|
|
|
|
|
|
enum {
|
|
|
|
ETHTOOL_A_FEC_UNSPEC,
|
|
|
|
ETHTOOL_A_FEC_HEADER, /* nest - _A_HEADER_* */
|
|
|
|
ETHTOOL_A_FEC_MODES, /* bitset */
|
|
|
|
ETHTOOL_A_FEC_AUTO, /* u8 */
|
|
|
|
ETHTOOL_A_FEC_ACTIVE, /* u32 */
|
2021-04-16 06:53:15 +08:00
|
|
|
ETHTOOL_A_FEC_STATS, /* nest - _A_FEC_STAT */
|
2021-03-30 11:59:52 +08:00
|
|
|
|
|
|
|
__ETHTOOL_A_FEC_CNT,
|
|
|
|
ETHTOOL_A_FEC_MAX = (__ETHTOOL_A_FEC_CNT - 1)
|
|
|
|
};
|
|
|
|
|
2021-04-16 06:53:15 +08:00
|
|
|
enum {
|
|
|
|
ETHTOOL_A_FEC_STAT_UNSPEC,
|
|
|
|
ETHTOOL_A_FEC_STAT_PAD,
|
|
|
|
|
|
|
|
ETHTOOL_A_FEC_STAT_CORRECTED, /* array, u64 */
|
|
|
|
ETHTOOL_A_FEC_STAT_UNCORR, /* array, u64 */
|
|
|
|
ETHTOOL_A_FEC_STAT_CORR_BITS, /* array, u64 */
|
|
|
|
|
|
|
|
/* add new constants above here */
|
|
|
|
__ETHTOOL_A_FEC_STAT_CNT,
|
|
|
|
ETHTOOL_A_FEC_STAT_MAX = (__ETHTOOL_A_FEC_STAT_CNT - 1)
|
|
|
|
};
|
|
|
|
|
2021-04-09 16:06:34 +08:00
|
|
|
/* MODULE EEPROM */
|
|
|
|
|
|
|
|
enum {
|
|
|
|
ETHTOOL_A_MODULE_EEPROM_UNSPEC,
|
|
|
|
ETHTOOL_A_MODULE_EEPROM_HEADER, /* nest - _A_HEADER_* */
|
|
|
|
|
|
|
|
ETHTOOL_A_MODULE_EEPROM_OFFSET, /* u32 */
|
|
|
|
ETHTOOL_A_MODULE_EEPROM_LENGTH, /* u32 */
|
|
|
|
ETHTOOL_A_MODULE_EEPROM_PAGE, /* u8 */
|
|
|
|
ETHTOOL_A_MODULE_EEPROM_BANK, /* u8 */
|
|
|
|
ETHTOOL_A_MODULE_EEPROM_I2C_ADDRESS, /* u8 */
|
2021-06-22 14:50:47 +08:00
|
|
|
ETHTOOL_A_MODULE_EEPROM_DATA, /* binary */
|
2021-04-09 16:06:34 +08:00
|
|
|
|
|
|
|
__ETHTOOL_A_MODULE_EEPROM_CNT,
|
|
|
|
ETHTOOL_A_MODULE_EEPROM_MAX = (__ETHTOOL_A_MODULE_EEPROM_CNT - 1)
|
|
|
|
};
|
|
|
|
|
2021-04-17 03:27:39 +08:00
|
|
|
/* STATS */
|
|
|
|
|
|
|
|
enum {
|
|
|
|
ETHTOOL_A_STATS_UNSPEC,
|
|
|
|
ETHTOOL_A_STATS_PAD,
|
|
|
|
ETHTOOL_A_STATS_HEADER, /* nest - _A_HEADER_* */
|
|
|
|
ETHTOOL_A_STATS_GROUPS, /* bitset */
|
|
|
|
|
|
|
|
ETHTOOL_A_STATS_GRP, /* nest - _A_STATS_GRP_* */
|
|
|
|
|
|
|
|
/* add new constants above here */
|
|
|
|
__ETHTOOL_A_STATS_CNT,
|
|
|
|
ETHTOOL_A_STATS_MAX = (__ETHTOOL_A_STATS_CNT - 1)
|
|
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
|
|
ETHTOOL_STATS_ETH_PHY,
|
2021-04-17 03:27:40 +08:00
|
|
|
ETHTOOL_STATS_ETH_MAC,
|
2021-04-17 03:27:41 +08:00
|
|
|
ETHTOOL_STATS_ETH_CTRL,
|
2021-04-17 03:27:42 +08:00
|
|
|
ETHTOOL_STATS_RMON,
|
2021-04-17 03:27:39 +08:00
|
|
|
|
|
|
|
/* add new constants above here */
|
|
|
|
__ETHTOOL_STATS_CNT
|
|
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
|
|
ETHTOOL_A_STATS_GRP_UNSPEC,
|
|
|
|
ETHTOOL_A_STATS_GRP_PAD,
|
|
|
|
|
|
|
|
ETHTOOL_A_STATS_GRP_ID, /* u32 */
|
|
|
|
ETHTOOL_A_STATS_GRP_SS_ID, /* u32 */
|
|
|
|
|
|
|
|
ETHTOOL_A_STATS_GRP_STAT, /* nest */
|
|
|
|
|
2021-04-17 03:27:42 +08:00
|
|
|
ETHTOOL_A_STATS_GRP_HIST_RX, /* nest */
|
|
|
|
ETHTOOL_A_STATS_GRP_HIST_TX, /* nest */
|
|
|
|
|
|
|
|
ETHTOOL_A_STATS_GRP_HIST_BKT_LOW, /* u32 */
|
|
|
|
ETHTOOL_A_STATS_GRP_HIST_BKT_HI, /* u32 */
|
|
|
|
ETHTOOL_A_STATS_GRP_HIST_VAL, /* u64 */
|
|
|
|
|
2021-04-17 03:27:39 +08:00
|
|
|
/* add new constants above here */
|
|
|
|
__ETHTOOL_A_STATS_GRP_CNT,
|
|
|
|
ETHTOOL_A_STATS_GRP_MAX = (__ETHTOOL_A_STATS_CNT - 1)
|
|
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
|
|
/* 30.3.2.1.5 aSymbolErrorDuringCarrier */
|
|
|
|
ETHTOOL_A_STATS_ETH_PHY_5_SYM_ERR,
|
|
|
|
|
|
|
|
/* add new constants above here */
|
|
|
|
__ETHTOOL_A_STATS_ETH_PHY_CNT,
|
|
|
|
ETHTOOL_A_STATS_ETH_PHY_MAX = (__ETHTOOL_A_STATS_ETH_PHY_CNT - 1)
|
|
|
|
};
|
|
|
|
|
2021-04-17 03:27:40 +08:00
|
|
|
enum {
|
|
|
|
/* 30.3.1.1.2 aFramesTransmittedOK */
|
|
|
|
ETHTOOL_A_STATS_ETH_MAC_2_TX_PKT,
|
|
|
|
/* 30.3.1.1.3 aSingleCollisionFrames */
|
|
|
|
ETHTOOL_A_STATS_ETH_MAC_3_SINGLE_COL,
|
|
|
|
/* 30.3.1.1.4 aMultipleCollisionFrames */
|
|
|
|
ETHTOOL_A_STATS_ETH_MAC_4_MULTI_COL,
|
|
|
|
/* 30.3.1.1.5 aFramesReceivedOK */
|
|
|
|
ETHTOOL_A_STATS_ETH_MAC_5_RX_PKT,
|
|
|
|
/* 30.3.1.1.6 aFrameCheckSequenceErrors */
|
|
|
|
ETHTOOL_A_STATS_ETH_MAC_6_FCS_ERR,
|
|
|
|
/* 30.3.1.1.7 aAlignmentErrors */
|
|
|
|
ETHTOOL_A_STATS_ETH_MAC_7_ALIGN_ERR,
|
|
|
|
/* 30.3.1.1.8 aOctetsTransmittedOK */
|
|
|
|
ETHTOOL_A_STATS_ETH_MAC_8_TX_BYTES,
|
|
|
|
/* 30.3.1.1.9 aFramesWithDeferredXmissions */
|
|
|
|
ETHTOOL_A_STATS_ETH_MAC_9_TX_DEFER,
|
|
|
|
/* 30.3.1.1.10 aLateCollisions */
|
|
|
|
ETHTOOL_A_STATS_ETH_MAC_10_LATE_COL,
|
|
|
|
/* 30.3.1.1.11 aFramesAbortedDueToXSColls */
|
|
|
|
ETHTOOL_A_STATS_ETH_MAC_11_XS_COL,
|
|
|
|
/* 30.3.1.1.12 aFramesLostDueToIntMACXmitError */
|
|
|
|
ETHTOOL_A_STATS_ETH_MAC_12_TX_INT_ERR,
|
|
|
|
/* 30.3.1.1.13 aCarrierSenseErrors */
|
|
|
|
ETHTOOL_A_STATS_ETH_MAC_13_CS_ERR,
|
|
|
|
/* 30.3.1.1.14 aOctetsReceivedOK */
|
|
|
|
ETHTOOL_A_STATS_ETH_MAC_14_RX_BYTES,
|
|
|
|
/* 30.3.1.1.15 aFramesLostDueToIntMACRcvError */
|
|
|
|
ETHTOOL_A_STATS_ETH_MAC_15_RX_INT_ERR,
|
|
|
|
|
|
|
|
/* 30.3.1.1.18 aMulticastFramesXmittedOK */
|
|
|
|
ETHTOOL_A_STATS_ETH_MAC_18_TX_MCAST,
|
|
|
|
/* 30.3.1.1.19 aBroadcastFramesXmittedOK */
|
|
|
|
ETHTOOL_A_STATS_ETH_MAC_19_TX_BCAST,
|
|
|
|
/* 30.3.1.1.20 aFramesWithExcessiveDeferral */
|
|
|
|
ETHTOOL_A_STATS_ETH_MAC_20_XS_DEFER,
|
|
|
|
/* 30.3.1.1.21 aMulticastFramesReceivedOK */
|
|
|
|
ETHTOOL_A_STATS_ETH_MAC_21_RX_MCAST,
|
|
|
|
/* 30.3.1.1.22 aBroadcastFramesReceivedOK */
|
|
|
|
ETHTOOL_A_STATS_ETH_MAC_22_RX_BCAST,
|
|
|
|
/* 30.3.1.1.23 aInRangeLengthErrors */
|
|
|
|
ETHTOOL_A_STATS_ETH_MAC_23_IR_LEN_ERR,
|
|
|
|
/* 30.3.1.1.24 aOutOfRangeLengthField */
|
|
|
|
ETHTOOL_A_STATS_ETH_MAC_24_OOR_LEN,
|
|
|
|
/* 30.3.1.1.25 aFrameTooLongErrors */
|
|
|
|
ETHTOOL_A_STATS_ETH_MAC_25_TOO_LONG_ERR,
|
|
|
|
|
|
|
|
/* add new constants above here */
|
|
|
|
__ETHTOOL_A_STATS_ETH_MAC_CNT,
|
|
|
|
ETHTOOL_A_STATS_ETH_MAC_MAX = (__ETHTOOL_A_STATS_ETH_MAC_CNT - 1)
|
|
|
|
};
|
|
|
|
|
2021-04-17 03:27:41 +08:00
|
|
|
enum {
|
|
|
|
/* 30.3.3.3 aMACControlFramesTransmitted */
|
|
|
|
ETHTOOL_A_STATS_ETH_CTRL_3_TX,
|
|
|
|
/* 30.3.3.4 aMACControlFramesReceived */
|
|
|
|
ETHTOOL_A_STATS_ETH_CTRL_4_RX,
|
|
|
|
/* 30.3.3.5 aUnsupportedOpcodesReceived */
|
|
|
|
ETHTOOL_A_STATS_ETH_CTRL_5_RX_UNSUP,
|
|
|
|
|
|
|
|
/* add new constants above here */
|
|
|
|
__ETHTOOL_A_STATS_ETH_CTRL_CNT,
|
|
|
|
ETHTOOL_A_STATS_ETH_CTRL_MAX = (__ETHTOOL_A_STATS_ETH_CTRL_CNT - 1)
|
|
|
|
};
|
|
|
|
|
2021-04-17 03:27:42 +08:00
|
|
|
enum {
|
|
|
|
/* etherStatsUndersizePkts */
|
|
|
|
ETHTOOL_A_STATS_RMON_UNDERSIZE,
|
|
|
|
/* etherStatsOversizePkts */
|
|
|
|
ETHTOOL_A_STATS_RMON_OVERSIZE,
|
|
|
|
/* etherStatsFragments */
|
|
|
|
ETHTOOL_A_STATS_RMON_FRAG,
|
|
|
|
/* etherStatsJabbers */
|
|
|
|
ETHTOOL_A_STATS_RMON_JABBER,
|
|
|
|
|
|
|
|
/* add new constants above here */
|
|
|
|
__ETHTOOL_A_STATS_RMON_CNT,
|
|
|
|
ETHTOOL_A_STATS_RMON_MAX = (__ETHTOOL_A_STATS_RMON_CNT - 1)
|
|
|
|
};
|
|
|
|
|
ethtool: Add ability to control transceiver modules' power mode
Add a pair of new ethtool messages, 'ETHTOOL_MSG_MODULE_SET' and
'ETHTOOL_MSG_MODULE_GET', that can be used to control transceiver
modules parameters and retrieve their status.
The first parameter to control is the power mode of the module. It is
only relevant for paged memory modules, as flat memory modules always
operate in low power mode.
When a paged memory module is in low power mode, its power consumption
is reduced to the minimum, the management interface towards the host is
available and the data path is deactivated.
User space can choose to put modules that are not currently in use in
low power mode and transition them to high power mode before putting the
associated ports administratively up. This is useful for user space that
favors reduced power consumption and lower temperatures over reduced
link up times. In QSFP-DD modules the transition from low power mode to
high power mode can take a few seconds and this transition is only
expected to get longer with future / more complex modules.
User space can control the power mode of the module via the power mode
policy attribute ('ETHTOOL_A_MODULE_POWER_MODE_POLICY'). Possible
values:
* high: Module is always in high power mode.
* auto: Module is transitioned by the host to high power mode when the
first port using it is put administratively up and to low power mode
when the last port using it is put administratively down.
The operational power mode of the module is available to user space via
the 'ETHTOOL_A_MODULE_POWER_MODE' attribute. The attribute is not
reported to user space when a module is not plugged-in.
The user API is designed to be generic enough so that it could be used
for modules with different memory maps (e.g., SFF-8636, CMIS).
The only implementation of the device driver API in this series is for a
MAC driver (mlxsw) where the module is controlled by the device's
firmware, but it is designed to be generic enough so that it could also
be used by implementations where the module is controlled by the CPU.
CMIS testing
============
# ethtool -m swp11
Identifier : 0x18 (QSFP-DD Double Density 8X Pluggable Transceiver (INF-8628))
...
Module State : 0x03 (ModuleReady)
LowPwrAllowRequestHW : Off
LowPwrRequestSW : Off
The module is not in low power mode, as it is not forced by hardware
(LowPwrAllowRequestHW is off) or by software (LowPwrRequestSW is off).
The power mode can be queried from the kernel. In case
LowPwrAllowRequestHW was on, the kernel would need to take into account
the state of the LowPwrRequestHW signal, which is not visible to user
space.
$ ethtool --show-module swp11
Module parameters for swp11:
power-mode-policy high
power-mode high
Change the power mode policy to 'auto':
# ethtool --set-module swp11 power-mode-policy auto
Query the power mode again:
$ ethtool --show-module swp11
Module parameters for swp11:
power-mode-policy auto
power-mode low
Verify with the data read from the EEPROM:
# ethtool -m swp11
Identifier : 0x18 (QSFP-DD Double Density 8X Pluggable Transceiver (INF-8628))
...
Module State : 0x01 (ModuleLowPwr)
LowPwrAllowRequestHW : Off
LowPwrRequestSW : On
Put the associated port administratively up which will instruct the host
to transition the module to high power mode:
# ip link set dev swp11 up
Query the power mode again:
$ ethtool --show-module swp11
Module parameters for swp11:
power-mode-policy auto
power-mode high
Verify with the data read from the EEPROM:
# ethtool -m swp11
Identifier : 0x18 (QSFP-DD Double Density 8X Pluggable Transceiver (INF-8628))
...
Module State : 0x03 (ModuleReady)
LowPwrAllowRequestHW : Off
LowPwrRequestSW : Off
Put the associated port administratively down which will instruct the
host to transition the module to low power mode:
# ip link set dev swp11 down
Query the power mode again:
$ ethtool --show-module swp11
Module parameters for swp11:
power-mode-policy auto
power-mode low
Verify with the data read from the EEPROM:
# ethtool -m swp11
Identifier : 0x18 (QSFP-DD Double Density 8X Pluggable Transceiver (INF-8628))
...
Module State : 0x01 (ModuleLowPwr)
LowPwrAllowRequestHW : Off
LowPwrRequestSW : On
SFF-8636 testing
================
# ethtool -m swp13
Identifier : 0x11 (QSFP28)
...
Extended identifier description : 5.0W max. Power consumption, High Power Class (> 3.5 W) enabled
Power set : Off
Power override : On
...
Transmit avg optical power (Channel 1) : 0.7733 mW / -1.12 dBm
Transmit avg optical power (Channel 2) : 0.7649 mW / -1.16 dBm
Transmit avg optical power (Channel 3) : 0.7790 mW / -1.08 dBm
Transmit avg optical power (Channel 4) : 0.7837 mW / -1.06 dBm
Rcvr signal avg optical power(Channel 1) : 0.9302 mW / -0.31 dBm
Rcvr signal avg optical power(Channel 2) : 0.9079 mW / -0.42 dBm
Rcvr signal avg optical power(Channel 3) : 0.8993 mW / -0.46 dBm
Rcvr signal avg optical power(Channel 4) : 0.8778 mW / -0.57 dBm
The module is not in low power mode, as it is not forced by hardware
(Power override is on) or by software (Power set is off).
The power mode can be queried from the kernel. In case Power override
was off, the kernel would need to take into account the state of the
LPMode signal, which is not visible to user space.
$ ethtool --show-module swp13
Module parameters for swp13:
power-mode-policy high
power-mode high
Change the power mode policy to 'auto':
# ethtool --set-module swp13 power-mode-policy auto
Query the power mode again:
$ ethtool --show-module swp13
Module parameters for swp13:
power-mode-policy auto
power-mode low
Verify with the data read from the EEPROM:
# ethtool -m swp13
Identifier : 0x11 (QSFP28)
Extended identifier description : 5.0W max. Power consumption, High Power Class (> 3.5 W) not enabled
Power set : On
Power override : On
...
Transmit avg optical power (Channel 1) : 0.0000 mW / -inf dBm
Transmit avg optical power (Channel 2) : 0.0000 mW / -inf dBm
Transmit avg optical power (Channel 3) : 0.0000 mW / -inf dBm
Transmit avg optical power (Channel 4) : 0.0000 mW / -inf dBm
Rcvr signal avg optical power(Channel 1) : 0.0000 mW / -inf dBm
Rcvr signal avg optical power(Channel 2) : 0.0000 mW / -inf dBm
Rcvr signal avg optical power(Channel 3) : 0.0000 mW / -inf dBm
Rcvr signal avg optical power(Channel 4) : 0.0000 mW / -inf dBm
Put the associated port administratively up which will instruct the host
to transition the module to high power mode:
# ip link set dev swp13 up
Query the power mode again:
$ ethtool --show-module swp13
Module parameters for swp13:
power-mode-policy auto
power-mode high
Verify with the data read from the EEPROM:
# ethtool -m swp13
Identifier : 0x11 (QSFP28)
...
Extended identifier description : 5.0W max. Power consumption, High Power Class (> 3.5 W) enabled
Power set : Off
Power override : On
...
Transmit avg optical power (Channel 1) : 0.7934 mW / -1.01 dBm
Transmit avg optical power (Channel 2) : 0.7859 mW / -1.05 dBm
Transmit avg optical power (Channel 3) : 0.7885 mW / -1.03 dBm
Transmit avg optical power (Channel 4) : 0.7985 mW / -0.98 dBm
Rcvr signal avg optical power(Channel 1) : 0.9325 mW / -0.30 dBm
Rcvr signal avg optical power(Channel 2) : 0.9034 mW / -0.44 dBm
Rcvr signal avg optical power(Channel 3) : 0.9086 mW / -0.42 dBm
Rcvr signal avg optical power(Channel 4) : 0.8885 mW / -0.51 dBm
Put the associated port administratively down which will instruct the
host to transition the module to low power mode:
# ip link set dev swp13 down
Query the power mode again:
$ ethtool --show-module swp13
Module parameters for swp13:
power-mode-policy auto
power-mode low
Verify with the data read from the EEPROM:
# ethtool -m swp13
Identifier : 0x11 (QSFP28)
...
Extended identifier description : 5.0W max. Power consumption, High Power Class (> 3.5 W) not enabled
Power set : On
Power override : On
...
Transmit avg optical power (Channel 1) : 0.0000 mW / -inf dBm
Transmit avg optical power (Channel 2) : 0.0000 mW / -inf dBm
Transmit avg optical power (Channel 3) : 0.0000 mW / -inf dBm
Transmit avg optical power (Channel 4) : 0.0000 mW / -inf dBm
Rcvr signal avg optical power(Channel 1) : 0.0000 mW / -inf dBm
Rcvr signal avg optical power(Channel 2) : 0.0000 mW / -inf dBm
Rcvr signal avg optical power(Channel 3) : 0.0000 mW / -inf dBm
Rcvr signal avg optical power(Channel 4) : 0.0000 mW / -inf dBm
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2021-10-06 18:46:42 +08:00
|
|
|
/* MODULE */
|
|
|
|
|
|
|
|
enum {
|
|
|
|
ETHTOOL_A_MODULE_UNSPEC,
|
|
|
|
ETHTOOL_A_MODULE_HEADER, /* nest - _A_HEADER_* */
|
|
|
|
ETHTOOL_A_MODULE_POWER_MODE_POLICY, /* u8 */
|
|
|
|
ETHTOOL_A_MODULE_POWER_MODE, /* u8 */
|
|
|
|
|
|
|
|
/* add new constants above here */
|
|
|
|
__ETHTOOL_A_MODULE_CNT,
|
|
|
|
ETHTOOL_A_MODULE_MAX = (__ETHTOOL_A_MODULE_CNT - 1)
|
|
|
|
};
|
|
|
|
|
2022-10-03 14:52:00 +08:00
|
|
|
/* Power Sourcing Equipment */
|
|
|
|
enum {
|
|
|
|
ETHTOOL_A_PSE_UNSPEC,
|
|
|
|
ETHTOOL_A_PSE_HEADER, /* nest - _A_HEADER_* */
|
|
|
|
ETHTOOL_A_PODL_PSE_ADMIN_STATE, /* u32 */
|
|
|
|
ETHTOOL_A_PODL_PSE_ADMIN_CONTROL, /* u32 */
|
|
|
|
ETHTOOL_A_PODL_PSE_PW_D_STATUS, /* u32 */
|
|
|
|
|
|
|
|
/* add new constants above here */
|
|
|
|
__ETHTOOL_A_PSE_CNT,
|
|
|
|
ETHTOOL_A_PSE_MAX = (__ETHTOOL_A_PSE_CNT - 1)
|
|
|
|
};
|
|
|
|
|
2022-12-02 08:25:55 +08:00
|
|
|
enum {
|
|
|
|
ETHTOOL_A_RSS_UNSPEC,
|
|
|
|
ETHTOOL_A_RSS_HEADER,
|
|
|
|
ETHTOOL_A_RSS_CONTEXT, /* u32 */
|
|
|
|
ETHTOOL_A_RSS_HFUNC, /* u32 */
|
|
|
|
ETHTOOL_A_RSS_INDIR, /* binary */
|
|
|
|
ETHTOOL_A_RSS_HKEY, /* binary */
|
|
|
|
|
|
|
|
__ETHTOOL_A_RSS_CNT,
|
|
|
|
ETHTOOL_A_RSS_MAX = (__ETHTOOL_A_RSS_CNT - 1),
|
|
|
|
};
|
|
|
|
|
2023-01-10 00:59:39 +08:00
|
|
|
/* PLCA */
|
|
|
|
|
|
|
|
enum {
|
|
|
|
ETHTOOL_A_PLCA_UNSPEC,
|
|
|
|
ETHTOOL_A_PLCA_HEADER, /* nest - _A_HEADER_* */
|
|
|
|
ETHTOOL_A_PLCA_VERSION, /* u16 */
|
|
|
|
ETHTOOL_A_PLCA_ENABLED, /* u8 */
|
|
|
|
ETHTOOL_A_PLCA_STATUS, /* u8 */
|
|
|
|
ETHTOOL_A_PLCA_NODE_CNT, /* u32 */
|
|
|
|
ETHTOOL_A_PLCA_NODE_ID, /* u32 */
|
|
|
|
ETHTOOL_A_PLCA_TO_TMR, /* u32 */
|
|
|
|
ETHTOOL_A_PLCA_BURST_CNT, /* u32 */
|
|
|
|
ETHTOOL_A_PLCA_BURST_TMR, /* u32 */
|
|
|
|
|
|
|
|
/* add new constants above here */
|
|
|
|
__ETHTOOL_A_PLCA_CNT,
|
|
|
|
ETHTOOL_A_PLCA_MAX = (__ETHTOOL_A_PLCA_CNT - 1)
|
|
|
|
};
|
|
|
|
|
net: ethtool: add support for MAC Merge layer
The MAC merge sublayer (IEEE 802.3-2018 clause 99) is one of 2
specifications (the other being Frame Preemption; IEEE 802.1Q-2018
clause 6.7.2), which work together to minimize latency caused by frame
interference at TX. The overall goal of TSN is for normal traffic and
traffic with a bounded deadline to be able to cohabitate on the same L2
network and not bother each other too much.
The standards achieve this (partly) by introducing the concept of
preemptible traffic, i.e. Ethernet frames that have a custom value for
the Start-of-Frame-Delimiter (SFD), and these frames can be fragmented
and reassembled at L2 on a link-local basis. The non-preemptible frames
are called express traffic, they are transmitted using a normal SFD, and
they can preempt preemptible frames, therefore having lower latency,
which can matter at lower (100 Mbps) link speeds, or at high MTUs (jumbo
frames around 9K). Preemption is not recursive, i.e. a P frame cannot
preempt another P frame. Preemption also does not depend upon priority,
or otherwise said, an E frame with prio 0 will still preempt a P frame
with prio 7.
In terms of implementation, the standards talk about the presence of an
express MAC (eMAC) which handles express traffic, and a preemptible MAC
(pMAC) which handles preemptible traffic, and these MACs are multiplexed
on the same MII by a MAC merge layer.
To support frame preemption, the definition of the SFD was generalized
to SMD (Start-of-mPacket-Delimiter), where an mPacket is essentially an
Ethernet frame fragment, or a complete frame. Stations unaware of an SMD
value different from the standard SFD will treat P frames as error
frames. To prevent that from happening, a negotiation process is
defined.
On RX, packets are dispatched to the eMAC or pMAC after being filtered
by their SMD. On TX, the eMAC/pMAC classification decision is taken by
the 802.1Q spec, based on packet priority (each of the 8 user priority
values may have an admin-status of preemptible or express).
The MAC Merge layer and the Frame Preemption parameters have some degree
of independence in terms of how software stacks are supposed to deal
with them. The activation of the MM layer is supposed to be controlled
by an LLDP daemon (after it has been communicated that the link partner
also supports it), after which a (hardware-based or not) verification
handshake takes place, before actually enabling the feature. So the
process is intended to be relatively plug-and-play. Whereas FP settings
are supposed to be coordinated across a network using something
approximating NETCONF.
The support contained here is exclusively for the 802.3 (MAC Merge)
portions and not for the 802.1Q (Frame Preemption) parts. This API is
sufficient for an LLDP daemon to do its job. The FP adminStatus variable
from 802.1Q is outside the scope of an LLDP daemon.
I have taken a few creative licenses and augmented the Linux kernel UAPI
compared to the standard managed objects recommended by IEEE 802.3.
These are:
- ETHTOOL_A_MM_PMAC_ENABLED: According to Figure 99-6: Receive
Processing state diagram, a MAC Merge layer is always supposed to be
able to receive P frames. However, this implies keeping the pMAC
powered on, which will consume needless power in applications where FP
will never be used. If LLDP is used, the reception of an Additional
Ethernet Capabilities TLV from the link partner is sufficient
indication that the pMAC should be enabled. So my proposal is that in
Linux, we keep the pMAC turned off by default and that user space
turns it on when needed.
- ETHTOOL_A_MM_VERIFY_ENABLED: The IEEE managed object is called
aMACMergeVerifyDisableTx. I opted for consistency (positive logic) in
the boolean netlink attributes offered, so this is also positive here.
Other than the meaning being reversed, they correspond to the same
thing.
- ETHTOOL_A_MM_MAX_VERIFY_TIME: I found it most reasonable for a LLDP
daemon to maximize the verifyTime variable (delay between SMD-V
transmissions), to maximize its chances that the LP replies. IEEE says
that the verifyTime can range between 1 and 128 ms, but the NXP ENETC
stupidly keeps this variable in a 7 bit register, so the maximum
supported value is 127 ms. I could have chosen to hardcode this in the
LLDP daemon to a lower value, but why not let the kernel expose its
supported range directly.
- ETHTOOL_A_MM_TX_MIN_FRAG_SIZE: the standard managed object is called
aMACMergeAddFragSize, and expresses the "additional" fragment size
(on top of ETH_ZLEN), whereas this expresses the absolute value of the
fragment size.
- ETHTOOL_A_MM_RX_MIN_FRAG_SIZE: there doesn't appear to exist a managed
object mandated by the standard, but user space clearly needs to know
what is the minimum supported fragment size of our local receiver,
since LLDP must advertise a value no lower than that.
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2023-01-19 20:26:54 +08:00
|
|
|
/* MAC Merge (802.3) */
|
|
|
|
|
|
|
|
enum {
|
|
|
|
ETHTOOL_A_MM_STAT_UNSPEC,
|
|
|
|
ETHTOOL_A_MM_STAT_PAD,
|
|
|
|
|
|
|
|
/* aMACMergeFrameAssErrorCount */
|
|
|
|
ETHTOOL_A_MM_STAT_REASSEMBLY_ERRORS, /* u64 */
|
|
|
|
/* aMACMergeFrameSmdErrorCount */
|
|
|
|
ETHTOOL_A_MM_STAT_SMD_ERRORS, /* u64 */
|
|
|
|
/* aMACMergeFrameAssOkCount */
|
|
|
|
ETHTOOL_A_MM_STAT_REASSEMBLY_OK, /* u64 */
|
|
|
|
/* aMACMergeFragCountRx */
|
|
|
|
ETHTOOL_A_MM_STAT_RX_FRAG_COUNT, /* u64 */
|
|
|
|
/* aMACMergeFragCountTx */
|
|
|
|
ETHTOOL_A_MM_STAT_TX_FRAG_COUNT, /* u64 */
|
|
|
|
/* aMACMergeHoldCount */
|
|
|
|
ETHTOOL_A_MM_STAT_HOLD_COUNT, /* u64 */
|
|
|
|
|
|
|
|
/* add new constants above here */
|
|
|
|
__ETHTOOL_A_MM_STAT_CNT,
|
|
|
|
ETHTOOL_A_MM_STAT_MAX = (__ETHTOOL_A_MM_STAT_CNT - 1)
|
|
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
|
|
ETHTOOL_A_MM_UNSPEC,
|
|
|
|
ETHTOOL_A_MM_HEADER, /* nest - _A_HEADER_* */
|
|
|
|
ETHTOOL_A_MM_PMAC_ENABLED, /* u8 */
|
|
|
|
ETHTOOL_A_MM_TX_ENABLED, /* u8 */
|
|
|
|
ETHTOOL_A_MM_TX_ACTIVE, /* u8 */
|
|
|
|
ETHTOOL_A_MM_TX_MIN_FRAG_SIZE, /* u32 */
|
|
|
|
ETHTOOL_A_MM_RX_MIN_FRAG_SIZE, /* u32 */
|
|
|
|
ETHTOOL_A_MM_VERIFY_ENABLED, /* u8 */
|
|
|
|
ETHTOOL_A_MM_VERIFY_STATUS, /* u8 */
|
|
|
|
ETHTOOL_A_MM_VERIFY_TIME, /* u32 */
|
|
|
|
ETHTOOL_A_MM_MAX_VERIFY_TIME, /* u32 */
|
|
|
|
ETHTOOL_A_MM_STATS, /* nest - _A_MM_STAT_* */
|
|
|
|
|
|
|
|
/* add new constants above here */
|
|
|
|
__ETHTOOL_A_MM_CNT,
|
|
|
|
ETHTOOL_A_MM_MAX = (__ETHTOOL_A_MM_CNT - 1)
|
|
|
|
};
|
|
|
|
|
2019-12-27 22:55:18 +08:00
|
|
|
/* generic netlink info */
|
|
|
|
#define ETHTOOL_GENL_NAME "ethtool"
|
|
|
|
#define ETHTOOL_GENL_VERSION 1
|
|
|
|
|
2019-12-27 22:55:33 +08:00
|
|
|
#define ETHTOOL_MCGRP_MONITOR_NAME "monitor"
|
|
|
|
|
2019-12-27 22:55:18 +08:00
|
|
|
#endif /* _UAPI_LINUX_ETHTOOL_NETLINK_H_ */
|