Bug 1895393

Summary: ethtool: not all supported link modes are advertised when only autoneg on is specified
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, tizhao
Target Milestone: rcKeywords: Regression
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: Bug
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 14:54:06 UTC
Description of problem:
With older ethtool version (<5.8) that is based on ioctl interface the advertised link modes are set to the supported link modes when only autoneg on is set without specifying speed, duplex or link modes.
This is not true for newer ethtool (>=v5.8) that just enable auto-negotiation but leaves advertised link modes untouched.

Version-Release number of selected component (if applicable):
ethtool-5.8-3.el8

How reproducible:
100% with mlxsw driver

Steps to Reproduce:
1. Enable auto-negotiation but limit advertised link modes
2. Check link status
3. Enable auto-negotiation (no limitation)
4. Check link status

Actual results:

1. Enable autoneg and limit advertised link modes to 10Gbit
[root@mlxsw-1 ~]# ethtool -s enp6s0np17 autoneg on speed 10000

2. Verify
[root@mlxsw-1 ~]# ethtool enp6s0np17
Settings for enp6s0np17:
...
        Advertised link modes:  10000baseT/Full
                                10000baseKR/Full
                                10000baseR_FEC
                                10000baseCR/Full
                                10000baseSR/Full
                                10000baseLR/Full
                                10000baseER/Full
...

3. Enable autoneg without any limit
[root@mlxsw-1 ~]# ethtool -s enp6s0np17 autoneg on

4. Verify:
[root@mlxsw-1 ~]# ethtool enp6s0np17
Settings for enp6s0np17:
...
        Advertised link modes:  10000baseT/Full
                                10000baseKR/Full
                                10000baseR_FEC
                                10000baseCR/Full
                                10000baseSR/Full
                                10000baseLR/Full
                                10000baseER/Full
...
Advertised link-modes are still limited ^^^^^^^^


Expected results:
1. Enable autoneg and limit advertised link modes to 10Gbit
[root@mlxsw-1 ~]# ethtool -s enp6s0np17 autoneg on speed 10000

2. Verify
[root@mlxsw-1 ~]# ethtool enp6s0np17
Settings for enp6s0np17:
...
        Advertised link modes:  10000baseT/Full
                                10000baseKR/Full
                                10000baseR_FEC
                                10000baseCR/Full
                                10000baseSR/Full
                                10000baseLR/Full
                                10000baseER/Full
...

3. Enable autoneg without any limit
[root@mlxsw-1 ~]# ethtool -s enp6s0np17 autoneg on

4. Verify:
[root@mlxsw-1 ~]# ethtool enp6s0np17
Settings for enp6s0np17:
...
        Advertised 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
...

All possible link modes are reported ^^^^^^^

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

Could you also prepare the test HW for me as in comment #1 to verify the bug?

Thanks in advance.
Regards,
Tianhao

Comment 8 Tianhao 2020-11-27 01:35:32 UTC
Set verified based on comment #6 and comment #7.

Comment 10 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