]> Pileus Git - ~andy/linux/commitdiff
sfc: Improve test for IOMMU in use
authorBen Hutchings <bhutchings@solarflare.com>
Wed, 12 Jun 2013 17:09:08 +0000 (18:09 +0100)
committerBen Hutchings <bhutchings@solarflare.com>
Mon, 24 Jun 2013 19:02:53 +0000 (20:02 +0100)
The device::iommu_group field may be set even if no IOMMU is in use.
iommu_present() is still a better indicator, although it doesn't tell
us whether *our* device is affected.

Reported-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
drivers/net/ethernet/sfc/rx.c

index 5c45118cc03a4957a1a70b1d4816e5cf8aa3ff2f..65646cd7af8e60fc604de59b71cded97703b95b8 100644 (file)
@@ -677,7 +677,7 @@ static void efx_init_rx_recycle_ring(struct efx_nic *efx,
 #ifdef CONFIG_PPC64
        bufs_in_recycle_ring = EFX_RECYCLE_RING_SIZE_IOMMU;
 #else
-       if (efx->pci_dev->dev.iommu_group)
+       if (iommu_present(&pci_bus_type))
                bufs_in_recycle_ring = EFX_RECYCLE_RING_SIZE_IOMMU;
        else
                bufs_in_recycle_ring = EFX_RECYCLE_RING_SIZE_NOIOMMU;