PCI pass though (Ethernet port)
1 2 3 4 5 6 7 8 9 10 11
| [root@SMC-KVM ~]# ethtool -i eno2 driver: ixgbe version: 4.18.0-305.10.2.el8_4.x86_64 firmware-version: 0x800007f6, 1.1747.0 expansion-rom-version: bus-info: 0000:01:00.1 supports-statistics: yes supports-test: yes supports-eeprom-access: yes supports-register-dump: yes supports-priv-flags: yes
|
1 2 3 4
| # vim /etc/grub2-efi.cfg # vim /etc/grub2.cfg set kernelopts="...iommu.passthrough=1"
|
Enable intel iommu:
1 2 3 4
| vim /etc/default/grub
GRUB_CMDLINE_LINUX="... intel_iommu=on iommu=pt #GRUB_CMDLINE_LINUX=" ... amd_iommu=on
|
If intel_iommu=on or amd_iommu=on works, you can try replacing them with iommu=pt or amd_iommu=pt.
1 2 3
| grub2-mkconfig -o /boot/grub2/grub.cfg cat /etc/grub2.cfg | grep 'set kernelopt' # 这时候上面的设置已经被映射过来了 reboot
|
Modify VM’s specification:
1 2
| cp /etc/libvirt/qemu/cjl-test.xml /etc/libvirt/qemu/cjl-test.xml.bak vim /etc/libvirt/qemu/cjl-test.xml
|
1 2 3 4 5 6 7
| <hostdev mode='subsystem' type='pci' managed='yes'> <source> <address domain='0x0000' bus='0x01' slot='0x00' function='0x1'/> </source> ##<address type='pci' domain='0x0000' bus='0x01' slot='0x02' function='0x0'/> </hostdev>
|
1 2
| ethtool -i eno2 ethtool -i eno1
|
Guest (VM)
1 2
| [root@localhost ~]# lspci | grep Ethernet 00:02.0 Ethernet controller: Intel Corporation Ethernet Controller 10G X550T (rev 01)
|
1 2 3 4 5 6 7 8 9 10 11
| [root@localhost ~]# ethtool -i ens2 driver: ixgbe version: 4.18.0-305.10.2.el8_4.x86_64 firmware-version: 0x800007f6, 1.1747.0 expansion-rom-version: bus-info: 0000:00:02.0 supports-statistics: yes supports-test: yes supports-eeprom-access: yes supports-register-dump: yes supports-priv-flags: yes
|