R&D/Hypervisor

[kvm] SR-IOV

sunshout 2014. 6. 26. 09:09

To enable SR-IOV, need kernel parameter for iommu


edit /etc/default/grub


GRUB_CMDLINE_LINUX_DEFAULT="pci=assign-busses iommu=pt intel_iommu=on"


Next, execute update-grub


$ update-grub


On CentOS


grub2-mkconfig -o /boot/grub2/grub.cfg

In a Intel machine, check dmesg

Intel Machine

$dmesg | grep -e DMAR -e IOMMU 
...
ACPI: DMAR 00000000ac7ebf18 00094 (v01 A M I   OEMDMAR 00000001 INTL 00000001)
Intel-IOMMU: enabled
dmar: IOMMU 0: reg_base_addr fbffe000 ver 1:0 cap d2078c106f0462 ecap f020fa...


vf생성

  • lspci를 통해 vf를 생성할 수 있는 장치를 확인한다.
$ lspci
04:00.0 Ethernet controller: Intel Corporation 82599ES 10-Gigabit SFI/SFP+ Network Connection (rev 01)
04:00.1 Ethernet controller: Intel Corporation 82599ES 10-Gigabit SFI/SFP+ Network Connection (rev 01)
  • 해당 장치를 이용하여 vf를 생성하고 확인한다.
# echo 4 > /sys/bus/pci/devices/0000\:04\:00.0/sriov_numvfs   (4: 생성할 vf의 개수)