Page MenuHomePhabricator

Virtio network card, no info (maybe not fully supported?)
Closed, ResolvedPublicBUG

Description

Hi there!

I install VyOS on my home server (Proxmox) and set to virtio network card (best performance) the VM working well, but now i check interface status, and get this:

vyos@vyos:~$ show interfaces ethernet eth0 physical
Settings for eth0:
        Supported ports: [ ]
        Supported link modes:   Not reported
        Supported pause frame use: No
        Supports auto-negotiation: No
        Advertised link modes:  Not reported
        Advertised pause frame use: No
        Advertised auto-negotiation: No
        Speed: Unknown!
        Duplex: Unknown! (255)
        Port: Other
        PHYAD: 0
        Transceiver: internal
        Auto-negotiation: off
        Link detected: yes
driver: virtio_net
version: 1.0.0
firmware-version:
bus-info: 0000:00:12.0
supports-statistics: no
supports-test: no
supports-eeprom-access: no
supports-register-dump: no
supports-priv-flags: no

If i try to set a IP this interface and after i commit it, it say that a problem the "duplex" and "speed" datas (but after i able to save the changes)

If i set a another Virtual Network card (like vmxnet3) i get correct info:

Settings for eth0:
        Supported ports: [ TP ]
        Supported link modes:   1000baseT/Full
                                10000baseT/Full
        Supported pause frame use: No
        Supports auto-negotiation: No
        Advertised link modes:  Not reported
        Advertised pause frame use: No
        Advertised auto-negotiation: No
        Speed: 1000Mb/s
        Duplex: Full
        Port: Twisted Pair
        PHYAD: 0
        Transceiver: internal
        Auto-negotiation: off
        MDI-X: Unknown
        Supports Wake-on: uag
        Wake-on: d
        Link detected: yes
driver: vmxnet3
version: 1.4.a.0-k-NAPI
firmware-version:
bus-info: 0000:00:12.0
supports-statistics: yes
supports-test: no
supports-eeprom-access: no
supports-register-dump: yes
supports-priv-flags: no

It seems to a virtio driver problem.

Details

Difficulty level
Unknown (require assessment)
Version
VyOS 1.2.0-rolling+201804110337
Why the issue appeared?
Will be filled on close
suto.norbert updated the task description. (Show Details)
syncer added a subscriber: syncer.Apr 12 2018, 10:11 PM

@suto.norbert can you also show error which you get on commit and procedure how to reproduce
Thanks!

I try to reproduce it, but seems to i only get this, if that i set the network card at first time. Now it is my "production ready" system, so i dont want to misconfigure it.

But, i only just do the "Quick Start Guide" steps and i get the error (first time)

I use the latest Proxmox server (5.1)

I am having a few strange problems with 2-3 production pre vyos-1.2.0 systems as well.

I just checked and I'm getting EXACTLY the same response as the OP when I do the command:
show interfaces ethernet eth1 physical
Settings for eth1:

Supported ports: [ ]
Supported link modes:   Not reported
Supported pause frame use: No
Supports auto-negotiation: No
Advertised link modes:  Not reported
Advertised pause frame use: No
Advertised auto-negotiation: No
Speed: Unknown!
Duplex: Unknown! (255)
Port: Other
PHYAD: 0
Transceiver: internal
Auto-negotiation: off
Link detected: yes

driver: virtio_net
version: 1.0.0
firmware-version:
bus-info: 0000:00:09.0
supports-statistics: no
supports-test: no
supports-eeprom-access: no
supports-register-dump: no
supports-priv-flags: no

I don't know if this is related or not, it might be a red-herring to this issue but on one system there is an IPv4 vyos address that I can't ping from pfsense 2.4. I can ping that IPv4 address from all other devices on that network except from pfsense.
I'm also getting intermittent packet loss that I can't (yet) explain, never seen that before on VYOS.

On another system that is set up exactly the same way, I can't get any IPv6 Router Advertisements to be received on only ONE VLAN which serves a Ubiquity WIFI. The other WIFI VLAN is receiving the RAs so I don't know why one is and one isn't.
The ethernet ports are receiving the RA but the Ubiquity WIFI is not (but only on one WIFI vlan).

It was all working before I upgraded to VyOS pre-1.2.0 and then I started having a couple of wierd problems.

The problems are not show stoppers at the moment.

I'm running VyOS on CentOS 7 KVM with virtio network NICS.

I plan on testing it by going back to VyOS 1.1.8 and see if the problems go away but the OP problem sparked my interest and I found out I had exactly the same command response he did and wondered if this might be causing any problems.

suto.norbert added a comment.EditedApr 13 2018, 6:46 AM

@dsummers You remember, that you set the virtual card IP at first time in vyos, you got a error on duplex and speed that "the system can not set it" or something similar?

