PCI passthrough on KVM not persistent



  • Hi All,
    First poster here, newie trying to set up my first pfSense installation.

    This is my set up:

    • Host: Fedora 22

    • Guest: pfSense 2.2.4

    Setup:
    WAN is a passthough ethernet card and LAN is bridged. Passthrough is defined in the XML definition file:

        <hostdev mode="subsystem" type="pci" managed="yes"><source>
    
    <address domain="0x0000" bus="0x00" slot="0x19" function="0x0">
    
    <address type="pci" domain="0x0000" bus="0x02" slot="0x05" function="0x0">
    
    Libvirt version
    

    virsh version

    Compiled against library: libvirt 1.2.13
    Using library: libvirt 1.2.13
    Using API: QEMU 1.2.13
    Running hypervisor: QEMU 2.3.1

    
    When starting the VM for the first time, everything works fine, passthrough device is detected and can set up WAN, LAN and so on. If I reboot the VM (without rebooting the host), it does not detect the passthrough card again.
    
    I tried:
    
    *   Rebooting the VM many times, didn't work.
    
    *   Restarting libvirtd, didn't work.
    
    *   Reattach the device to the host, didn't work.
    
    The only thing that works is **rebooting the host**. Then everything works as per above sequence: VM detects the passthrough card the first time is started and doesn't see it again after rebooting.
    
    PS:  tx offloading is off as per this thread [https://forum.pfsense.org/index.php?topic=88467.0](https://forum.pfsense.org/index.php?topic=88467.0) </address>
    
    </address></hostdev> 
    


  • Found out what was happening.

    My motherboard is a Supermicro MBD-X9SCM-F-O with dual ethernet ports: 1x Intel 82574L and 1x Intel 82579LM.
    I was trying to passthrough the intel 82579LM, and couldn't make to survive a guest reboot. I switched to the other port, passing though the intel 82574L and it works a as charm.
    So it wasn't a configuration/KVM issue but rather a NIC drivers one.