How to use non-legacy virtio networking with libvirt?
-
I just noticed all network interfaces are recognized by pfSense 2.8.0 as "VirtIO PCI (legacy) Network adapter".
I then wondered why are they legacy and tried to make them non-legacy by adding
-global virtio-blk-pci.disable-legacy=on -global virtio-blk-pci.disable-modern=false
to QEMU CLI, but it didn't seem to make any difference.Am I missing something else?
Performance of virtio network interface is quite bad right now, can't even saturate 2Gbps on 3.3 GHz CPU due to it being seemingly single-threaded (https://redmine.pfsense.org/issues/14802 / https://forum.netgate.com/post/807755).
-
Experimented some with this. Looks like system need to boot with UEFI. With UEFI network interface is detected as "VirtIO PCI (modern) Network adapter".
-
Small update: I had to re-create PCIe devices, including disk and network. Not sure why, but they remained "legacy" no matter what, so I copied and tweaked config from another VM that was recognized as "modern". Only
bus
andslot
were different, yet it somehow made a big difference.So make sure VM is running as UEFI and re-create devices if necessary, then they'll be recognized as "modern".
-
Did you see a big performance improvement because of this? In the past I have seen bad performance and/or high CPU-usage, mainly IRQ.
Is UEFI boot enough or did you still need the directives for the QEMU CLI mentioned in your first post? -
@wickeren Honestly, at least peak performance of the interface appears to be about the same.
I was not using any explicit CLI options, including those above, just reconfigured all PCIe devices in libvirt's XML definition of the domain.
It is still atrociously slow comparing to Linux performance, there I have no problem getting well over 10 Gbps on virtio network interfaces.