viona needs to import negotiated features during migration
Closed this issue · 0 comments
The viona acceleration in the kernel needs to be told what device features the guest virtio driver has agreed to use so that it can, among other things, decide how received packets should be structured before being exposed to the guest. During migration, the negotiated feature set is exported in virtio::pci::VirtioState::nego_feat
. When viona imports this, it needs to issue a VNA_IOC_SET_FEATURES
ioctl to advise the target kernel as to the guest's chosen feature set.
This issue causes guests that negotiate the VIRTIO_NET_F_MRG_RXBUF
feature to lose connectivity over a migration. Section 5.1.6.1 of the virtio spec says:
The legacy driver only presented num_buffers in the struct virtio_net_hdr when VIRTIO_NET_F_MRG_RXBUF was negotiated; without that feature the structure was 2 bytes shorter.
This means that if the guest thinks MRG_RXBUF
is in use and the host doesn't, the guest will perceive that incoming packets are two bytes shorter than expected and/or that they start in the wrong place in the incoming buffer. Debian 11 guests record these as packets dropped due to length errors:
root@debian:~# cat /sys/class/net/enp0s8/statistics/rx_length_errors
4345