[SOLVED] PCI passthrough recovery for the pve host

fitful

Active Member
Oct 23, 2018
28
7
43
Hello,

I searched the forums, but couldn't find it.
Well, after doing a PCI passthrough to a VM, I cannot recover the network cards back to the host after shutting down the VM that had the cards connected via PCI passthrough.

I have tried by
Code:
echo 1 > /sys/bus/pci/devices/0000:82:00.0/remove
echo 1 > /sys/bus/pci/rescan

but that doesn't work.

In dmesg after running above commands

Code:
[202332.519581] pci 0000:82:00.1: Removing from iommu group 72
[202334.823597] pci 0000:82:00.0: Removing from iommu group 71
[202336.211621] pci 0000:82:00.0: [8086:154d] type 00 class 0x020000
[202336.211637] pci 0000:82:00.0: reg 0x10: [mem 0xfbb00000-0xfbbfffff 64bit]
[202336.211642] pci 0000:82:00.0: reg 0x18: [io 0xf000-0xf01f]
[202336.211653] pci 0000:82:00.0: reg 0x20: [mem 0xfbe00000-0xfbe03fff 64bit]
[202336.211658] pci 0000:82:00.0: reg 0x30: [mem 0xfbd80000-0xfbdfffff pref]
[202336.211701] pci 0000:82:00.0: PME# supported from D0 D3hot
[202336.211964] pci 0000:82:00.0: Adding to iommu group 71
[202336.212017] pci 0000:82:00.1: [8086:154d] type 00 class 0x020000
[202336.212031] pci 0000:82:00.1: reg 0x10: [mem 0xfbc00000-0xfbcfffff 64bit]
[202336.212057] pci 0000:82:00.1: reg 0x18: [io 0xf020-0xf03f]
[202336.212069] pci 0000:82:00.1: reg 0x20: [mem 0xfbe04000-0xfbe07fff 64bit]
[202336.212074] pci 0000:82:00.1: reg 0x30: [mem 0xfbd00000-0xfbd7ffff pref]
[202336.212111] pci 0000:82:00.1: PME# supported from D0 D3hot
[202336.212364] pci 0000:82:00.1: Adding to iommu group 72
[202336.251615] pci 0000:82:00.0: BAR 0: assigned [mem 0xfbb00000-0xfbbfffff 64bit]
[202336.251621] pci 0000:82:00.1: BAR 0: assigned [mem 0xfbc00000-0xfbcfffff 64bit]
[202336.251626] pci 0000:82:00.0: BAR 6: assigned [mem 0xfbd00000-0xfbd7ffff pref]
[202336.251627] pci 0000:82:00.1: BAR 6: assigned [mem 0xfbd80000-0xfbdfffff pref]
[202336.251628] pci 0000:82:00.0: BAR 4: assigned [mem 0xfbe00000-0xfbe03fff 64bit]
[202336.251634] pci 0000:82:00.1: BAR 4: assigned [mem 0xfbe04000-0xfbe07fff 64bit]
[202336.251639] pci 0000:82:00.0: BAR 2: assigned [io 0xf000-0xf01f]
[202336.251641] pci 0000:82:00.1: BAR 2: assigned [io 0xf020-0xf03f]


Code:
root@pve1-sup:~# lspci | grep -i ether
06:00.0 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev 01)
06:00.1 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev 01)
06:00.2 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev 01)
06:00.3 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev 01)
>> 82:00.0 Ethernet controller: Intel Corporation Ethernet 10G 2P X520 Adapter (rev 01)
>> 82:00.1 Ethernet controller: Intel Corporation Ethernet 10G 2P X520 Adapter (rev 01)

and I still don't see them on pve as a network to use
The only thing that helps is to restart the whole PVE machine, then the network is visible, of course until I connect it to the VM again.

Is there any way to recover the network card?
 
Can you try the following, where ${DRIVER} is the actual device driver (check with lspci -k)?
echo '0000:82:00.0' > /sys/bus/pci/drivers/vfio-pci/unbind sleep 3s echo '0000:82:00.0' > /sys/bus/pci/drivers/${DRIVER}/bind
I use it with the amdgpu driver for my GPU and it works.
 
  • Like
Reactions: fitful
Hi, I have a similar problem, but no matter what I try, it either does not work or I get a "permission denied" error.

echo 1 > /sys/bus/pci/devices/0000\:0X\:00.0/remove: Perission denied

echo '0000:01:00.0' > /sys/bus/pci/drivers/vfio-pci/unbind: Perission denied

Does anybody have an idea how to solve this?
thanks
 

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!