Skip to content
  • Alex Williamson's avatar
    95239e16
    vfio/pci: Lazy PBA emulation · 95239e16
    Alex Williamson authored
    
    
    The PCI spec recommends devices use additional alignment for MSI-X
    data structures to allow software to map them to separate processor
    pages.  One advantage of doing this is that we can emulate those data
    structures without a significant performance impact to the operation
    of the device.  Some devices fail to implement that suggestion and
    assigned device performance suffers.
    
    One such case of this is a Mellanox MT27500 series, ConnectX-3 VF,
    where the MSI-X vector table and PBA are aligned on separate 4K
    pages.  If PBA emulation is enabled, performance suffers.  It's not
    clear how much value we get from PBA emulation, but the solution here
    is to only lazily enable the emulated PBA when a masked MSI-X vector
    fires.  We then attempt to more aggresively disable the PBA memory
    region any time a vector is unmasked.  The expectation is then that
    a typical VM will run entirely with PBA emulation disabled, and only
    when used is that emulation re-enabled.
    
    Reported-by: default avatarShyam Kaushik <shyam.kaushik@gmail.com>
    Tested-by: default avatarShyam Kaushik <shyam.kaushik@gmail.com>
    Signed-off-by: default avatarAlex Williamson <alex.williamson@redhat.com>
    95239e16
    vfio/pci: Lazy PBA emulation
    Alex Williamson authored
    
    
    The PCI spec recommends devices use additional alignment for MSI-X
    data structures to allow software to map them to separate processor
    pages.  One advantage of doing this is that we can emulate those data
    structures without a significant performance impact to the operation
    of the device.  Some devices fail to implement that suggestion and
    assigned device performance suffers.
    
    One such case of this is a Mellanox MT27500 series, ConnectX-3 VF,
    where the MSI-X vector table and PBA are aligned on separate 4K
    pages.  If PBA emulation is enabled, performance suffers.  It's not
    clear how much value we get from PBA emulation, but the solution here
    is to only lazily enable the emulated PBA when a masked MSI-X vector
    fires.  We then attempt to more aggresively disable the PBA memory
    region any time a vector is unmasked.  The expectation is then that
    a typical VM will run entirely with PBA emulation disabled, and only
    when used is that emulation re-enabled.
    
    Reported-by: default avatarShyam Kaushik <shyam.kaushik@gmail.com>
    Tested-by: default avatarShyam Kaushik <shyam.kaushik@gmail.com>
    Signed-off-by: default avatarAlex Williamson <alex.williamson@redhat.com>
Loading