Page MenuHomeVyOS Platform

Interface speed & duplex modes are hardcoded to anything BaseT
Open, LowPublic

Description

I finally got around to test the change I proposed in task T8914 and I noticed that I couldn't set speed and duplex on an interface on that NIC via the configuration although the interface supports it when checked with ethtool <interface>:

vyos@vyos# ethtool eth2
Settings for eth2:
        Supported ports: [ FIBRE ]
        Supported link modes:   1000baseT/Full
                                2500baseX/Full
        Supported pause frame use: Symmetric Receive-only
        Supports auto-negotiation: No
        Supported FEC modes: Not reported
        Advertised link modes:  2500baseX/Full
        Advertised pause frame use: No
        Advertised auto-negotiation: No
        Advertised FEC modes: Not reported
        Speed: Unknown!
        Duplex: Unknown! (255)
        Auto-negotiation: off
        Port: FIBRE
        PHYAD: 1
        Transceiver: internal
        Supports Wake-on: d
        Wake-on: d
        Current message level: 0x00000000 (0)

        Link detected: no

vyos@vyos# set interfaces ethernet eth2 duplex full
[edit]
vyos@vyos# set interfaces ethernet eth2 speed 2500
[edit]
vyos@vyos# commit
[ interfaces ethernet eth2 ]
Adapter does not support changing speed and duplex settings to:
2500/full!
[[interfaces ethernet eth2]] failed
Commit failed
[edit]

This is due to vyos-1x/python/vyos/ethtool.py in line 221 only matching {speed}baset/{duplex} from the ethtool output.

Applying the settings manually with ethool -s eth2 speed 2500 duplex full works perfectly fine. The interface is set to advertise 2500BaseX/Full only in the NIC firmware to force the plugged GPON SFP into that mode.

Changing the line to allow {speed}basex/{duplex} as well results in the config being committed and the settings applied to the interface:

vyos@vyos# set interfaces ethernet eth2 duplex full
[edit]
vyos@vyos# set interfaces ethernet eth2 speed 2500
[edit]
vyos@vyos# commit
[ interfaces ethernet eth2 ]

WARNING: changing auto-negotiation setting on "eth2" is unsupported!

vyos@vyos# ethtool eth2
Settings for eth1:
        Supported ports: [ FIBRE ]
        Supported link modes:   1000baseT/Full
                                2500baseX/Full
        Supported pause frame use: Symmetric Receive-only
        Supports auto-negotiation: No
        Supported FEC modes: Not reported
        Advertised link modes:  2500baseX/Full
        Advertised pause frame use: No
        Advertised auto-negotiation: No
        Advertised FEC modes: Not reported
        Speed: 2500Mb/s
        Duplex: Full
        Auto-negotiation: off
        Port: FIBRE
        PHYAD: 1
        Transceiver: internal
        Supports Wake-on: d
        Wake-on: d
        Current message level: 0x00000000 (0)

        Link detected: yes
[edit]
vyos@vyos# speedtest

   Speedtest by Ookla

      Server: WOBCOM GmbH - Wolfsburg (id: 53128)
         ISP: htp
Idle Latency:     2.49 ms   (jitter: 0.15ms, low: 2.26ms, high: 2.61ms)
    Download:  2241.91 Mbps (data used: 1.1 GB)
                  8.63 ms   (jitter: 27.81ms, low: 3.12ms, high: 250.47ms)
      Upload:   918.28 Mbps (data used: 1.2 GB)
                  2.55 ms   (jitter: 9.00ms, low: 2.12ms, high: 215.39ms)
 Packet Loss:     0.0%

I'll create a pull request with the changed code.

Details

Version
-
Is it a breaking change?
Perfectly compatible
Issue type
Bug (incorrect behavior)