-
Notifications
You must be signed in to change notification settings - Fork 374
IOMMU groups with multiple devices #708
Comments
The issue is not completely clear to me, but it sounds like once you passed the first device, the IOMMU group is locked, and since all the other devices that you're trying to pass are part of the same group, you cannot assign them to this VM. |
Each VFIO device file (
Then when resolving the PCI devices represented by the VFIO device file, the device ID of the file is used as an ID for each of the VFIO PCI devices.
These IDs are then passed to QEMU which expects devices to have unique IDs. runtime/virtcontainers/qemu.go Line 795 in e02695b
|
@sboeuf This is a Kata specific issue. In fact this looks like a regression since the device refactoring as I have been able to pass multiple devices in an iommu group in the past. |
Adds per-device VFIO ids allowing IOMMU groups with multiple devices to be passed to qemu. Fixes kata-containers#708 Signed-off-by: Edward Guzman <eguzman@nvidia.com>
Adds per-device VFIO ids allowing IOMMU groups with multiple devices to be passed to qemu. Fixes kata-containers#708 Signed-off-by: Edward Guzman <eguzman@nvidia.com>
…eGolangSys vendor: update golang/sys
Description of problem
When passing the VFIO device file corresponding to an IOMMU group comprised of multiple devices, the QMP
device_add
successfully adds the first device but fails to add any devices after that.This seems to happen because only one device ID is generated per VFIO device file (
/dev/vfio/XX
). When attaching the PCI devices associated with this IOMMU group via the QMPdevice_add
command, theid
parameter is set to generated device ID resulting in theDuplicate ID
error (see log below) for any PCI devices after the first one.Potential Fixes
id
parameter to thedevice_add
command since it's optionalLog
CLI:
docker run --runtime=kata --device=/dev/vfio/34 --rm -it busybox
Device
15:00.0
has already been successfully attached withid = vfio-97d2a47534f15ff4
(prior to this part of the log). This shows device15:00.1
failing to hotplug since it shares the sameid
.time="2018-09-10T14:46:16.107445474-07:00" level=info msg="{"error": {"class": "GenericError", "desc": "Duplicate ID 'vfio-97d2a47534f15ff4' for device"}}" arch=amd64 command=create container=dd9219202646dd82c0d4ba829426da75a93ff995b763c5e623f4904bf2dee2ff name=kata-runtime pid=21953 source=virtcontainers subsystem=qmp
time="2018-09-10T14:46:16.107681462-07:00" level=error msg="failed to hotplug VFIO device" arch=amd64 command=create container=dd9219202646dd82c0d4ba829426da75a93ff995b763c5e623f4904bf2dee2ff error="QMP command failed" name=kata-runtime pid=21953 sandbox=dd9219202646dd82c0d4ba829426da75a93ff995b763c5e623f4904bf2dee2ff sandboxid=dd9219202646dd82c0d4ba829426da75a93ff995b763c5e623f4904bf2dee2ff source=virtcontainers subsystem=sandbox vfio device BDF="15:00.1" vfio device ID=vfio-97d2a47534f15ff4
time="2018-09-10T14:46:16.107826113-07:00" level=error msg="Failed to add device" arch=amd64 command=create container=dd9219202646dd82c0d4ba829426da75a93ff995b763c5e623f4904bf2dee2ff error="QMP command failed" name=kata-runtime pid=21953 source=virtcontainers subsystem=device
time="2018-09-10T14:46:16.211620142-07:00" level=error msg="QMP command failed" arch=amd64 command=create container=dd9219202646dd82c0d4ba829426da75a93ff995b763c5e623f4904bf2dee2ff name=kata-runtime pid=21953 source=runtime
The text was updated successfully, but these errors were encountered: