vfio: support 64KB kernel page size
[dpdk.git] / drivers / bus / pci / linux / pci.c
index 1783ec7..c99d523 100644 (file)
@@ -615,7 +615,16 @@ pci_one_device_iommu_support_va(struct rte_pci_device *dev)
 
        mgaw = ((vtd_cap_reg & VTD_CAP_MGAW_MASK) >> VTD_CAP_MGAW_SHIFT) + 1;
 
-       return rte_eal_check_dma_mask(mgaw) == 0 ? true : false;
+       /*
+        * Assuming there is no limitation by now. We can not know at this point
+        * because the memory has not been initialized yet. Setting the dma mask
+        * will force a check once memory initialization is done. We can not do
+        * a fallback to IOVA PA now, but if the dma check fails, the error
+        * message should advice for using '--iova-mode pa' if IOVA VA is the
+        * current mode.
+        */
+       rte_mem_set_dma_mask(mgaw);
+       return true;
 }
 #elif defined(RTE_ARCH_PPC_64)
 static bool
@@ -704,6 +713,7 @@ int rte_pci_read_config(const struct rte_pci_device *device,
 
        switch (device->kdrv) {
        case RTE_KDRV_IGB_UIO:
+       case RTE_KDRV_UIO_GENERIC:
                return pci_uio_read_config(intr_handle, buf, len, offset);
 #ifdef VFIO_PRESENT
        case RTE_KDRV_VFIO:
@@ -727,6 +737,7 @@ int rte_pci_write_config(const struct rte_pci_device *device,
 
        switch (device->kdrv) {
        case RTE_KDRV_IGB_UIO:
+       case RTE_KDRV_UIO_GENERIC:
                return pci_uio_write_config(intr_handle, buf, len, offset);
 #ifdef VFIO_PRESENT
        case RTE_KDRV_VFIO: