X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;ds=sidebyside;f=drivers%2Fbus%2Fpci%2Fpci_common.c;h=6b46b4f07004a186b1351e39058499aefb626e0a;hb=a5d668e6376db327fda591067d929c314466bd8f;hp=9794552fd8d62b030422dcef5471d9081ea93ac7;hpb=b76fafb174d2cd5247c3573bb3d49444e195e760;p=dpdk.git diff --git a/drivers/bus/pci/pci_common.c b/drivers/bus/pci/pci_common.c index 9794552fd8..6b46b4f070 100644 --- a/drivers/bus/pci/pci_common.c +++ b/drivers/bus/pci/pci_common.c @@ -616,8 +616,16 @@ rte_pci_get_iommu_class(void) const struct rte_pci_driver *drv; bool devices_want_va = false; bool devices_want_pa = false; + int iommu_no_va = -1; FOREACH_DEVICE_ON_PCIBUS(dev) { + /* + * We can check this only once, because the IOMMU hardware is + * the same for all of them. + */ + if (iommu_no_va == -1) + iommu_no_va = pci_device_iommu_support_va(dev) + ? 0 : 1; if (pci_ignore_device(dev)) continue; if (dev->kdrv == RTE_KDRV_UNKNOWN || @@ -643,7 +651,13 @@ rte_pci_get_iommu_class(void) devices_want_va = true; } } - if (devices_want_va && !devices_want_pa) { + if (iommu_no_va == 1) { + iova_mode = RTE_IOVA_PA; + if (devices_want_va) { + RTE_LOG(WARNING, EAL, "Some devices want 'VA' but IOMMU does not support 'VA'.\n"); + RTE_LOG(WARNING, EAL, "The devices that want 'VA' won't initialize.\n"); + } + } else if (devices_want_va && !devices_want_pa) { iova_mode = RTE_IOVA_VA; } else if (devices_want_pa && !devices_want_va) { iova_mode = RTE_IOVA_PA;