Visible to Intel only — GUID: wso1619805362048
Ixiasoft
Visible to Intel only — GUID: wso1619805362048
Ixiasoft
3.5.2.3.2.3. Enabling VFs and Create Guest VM by Using QEMU
- Enable Virtual functions based on requirements:
$ echo 2 > /sys/bus/pci/devices/<bdf>/max_vfs
- Install vfio-pci module
$modprobe vfio-pci
- Bind the device to vfio-pci
- If the device is bound to ifc_uio, unbind with the following command:
$ echo "<bdf>" > /sys/bus/pci/devices/<bdf>/driver/unbind
E.g: echo "0000:01:00.0" > /sys/bus/pci/devices/0000\:01\:00.0/driver/unbind
- Bind the device to vfio-pci
$ echo "<bdf>" > /sys/bus/pci/drivers/vfio-pci/bind
E.g: echo "0000:01:00.1" > /sys/bus/pci/drivers/vfio-pci/bind
- If the device is bound to ifc_uio, unbind with the following command:
- Use following parameters to start the Guest VM (on Intel machines, use QEMU version 3.0.0-rc0). Here, a minimum of 8 GB of memory needs to be allocated to VM.
$ qemu-3.0.0-rc0/x86_64-softmmu/qemu-system-x86_64 -smp 2 -m 8192M -boot c -machine q35,kernel-irqchip=split -cpu host -enable-kvm -nographic -L /root/qemu-3.0.0-rc0/pc-bios -name offload1 -hda <path_to_qcow2_file> -device vfio-pci,host=<bdf> -netdev type=tap,id=net6551,script=no,downscript=no,vhost=on,ifname=net6551 -device virtio-net-pci,netdev=net6551 -device intel-iommu,intremap=on,caching-mode=on -serial telnet::5551,server,nowait -object memory-backend-file,id=mem,size=8192M,mem-path=/dev/hugepages,share=on -numa node,memdev=mem -mem-prealloc -monitor telnet::3331,server,nowait&
- On AMD machines, the parameter “-device intel-iommu,intremap=on,caching-mode=on” is not required.
- If multiple devices are in the same group, check for ACS enablement in the root port and bridge.
- Below are the Host and Guest VM configurations used for verification.
Host System | Configuration Details |
---|---|
Operating System | CentOS Linux release 7.8 |
Linux Kernel | 3.10.0-1127.10.1.el7.28.x86_64 |
CPU Cores | 96 |
RAM | 128 GB (64 GB on single NUMA) |
Hypervisor | KVM |
QEMU Version | QEMU version 3.0.0-rc0 |
Host System | Configuration Details |
---|---|
Operating System | CentOS Linux release 7.8 |
Linux Kernel | 3.10.0-1127.10.1.el7.28.x86_64 |
CPU Cores | 2 |
RAM | 8 GB |