Page MenuHomeVyOS Platform

Failure to apply configuration with new ethtool parsing if using virtual ethernet driver (xen vif)
Closed, ResolvedPublicBUG

Description

When T6729 changed ethtool parsing, it causes the failure of ethtool --json --show-ring {ifname} to now cascade into a failure when applying configuration.

As noted in python/vyos/ethtool.py there are certain ethtool commands which are not supported by all drivers, particularly virtual drivers. --show-pause is called out and handled specifically here. However, one of my NICs is Xen's vif driver, which also doesn't provide ringbuffer information for --show-ring.

This command has always failed with my setup, however the output was never accessed (presumably it would be if you tried to adjust ringbuffer sizes in your config). Now, since the __init__ for Ethtool immediately does a [0] on the result, it throws an exception when initting the class, leading to a commit failure and the configuration not being fully applied (the relevant NIC is left in a DOWN state).'

It looks like what needs to happen here is that --show-ring needs to be handled in the same way as --show-pause where errors can be accepted in the Ethtool constructor.

For what it's worth, at the top of the file there is a _drivers_without_speed_duplex_flow list, and Xen's vif also applies there.

$ ethtool --driver eth1
driver: vif
version: 6.6.51-vyos
firmware-version: 
expansion-rom-version: 
bus-info: vif-0
supports-statistics: yes
supports-test: no
supports-eeprom-access: no
supports-register-dump: no
supports-priv-flags: no
$ ethtool --json eth1
[ {
        "ifname": "eth1",
        "link-detected": true
    } ]
$ ethtool --json --show-features eth1
[ {
        "ifname": "eth1",
        "rx-checksumming": {
            "active": true,
            "fixed": true,
            "requested": false
        },
        "tx-checksumming": {
            "active": true,
            "fixed": null,
            "requested": null
        },
        "tx-checksum-ipv4": {
            "active": true,
            "fixed": true,
            "requested": false
        },
        "tx-checksum-ip-generic": {
            "active": false,
            "fixed": true,
            "requested": false
        },
        "tx-checksum-ipv6": {
            "active": true,
            "fixed": false,
            "requested": true
        },
        "tx-checksum-fcoe-crc": {
            "active": false,
            "fixed": true,
            "requested": false
        },
        "tx-checksum-sctp": {
            "active": false,
            "fixed": true,
            "requested": false
        },
        "scatter-gather": {
            "active": true,
            "fixed": null,
            "requested": null
        },
        "tx-scatter-gather": {
            "active": true,
            "fixed": false,
            "requested": true
        },
        "tx-scatter-gather-fraglist": {
            "active": false,
            "fixed": true,
            "requested": false
        },
        "tcp-segmentation-offload": {
            "active": true,
            "fixed": null,
            "requested": null
        },
        "tx-tcp-segmentation": {
            "active": true,
            "fixed": false,
            "requested": true
        },
        "tx-tcp-ecn-segmentation": {
            "active": false,
            "fixed": true,
            "requested": false
        },
        "tx-tcp-mangleid-segmentation": {
            "active": false,
            "fixed": false,
            "requested": false
        },
        "tx-tcp6-segmentation": {
            "active": true,
            "fixed": false,
            "requested": true
        },
        "generic-segmentation-offload": {
            "active": true,
            "fixed": false,
            "requested": true
        },
        "generic-receive-offload": {
            "active": true,
            "fixed": false,
            "requested": true
        },
        "large-receive-offload": {
            "active": false,
            "fixed": true,
            "requested": false
        },
        "rx-vlan-offload": {
            "active": false,
            "fixed": true,
            "requested": false
        },
        "tx-vlan-offload": {
            "active": false,
            "fixed": true,
            "requested": false
        },
        "ntuple-filters": {
            "active": false,
            "fixed": true,
            "requested": false
        },
        "receive-hashing": {
            "active": false,
            "fixed": true,
            "requested": false
        },
        "highdma": {
            "active": false,
            "fixed": true,
            "requested": false
        },
        "rx-vlan-filter": {
            "active": false,
            "fixed": true,
            "requested": false
        },
        "vlan-challenged": {
            "active": false,
            "fixed": true,
            "requested": false
        },
        "tx-lockless": {
            "active": false,
            "fixed": true,
            "requested": false
        },
        "netns-local": {
            "active": false,
            "fixed": true,
            "requested": false
        },
        "tx-gso-robust": {
            "active": true,
            "fixed": true,
            "requested": false
        },
        "tx-fcoe-segmentation": {
            "active": false,
            "fixed": true,
            "requested": false
        },
        "tx-gre-segmentation": {
            "active": false,
            "fixed": true,
            "requested": false
        },
        "tx-gre-csum-segmentation": {
            "active": false,
            "fixed": true,
            "requested": false
        },
        "tx-ipxip4-segmentation": {
            "active": false,
            "fixed": true,
            "requested": false
        },
        "tx-ipxip6-segmentation": {
            "active": false,
            "fixed": true,
            "requested": false
        },
        "tx-udp_tnl-segmentation": {
            "active": false,
            "fixed": true,
            "requested": false
        },
        "tx-udp_tnl-csum-segmentation": {
            "active": false,
            "fixed": true,
            "requested": false
        },
        "tx-gso-partial": {
            "active": false,
            "fixed": true,
            "requested": false
        },
        "tx-tunnel-remcsum-segmentation": {
            "active": false,
            "fixed": true,
            "requested": false
        },
        "tx-sctp-segmentation": {
            "active": false,
            "fixed": true,
            "requested": false
        },
        "tx-esp-segmentation": {
            "active": false,
            "fixed": true,
            "requested": false
        },
        "tx-udp-segmentation": {
            "active": false,
            "fixed": true,
            "requested": false
        },
        "tx-gso-list": {
            "active": false,
            "fixed": true,
            "requested": false
        },
        "fcoe-mtu": {
            "active": false,
            "fixed": true,
            "requested": false
        },
        "tx-nocache-copy": {
            "active": false,
            "fixed": false,
            "requested": false
        },
        "loopback": {
            "active": false,
            "fixed": true,
            "requested": false
        },
        "rx-fcs": {
            "active": false,
            "fixed": true,
            "requested": false
        },
        "rx-all": {
            "active": false,
            "fixed": true,
            "requested": false
        },
        "tx-vlan-stag-hw-insert": {
            "active": false,
            "fixed": true,
            "requested": false
        },
        "rx-vlan-stag-hw-parse": {
            "active": false,
            "fixed": true,
            "requested": false
        },
        "rx-vlan-stag-filter": {
            "active": false,
            "fixed": true,
            "requested": false
        },
        "l2-fwd-offload": {
            "active": false,
            "fixed": true,
            "requested": false
        },
        "hw-tc-offload": {
            "active": false,
            "fixed": true,
            "requested": false
        },
        "esp-hw-offload": {
            "active": false,
            "fixed": true,
            "requested": false
        },
        "esp-tx-csum-hw-offload": {
            "active": false,
            "fixed": true,
            "requested": false
        },
        "rx-udp_tunnel-port-offload": {
            "active": false,
            "fixed": true,
            "requested": false
        },
        "tls-hw-tx-offload": {
            "active": false,
            "fixed": true,
            "requested": false
        },
        "tls-hw-rx-offload": {
            "active": false,
            "fixed": true,
            "requested": false
        },
        "rx-gro-hw": {
            "active": false,
            "fixed": true,
            "requested": false
        },
        "tls-hw-record": {
            "active": false,
            "fixed": true,
            "requested": false
        },
        "rx-gro-list": {
            "active": false,
            "fixed": false,
            "requested": false
        },
        "macsec-hw-offload": {
            "active": false,
            "fixed": true,
            "requested": false
        },
        "rx-udp-gro-forwarding": {
            "active": false,
            "fixed": false,
            "requested": false
        },
        "hsr-tag-ins-offload": {
            "active": false,
            "fixed": true,
            "requested": false
        },
        "hsr-tag-rm-offload": {
            "active": false,
            "fixed": true,
            "requested": false
        },
        "hsr-fwd-offload": {
            "active": false,
            "fixed": true,
            "requested": false
        },
        "hsr-dup-offload": {
            "active": false,
            "fixed": true,
            "requested": false
        }
    } ]
