PCIe passthrough not working, at least not automatically

Firex2

New Member
Jan 23, 2020
1
0
1
40
hello everyone,

i'm trying to passthrough my dual port ethernet adapter to one of my virtual machines. Unfortunally it is not working automatically :(

i followed the tutorial from here: https://pve.proxmox.com/wiki/PCI(e)_Passthrough

and here is what i did:

added to the kernel command line in /etc/default/grub
intel_iommu=on intremap=no_x2apic_optout

added to /etc/modules
vfio
vfio_iommu_type1
vfio_pci
vfio_virqfd

created a file /etc/modprobe.d/vfio.conf and added
options vfio-pci ids=8086:105e

updated my grub config and initramfs
update-grub
update-initramfs -u -k all

reboot and checked the log with dmesg | grep -e DMAR -e IOMMU
[ 0.008457] ACPI: DMAR 0x00000000C466ABC8 0000C8 (v01 INTEL SKL 00000001 INTL 00000001)
[ 0.102394] DMAR: IOMMU enabled
[ 0.207896] DMAR: Host address width 39
[ 0.207897] DMAR: DRHD base: 0x000000fed90000 flags: 0x0
[ 0.207901] DMAR: dmar0: reg_base_addr fed90000 ver 1:0 cap 1c0000c40660462 ecap 7e3ff0505e
[ 0.207902] DMAR: DRHD base: 0x000000fed91000 flags: 0x1
[ 0.207904] DMAR: dmar1: reg_base_addr fed91000 ver 1:0 cap d2008c40660462 ecap f050da
[ 0.207905] DMAR: RMRR base: 0x000000c43e0000 end: 0x000000c43fffff
[ 0.207905] DMAR: RMRR base: 0x000000cbb9d000 end: 0x000000cbde6fff
[ 0.207906] DMAR: RMRR base: 0x000000cd000000 end: 0x000000cf7fffff
[ 0.207907] DMAR-IR: IOAPIC id 2 under DRHD base 0xfed91000 IOMMU 1
[ 0.207908] DMAR-IR: HPET id 0 under DRHD base 0xfed91000
[ 0.207908] DMAR-IR: Queued invalidation will be enabled to support x2apic and Intr-remapping.
[ 0.208610] DMAR-IR: Enabled IRQ remapping in x2apic mode
[ 0.784847] DMAR: No ATSR found
[ 0.784876] DMAR: dmar0: Using Queued invalidation
[ 0.784878] DMAR: dmar1: Using Queued invalidation
[ 0.789156] DMAR: Intel(R) Virtualization Technology for Directed I/O

this are the two devices i want to pass through
06:00.0 Ethernet controller [0200]: Intel Corporation 82571EB Gigabit Ethernet Controller [8086:105e] (rev 06)
Subsystem: Intel Corporation PRO/1000 PT Dual Port Server Adapter [8086:115e]
Kernel driver in use: e1000e
Kernel modules: e1000e
06:00.1 Ethernet controller [0200]: Intel Corporation 82571EB Gigabit Ethernet Controller [8086:105e] (rev 06)
Subsystem: Intel Corporation PRO/1000 PT Dual Port Server Adapter [8086:115e]
Kernel driver in use: e1000e
Kernel modules: e1000e

they are in seperate groups for their own
/sys/kernel/iommu_groups/17/devices/0000:06:00.1
/sys/kernel/iommu_groups/7/devices/0000:00:1b.2
/sys/kernel/iommu_groups/15/devices/0000:04:00.0
/sys/kernel/iommu_groups/5/devices/0000:00:17.0
/sys/kernel/iommu_groups/13/devices/0000:00:1f.2
/sys/kernel/iommu_groups/13/devices/0000:00:1f.0
/sys/kernel/iommu_groups/13/devices/0000:00:1f.4
/sys/kernel/iommu_groups/3/devices/0000:00:14.2
/sys/kernel/iommu_groups/3/devices/0000:00:14.0
/sys/kernel/iommu_groups/11/devices/0000:00:1d.1
/sys/kernel/iommu_groups/1/devices/0000:00:01.0
/sys/kernel/iommu_groups/1/devices/0000:01:00.0
/sys/kernel/iommu_groups/18/devices/0000:08:00.0
/sys/kernel/iommu_groups/8/devices/0000:00:1c.0
/sys/kernel/iommu_groups/16/devices/0000:06:00.0
/sys/kernel/iommu_groups/6/devices/0000:00:1b.0
/sys/kernel/iommu_groups/6/devices/0000:00:1b.3
/sys/kernel/iommu_groups/6/devices/0000:00:1b.1
/sys/kernel/iommu_groups/14/devices/0000:00:1f.6
/sys/kernel/iommu_groups/4/devices/0000:00:16.0
/sys/kernel/iommu_groups/4/devices/0000:00:16.3
/sys/kernel/iommu_groups/12/devices/0000:00:1d.3
/sys/kernel/iommu_groups/12/devices/0000:00:1d.6
/sys/kernel/iommu_groups/12/devices/0000:00:1d.4
/sys/kernel/iommu_groups/12/devices/0000:00:1d.2
/sys/kernel/iommu_groups/12/devices/0000:00:1d.7
/sys/kernel/iommu_groups/12/devices/0000:00:1d.5
/sys/kernel/iommu_groups/2/devices/0000:00:02.0
/sys/kernel/iommu_groups/10/devices/0000:00:1d.0
/sys/kernel/iommu_groups/0/devices/0000:00:00.0
/sys/kernel/iommu_groups/19/devices/0000:0a:00.0
/sys/kernel/iommu_groups/9/devices/0000:00:1c.4

interrupt remapping should work too
dmesg | grep ecap
[ 0.211318] DMAR: dmar0: reg_base_addr fed90000 ver 1:0 cap 1c0000c40660462 ecap 7e3ff0505e
[ 0.211321] DMAR: dmar1: reg_base_addr fed91000 ver 1:0 cap d2008c40660462 ecap f050da

the problem is that the kernel wont use vfio-pci instead of e1000e :(

If i do the following stepts manually, the correct driver will load and i can use them in my vm (tested)
echo "8086 105e" > /sys/bus/pci/drivers/vfio-pci/new_id
echo "0000:06:00.0" > /sys/bus/pci/devices/0000:06:00.0/driver/unbind
echo "0000:06:00.1" > /sys/bus/pci/devices/0000:06:00.1/driver/unbind
echo "0000:06:00.0" > /sys/bus/pci/drivers/vfio-pci/bind
echo "0000:06:00.1" > /sys/bus/pci/drivers/vfio-pci/bind

what i also tried is to add the following to the kernel parameter list in /etc/default/grub to force the driver load first, before e1000e
rd.driver.pre=vfio-pci vfio-pci.ids=8086:105e
but it does not help

any ideas what i can to else?
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!