I found some interesting infos.

First: the "nature" is virtio NIC-s:

Virtio is a para-virtualized driver, which means the os and driver are aware that it's not a physical Device. The driver is really an API between the guest and the hypervisor so it's speed is totally disconnected from any physical device or Ethernet standard. This is a good thing as this is faster than the hypervisor pretending to be a physical device and applying an arbitrary "link speed" concept to flow. The VM just dumps frames onto a bus and it's the host job to deal with the physical devices; no need for the vm to know or care what the link speed of hosts physical devices are.

But i found a kernel patch (it is ubuntu, but i think possible to port debian) that able to set (and view) speed and duplex mode:
net: updates to ethtool and virtio_net for speed/duplex support

And Finally here the Red Hat opinion this question:

How do I check the network speed of a virtio-net network interface?

Red Hat Enterprise Linux virtualisation host (KVM or RHEV)
Linux guest using virtio-net network interface
Issue
How do I check the network speed of a virtio-net network interface?
When a VM use virtio NICs, ethtool is not working
Why virtio network nic speed is 1G in subnetwork tab in RHEV Manager web interface ?
Resolution
This is expected, there is no set speed that a virtio-net interface can operate at.

The 1Gbps is just a placeholder because the driver has to report something.

Root Cause
There's no "set speed" that a virtio-net interface obtains. It's a software implementation of a network interface, it obtains the fastest possible speed it can, and that speed will vary depending on the network/CPU/memory load on the virtualisation host at the time, as well as the destination of any particular traffic.

Consider that the emulated e1000 network interfaces will report their speed as 1Gbps, because they are a software emulation of a 1GbE interface. However, if you do traffic between two VMs on the same host using the emulated e1000 interfaces, you will likely find you can exceed 1Gbps without a problem. If you emulate this e1000 interface on a physical host with a 100Mbps network connection, then your guest will still say it has a 1 gigabit interface, but the maximum throughput attainable is 10% of that or less. Through all this, ethtool will still report the interface is operating at 1Gbps.

The behaviour of the virtio-net interfaces is the same, except the performance will be better because it's paravirtualised instead of emulated, and it won't report a speed in ethtool.

There is no way the ethtool process within a guest can possibly know the maximum speed that a given virtio-net interface can obtain at any given time, so there is nothing for virtio-net to report to ethtool.

So yes, it is not a "real" bug, but it possible to improve it (like Ubuntu patch)

dsummers added a comment.EditedApr 15 2018, 8:31 PM

@suto.norbert I don't recall ever seeing any error about duplex or speed when setting vyos pre 1.2.0 versions.
Hope that helps.

syncer triaged this task as Low priority.May 27 2018, 10:00 AM
syncer assigned this task to dmbaturin.
syncer added a subscriber: dmbaturin.

@dmbaturin leave it to you, some stuff in set interfaces uses duplex output somewhere

syncer reassigned this task from dmbaturin to hagbard.Oct 13 2018, 6:59 PM
syncer added a subscriber: hagbard.

@hagbard want to investigate?
basically somewhere in interfaces scripts it tries to get
Speed: and Duplex: but virtio drivers just not report that

@syncer gonna have a look today.

hagbard added a comment.EditedOct 15 2018, 6:44 PM

@syncer we have this patch in the kernel (commit 16032be56c1f66770da15cb94f0eb366c37aff6e ++). I think ethtool just doesn't use it, which is what I'm gonna check next.

I see it's if you do a set int eth ethX speed ...

hagbard changed the task status from Open to In progress.Oct 15 2018, 8:14 PM

https://github.com/vyos/vyatta-cfg-system/pull/79
I test it tomorrow after the CI rebuild before I close this task.

Found another weird bug in the vyatta script, it applies duplex and speed only after 2 commits.

https://github.com/vyos/vyatta-cfg-system/commit/bf7fe3da15446eef6d5974d26106c130179c32fc
The function set_speed_duplex checks the setting via ethtool again and compares it with the requested ones, since virtio_net returns 'unknown', the setting have been applied only every 2nd commit.

I just wanted to mention that the two problems I mentioned earlier had nothing to do with this issue.

At the time I was pulling my hair out trying to come up with any reason that might be related to the problems I was having and wondered if this issue might be related.

Later, I found and fixed the problems I mentioned without changing vyos versions.

Sorry for the noise.

@dsummers no problem at all I found a few issues in the existing code, plus I had to read up on the virtio code as well :).

verified via latest rolling iso.

hagbard closed this task as Resolved.Oct 18 2018, 1:36 AM
syncer moved this task from Backlog to Finished on the VyOS 1.2.x (VyOS 1.2.0-rc4) board.