Page MenuHomeVyOS Platform

Interface configuration saving fails for ice/iavf based interfaces because they can't change speed/duplex settings
Closed, ResolvedPublicBUG

Description

I have an Intel E810 card (supported by the "ice" driver). I have the 4 port, 25gbps version.
The ice driver does not support changing speed, duplex, or autonegotiation settings (I have no idea why, but it doesn't). I pasted the driver README on this at the end of the report. I am running VYOS in libvirt, and am handing it VF's (so vyos is using iavf rather than ice) but it inherits the same limitation. If i pass through the physical port so vyos uses the ice driver directly, it has the same issue (plus it does not set up the DDP).

VYOS appears to append speed=auto, duplex=auto to configs before processing them with ifconfig/ethernet.py. As a result, it tries to change the autonegotiation state on the card when i run commit, and when it fails, you can't save. This is noted in the docs as a default, so not surprising.
If i modify config.boot directly, it works fine.

The inability to change speed/duplex appears to have happened before :). If i add iavf to the list of drivers in ethtool.py not support speed, auto, all works correctly.

iavf only supports cards that use the i40e and ice drivers. The i40e driver has the same limitation of not setting speed/duplex and same note in the readme file. So i will add i40e (and ice) to the list as well. I have tested ice, but i can't test i40e easily.

For completeness I've pasted a log showing what happens. The printout you see before "VYOS had an issue completing a command" is me adding print(config) right before the speed/duplex processing in ethernet.py when i was trying to figure out what was going on.

Log of VYOS:

vyos@router:~$ configure
s[edit]
vyos@router# show interfaces ethernet
 ethernet eth0 {
     address dhcp
     description OUTSIDE
 }
 ethernet eth1 {
     address 192.168.0.4/22
     description INSIDE
 }
[edit]
vyos@router# show interfaces ethernet eth
eth0  eth1
[edit]
vyos@router# show interfaces ethernet eth0
 address dhcp
 description OUTSIDE
[edit]
vyos@router# exit
exit
vyos@router:~$ configure
[edit]
vyos@router# set interfaces ethernet eth0 offload tso
[edit]
vyos@router# commit
[ interfaces ethernet eth0 ]
{'address': ['dhcp'], 'description': 'OUTSIDE', 'offload': {'tso': {}}, 'ifname': 'eth0', 'dhcp_options': {'default_route_distance': '210'}, 'ip': {'arp_cache_timeout': '3
0'}, 'duplex': 'auto', 'mtu': '1500', 'speed': 'auto'}
VyOS had an issue completing a command.

We are sorry that you encountered a problem while using VyOS.
There are a few things you can do to help us (and yourself):
- Contact us using the online help desk if you have a subscription:
  https://support.vyos.io/
- Make sure you are running the latest version of VyOS available at:
  https://vyos.net/get/
- Consult the community forum to see how to handle this issue:
  https://forum.vyos.io
- Join us on Slack where our users exchange help and advice:
  https://vyos.slack.com

When reporting problems, please include as much information as possible:
- do not obfuscate any data (feel free to contact us privately if your
  business policy requires it)
- and include all the information presented below

Report time:      2022-03-11 02:17:25
Image version:    VyOS 1.4-rolling-202203080319
Release train:    sagitta
Built by:         [email protected]
Built on:         Tue 08 Mar 2022 03:19 UTC
Build UUID:       01c39384-2c6e-4e45-9436-33b26290bf68
Build commit ID:  b2ca3389494c35

Architecture:     x86_64
Boot via:         installed image
System type:      KVM guest

Hardware vendor:  Red Hat
Hardware model:   KVM
Hardware S/N:
Hardware UUID:    c2ab4f4d-45bc-4b85-ba35-89d12dda2047

Traceback (most recent call last):
  File "/usr/libexec/vyos/conf_mode/interfaces-ethernet.py", line 212, in <module>
    apply(c)
  File "/usr/libexec/vyos/conf_mode/interfaces-ethernet.py", line 201, in apply
    e.update(ethernet)
  File "/usr/lib/python3/dist-packages/vyos/ifconfig/ethernet.py", line 348, in update
    self.set_speed_duplex(speed, duplex)
  File "/usr/lib/python3/dist-packages/vyos/ifconfig/ethernet.py", line 177, in set_speed_duplex
    return self._cmd(cmd)
  File "/usr/lib/python3/dist-packages/vyos/ifconfig/control.py", line 52, in _cmd
    return cmd(command, self.debug)
  File "/usr/lib/python3/dist-packages/vyos/util.py", line 161, in cmd
    raise OSError(code, feedback)
PermissionError: [Errno 1] failed to run command: ethtool --change eth0 autoneg on
returned:
exit code: 1

noteworthy:
cmd 'ethtool --show-pause eth0'
returned (out):

returned (err):
netlink error: Operation not supported
cmd 'ethtool --show-pause eth0'
returned (out):

returned (err):
netlink error: Operation not supported
cmd 'ethtool --change eth0 autoneg on'
returned (out):

returned (err):

From the driver readme:

Speed and Duplex Configuration
------------------------------
You cannot set speed, duplex, or autonegotiation settings using ethtool.

To see the speed configurations your device supports, run the following:

# ethtool <ethX>

To have your device advertise supported speeds, use the following:

# ethtool -s <ethX> advertise N
  Where N is a bitmask of the desired speeds.

For example, to have your device advertise 10000baseSR Full, use:

# ethtool -s <ethX> advertise 0x80000000000

For more details, please refer to the ethtool man page.

Details

Difficulty level
Easy (less than an hour)
Version
VyOS 1.4-rolling-202203080319
Why the issue appeared?
Other
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Bug (incorrect behavior)

Event Timeline

c-po assigned this task to dberlin.
c-po changed Difficulty level from Unknown (require assessment) to Easy (less than an hour).
c-po changed Why the issue appeared? from Will be filled on close to Other.
c-po moved this task from Need Triage to Finished on the VyOS 1.3 Equuleus ( 1.3.1) board.
c-po moved this task from Need Triage to Finished on the VyOS 1.4 Sagitta board.