<div dir="ltr"><p>Hi all,</p><p>We are working on migrating our DPDK application from <code>igb_uio</code> to <code>vfio-pci</code>. Our target environment is a VMware ESXi host running on an AMD Epyc server with NICs configured for PCI Passthrough to a guest VM with Debian Bookworm (Kernel 6.1.0-39-amd64)</p><div><p>We've encountered a couple of issues.<br><br>Problem 1:<br><br>Initially, attempting to use vfio-pci failed with an error code of -22, and the /sys/class/iommu/ directory was empty. We discovered the "expose IOMMU to guest OS" option in VMware and enabled it.<br><br>This led to a new error:<br>"The virtual machine cannot be powered on because IOMMU virtualization is not compatible with PCI passthru on AMD platforms"<br><br>We found a workaround by adding amd.iommu.supportsPcip = "TRUE" to the VM's configuration. The VM now boots, and the IOMMU is visible in the guest.<br><br>However, when we run our DPDK application, it hangs after printing "EAL: VFIO support initialized", and shortly after, the guest kernel panics with a soft lockup error, making the system eventually unresponsive.<br>BUG: soft lockup - CPU#34 stuck for 75s! [kcompactd0:529]<br><br>Problem 2:<br><br>Separately, we've noticed that our IOMMU groups are not ideal. Many groups contain not only the NICs we need to bind, but also other devices like PCI bridges. <br><br>IOMMU Group 7:<br>        0000:00:17.0 - PCI bridge: VMware PCI Express Root Port<br>        0000:00:17.1<br>        0000:00:17.2<br>        0000:00:17.3<br>        0000:00:17.4<br>        0000:00:17.5<br>        0000:00:17.6<br>        0000:00:17.7<br>        0000:13:00.0 - nic<br>        0000:13:00.1 - nic <br>        0000:14:00.0 - nic<br>        0000:14:00.1 - nic<br><br>Questions:<br></p><ol><li> Is enabling guest IOMMU virtualization in VMware with the <code>amd.iommu.supportsPcip</code> workaround, the correct approach here?</li><li>I see that vfio-pci can be run in unsafe mode, but is there any benefit to using it over igb_uio in this case? </li><ol><li>In my understanding, the hypervisor is using actual hardware IOMMU to implement PCI pass-through anyway, so what's the point of having it inside of a guest VM again?</li><li>Also, usually enable_unsafe_noiommu_mode is not compiled in, so we need to recompile vfio separately, and since we already compile igb_uio anyway, vfio won't be any better in terms of deployment.</li></ol><li>There also seems to be an option of using SR-IOV instead of passthrough, but we haven't explored this option yet. The question here is, do you still need to "expose iommu" to be able to bind VF to vfio? And what's the correct workflow here in general?<br></li></ol><div>Best Regarads,</div><div>Oleksandr</div><p></p><p></p><h3></h3></div></div>