OpenCloudOS-Kernel/net/ethtool
Danielle Ratson 6e68dd0e8d ethtool: Expose the number of lanes in use
Currently, ethtool does not expose how many lanes are used when the
link is up.

After adding a possibility to advertise or force a specific number of
lanes, the lanes in use value can be either the maximum width of the port
or below.

Extend ethtool to expose the number of lanes currently in use for
drivers that support it.

For example:

$ ethtool -s swp1 speed 100000 lanes 4
$ ethtool -s swp2 speed 100000 lanes 4
$ ip link set swp1 up
$ ip link set swp2 up
$ ethtool swp1
Settings for swp1:
        Supported ports: [ FIBRE         Backplane ]
        Supported link modes:   1000baseT/Full
                                10000baseT/Full
                                1000baseKX/Full
                                10000baseKR/Full
                                10000baseR_FEC
                                40000baseKR4/Full
                                40000baseCR4/Full
                                40000baseSR4/Full
                                40000baseLR4/Full
                                25000baseCR/Full
                                25000baseKR/Full
                                25000baseSR/Full
                                50000baseCR2/Full
                                50000baseKR2/Full
                                100000baseKR4/Full
                                100000baseSR4/Full
                                100000baseCR4/Full
                                100000baseLR4_ER4/Full
                                50000baseSR2/Full
                                10000baseCR/Full
                                10000baseSR/Full
                                10000baseLR/Full
                                10000baseER/Full
                                50000baseKR/Full
                                50000baseSR/Full
                                50000baseCR/Full
                                50000baseLR_ER_FR/Full
                                50000baseDR/Full
                                100000baseKR2/Full
                                100000baseSR2/Full
                                100000baseCR2/Full
                                100000baseLR2_ER2_FR2/Full
                                100000baseDR2/Full
                                200000baseKR4/Full
                                200000baseSR4/Full
                                200000baseLR4_ER4_FR4/Full
                                200000baseDR4/Full
                                200000baseCR4/Full
        Supported pause frame use: Symmetric Receive-only
        Supports auto-negotiation: Yes
        Supported FEC modes: Not reported
        Advertised link modes:  1000baseT/Full
                                10000baseT/Full
                                1000baseKX/Full
                                1000baseKX/Full
                                10000baseKR/Full
                                10000baseR_FEC
                                40000baseKR4/Full
                                40000baseCR4/Full
                                40000baseSR4/Full
                                40000baseLR4/Full
                                25000baseCR/Full
                                25000baseKR/Full
                                25000baseSR/Full
                                50000baseCR2/Full
                                50000baseKR2/Full
                                100000baseKR4/Full
                                100000baseSR4/Full
                                100000baseCR4/Full
                                100000baseLR4_ER4/Full
                                50000baseSR2/Full
                                10000baseCR/Full
                                10000baseSR/Full
                                10000baseLR/Full
                                10000baseER/Full
                                200000baseKR4/Full
                                200000baseSR4/Full
                                200000baseLR4_ER4_FR4/Full
                                200000baseDR4/Full
                                200000baseCR4/Full
        Advertised pause frame use: No
        Advertised auto-negotiation: Yes
        Advertised FEC modes: Not reported
        Advertised link modes:  100000baseKR4/Full
                                100000baseSR4/Full
                                100000baseCR4/Full
                                100000baseLR4_ER4/Full
	Advertised pause frame use: No
	Advertised auto-negotiation: Yes
	Advertised FEC modes: Not reported
	Speed: 100000Mb/s
	Lanes: 4
	Duplex: Full
	Auto-negotiation: on
	Port: Direct Attach Copper
	PHYAD: 0
	Transceiver: internal
	Link detected: yes

Signed-off-by: Danielle Ratson <danieller@nvidia.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: hongrongxuan <hongrongxuan@huawei.com>
2024-06-12 16:56:49 +08:00
..
Makefile ethtool: provide timestamping information with TSINFO_GET request 2024-06-12 13:17:27 +08:00
bitset.c ethtool: fix stack overflow in ethnl_parse_bitset() 2024-06-12 13:17:35 +08:00
bitset.h ethtool: add ethnl_parse_bitset() helper 2024-06-12 13:17:17 +08:00
channels.c ethtool: check if there is at least one channel for TX/RX in the core 2024-06-12 13:17:28 +08:00
coalesce.c ethtool: extend coalesce setting uAPI with CQE mode 2024-06-12 13:17:42 +08:00
common.c ethtool: Get link mode in use instead of speed and duplex parameters 2024-06-12 16:56:36 +08:00
common.h ethtool: Get link mode in use instead of speed and duplex parameters 2024-06-12 16:56:36 +08:00
debug.c ethtool: fix reference leak in some *_SET handlers 2024-06-12 13:17:22 +08:00
eee.c ethtool: add EEE_NTF notification 2024-06-12 13:17:26 +08:00
features.c ethtool: add FEATURES_NTF notification 2024-06-12 13:17:18 +08:00
ioctl.c ethtool: Get link mode in use instead of speed and duplex parameters 2024-06-12 16:56:36 +08:00
linkinfo.c ethtool: linkinfo: remove an unnecessary NULL check 2024-06-12 13:17:30 +08:00
linkmodes.c ethtool: Expose the number of lanes in use 2024-06-12 16:56:49 +08:00
linkstate.c ethtool: Add link extended state 2024-06-12 13:17:32 +08:00
netlink.c ethtool: add a stricter length check 2024-06-12 13:17:40 +08:00
netlink.h ethtool: do not perform operations on net devices being unregistered 2024-06-12 13:17:43 +08:00
pause.c ethtool: add standard pause stats 2024-06-12 13:17:33 +08:00
privflags.c ethtool: fix reference leak in ethnl_set_privflags() 2024-06-12 13:17:23 +08:00
rings.c net: ethtool: move checks before rtnl_lock() in ethnl_set_rings 2024-06-12 13:17:46 +08:00
strset.c ethtool: strset: fix message length calculation 2024-06-12 13:17:40 +08:00
tsinfo.c ethtool: provide timestamping information with TSINFO_GET request 2024-06-12 13:17:27 +08:00
wol.c ethtool: fix reference leak in some *_SET handlers 2024-06-12 13:17:22 +08:00