-
Notifications
You must be signed in to change notification settings - Fork 373
Virtio network interfaces failed to be bound back to the driver #612
Comments
@linxiulei Yes, our assumption here was the device was a PCI device here. I can take a look at this. Is there a plugin I can use to test this end to end? |
@amshinde Sorry, it produced at our complex environment. I guess you could create a script which implements setting a virtio interface into container namespace as cni plugin and put the script to hook of oci spec. Good luck~ |
@amshinde any progress? thanks |
Instead of using ethtool for getting the driver for network devices, use sysfs instead. This is because in case of virtio devices, ethtool returns virtio-net instead of virtio-pci for virtio network devices. We need to bind/unbind from virtio-pci driver in case of virtio-net devices. Fixes kata-containers#612 Signed-off-by: Archana Shinde <[email protected]>
@linxiulei This fell off my radar, sorry for the delay. I think have a fix that should solve your issue : #851 I did test out binding and unbinding a virtio-net device in a VM with the above patch. |
@amshinde it worked, cheers |
@linxiulei Great, glad that worked. We had mainly tested with PCI devices in the past, so I am curious about your use-case for using virtio devices with vfio. Do you mind sharing some details about your usage? |
@amshinde Sure, my use-case is pretty simple, in which I used Alibaba Cloud ECS virtual machine and setup k8s/kata-runtime within, therefore a cni plugin working with Alibaba Cloud ECS virtual network interface was deployed. As a result, a virtual network interface was set into network namespace when a pod was created and kata-runtime would consider it as a passthrough-able interface, unfortunnately I ran into this bug. |
thanks @linxiulei |
Instead of using ethtool for getting the driver for network devices, use sysfs instead. This is because in case of virtio devices, ethtool returns virtio-net instead of virtio-pci for virtio network devices. We need to bind/unbind from virtio-pci driver in case of virtio-net devices. Fixes kata-containers#612 Signed-off-by: Archana Shinde <[email protected]>
agent: make NoPivotRoot config depend on `/` fs type
Description of problem
In case of physical network interface, the driver would be virtio_net if using a vm as the host (nested virtualized). After the teardown of container, kata tried to bind interfaces back to virtio_net, but there was no path of /sys/bus/pci/drivers/virtio_net/ (actually it should be /sys/bus/virtio/drivers/virtio_net/). There are two ways fixing that:
The text was updated successfully, but these errors were encountered: