Bug 1895361

Summary: ethtool: Add support for extended link state reporting
Product: Red Hat Enterprise Linux 8 Reporter: Ivan Vecera <ivecera>
Component: ethtoolAssignee: Ivan Vecera <ivecera>
Status: CLOSED ERRATA QA Contact: Tianhao <tizhao>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.4CC: hwkernel-mgr, liali, linville, mschmidt, tizhao
Target Milestone: rc   
Target Release: 8.4   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-05-18 13:35:02 UTC Type: Enhancement
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1878826    
Bug Blocks:    

Description Ivan Vecera 2020-11-06 13:24:59 UTC
Description of problem:
Bug#1894545 added support for extended link state reporting to kernel and allow NIC drivers to report a reason why a link is down. This BZ adds the same but on ethtool userspace side.

How reproducible:
Run 'ethtool <interface>' on interface handled by a driver that supports extended link state reporting (mlxsw driver currently)

Steps to Reproduce:
1. Run the ethtool command
2. Check result

Let's say we have one interface with no cable connected and the second one with cable but counterpart interface is down.

Actual results:
# ethtool enp6s0np32 | grep 'Link detected'
        Link detected: no
# ethtool enp6s0np17 | grep 'Link detected'
        Link detected: no

Expected results:
# ethtool enp6s0np32 | grep 'Link detected'
        Link detected: no (No cable)
# ethtool enp6s0np17 | grep 'Link detected'
        Link detected: no (Autoneg, No partner detected)

Comment 5 Tianhao 2020-11-26 06:22:50 UTC
Hi Ivan,

Can you please borrow me the access to testing HW as said in comment #1?

Thanks in advance.
Regards,
Tianhao

Comment 13 Tianhao 2020-12-01 03:07:18 UTC
Verified on the test HW provided by Ivan.

[root@mlxsw-2 ~]# uname -r
4.18.0-249.el8.mlxsw.x86_64
[root@mlxsw-2 ~]# ethtool enp3s0np32 | grep "Link detected"
	Link detected: no (No cable)

[root@mlxsw-2 ~]# ethtool enp3s0np17 | grep "Link detected"
	Link detected: yes
[root@mlxsw-2 ~]# ethtool enp3s0np18 | grep "Link detected"
	Link detected: yes
[root@mlxsw-2 ~]# ip link show enp3s0np17
5: enp3s0np17: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
    link/ether 7c:fe:90:f5:35:c1 brd ff:ff:ff:ff:ff:ff
[root@mlxsw-2 ~]# ip link show enp3s0np18
6: enp3s0np18: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
    link/ether 7c:fe:90:f5:35:c3 brd ff:ff:ff:ff:ff:ff
[root@mlxsw-2 ~]# ip link set enp3s0np17 down
[root@mlxsw-2 ~]# ethtool enp3s0np18 | grep "Link detected"
	Link detected: no (Autoneg, No partner detected)
[root@mlxsw-2 ~]# ethtool enp3s0np17 | grep "Link detected"
	Link detected: no
[root@mlxsw-2 ~]# ip link show enp3s0np17
5: enp3s0np17: <BROADCAST,MULTICAST> mtu 1500 qdisc fq_codel state DOWN mode DEFAULT group default qlen 1000
    link/ether 7c:fe:90:f5:35:c1 brd ff:ff:ff:ff:ff:ff
[root@mlxsw-2 ~]# ip link show enp3s0np18
6: enp3s0np18: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN mode DEFAULT group default qlen 1000
    link/ether 7c:fe:90:f5:35:c3 brd ff:ff:ff:ff:ff:ff

Comment 15 errata-xmlrpc 2021-05-18 13:35:02 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (ethtool bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2021:1576