$ ethtool --json --show-ring eth1
netlink error: Operation not supported
[ ]
$ ethtool --json --show-pause eth1
netlink error: Operation not supported
[ ]
# commit
[ interfaces ethernet eth1 ]
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:      2024-10-05 16:05:48
Image version:    VyOS 1.5-rolling-202409250007
Release train:    current

Built by:         autobuild@vyos.net
Built on:         Wed 25 Sep 2024 00:07 UTC
Build UUID:       9b8b01ce-f96f-4af7-8116-68c8cd296cb7
Build commit ID:  fa50a5073b6d3f

Architecture:     x86_64
Boot via:         installed image
System type:      Xen HVM guest

Hardware vendor:  AZW
Hardware model:   EQ
Hardware S/N:     BN1004HE10213
Hardware UUID:    02697c66-d71f-fb0d-b995-c5665f098221

Traceback (most recent call last):
  File "/usr/libexec/vyos/conf_mode/interfaces_ethernet.py", line 354, in <module>
    verify(c)
  File "/usr/libexec/vyos/conf_mode/interfaces_ethernet.py", line 274, in verify
    verify_ethernet(ethernet)
  File "/usr/libexec/vyos/conf_mode/interfaces_ethernet.py", line 310, in verify_ethernet
    ethtool = Ethtool(ifname)
              ^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/vyos/ethtool.py", line 105, in __init__
    self._ring_buffer = loads(out)[0]
                        ~~~~~~~~~~^^^
IndexError: list index out of range

noteworthy:
cmd 'ethtool --json --show-ring eth1'
returned (out):
[ ]
returned (err):
netlink error: Operation not supported
cmd 'ethtool --json --show-ring eth1'
returned (out):
[ ]
returned (err):
netlink error: Operation not supported
list index out of range
[[interfaces ethernet eth1]] failed
Commit failed
[edit]

Details

Version
VyOS 1.5-rolling-202409250007
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Bug (incorrect behavior)

Event Timeline

syncer triaged this task as Normal priority.
zsdc raised the priority of this task from Normal to High.Tue, Nov 5, 1:16 AM
Viacheslav changed the task status from Open to Needs reporter action.Thu, Nov 7, 11:41 AM

@paulywog Can you check the latest rolling?

Viacheslav moved this task from Need Triage to Completed on the VyOS Rolling board.

@syncer not it doesn’t
JSON parser wasn’t back ported so other branches are not affected

I was able to update my router to VyOS 1.5-rolling-202411070006 and my xen vif interface is working once again. Thanks everyone!

Thanks for bringing this to our attention @paulywog