X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fbus%2Fpci%2Fbsd%2Fpci.c;h=ebbfeb13a87c668e6de92672d17fbf52804bab1f;hb=3b307c55f2ac;hp=c7b90cb83de2cdf6c1e37864a342130541d810e1;hpb=f9acaf84e923066344bd3467e4703da66f1f23a8;p=dpdk.git diff --git a/drivers/bus/pci/bsd/pci.c b/drivers/bus/pci/bsd/pci.c index c7b90cb83d..ebbfeb13a8 100644 --- a/drivers/bus/pci/bsd/pci.c +++ b/drivers/bus/pci/bsd/pci.c @@ -33,7 +33,6 @@ #include #include #include -#include #include #include #include @@ -376,13 +375,20 @@ error: return -1; } -/* - * Get iommu class of PCI devices on the bus. - */ +bool +pci_device_iommu_support_va(__rte_unused const struct rte_pci_device *dev) +{ + return false; +} + enum rte_iova_mode -rte_pci_get_iommu_class(void) +pci_device_iova_mode(const struct rte_pci_driver *pdrv __rte_unused, + const struct rte_pci_device *pdev) { /* Supports only RTE_KDRV_NIC_UIO */ + if (pdev->kdrv != RTE_KDRV_NIC_UIO) + RTE_LOG(DEBUG, EAL, "Unsupported kernel driver? Defaulting to IOVA as 'PA'\n"); + return RTE_IOVA_PA; } @@ -533,6 +539,11 @@ rte_pci_ioport_map(struct rte_pci_device *dev, int bar, switch (dev->kdrv) { #if defined(RTE_ARCH_X86) case RTE_KDRV_NIC_UIO: + if (rte_eal_iopl_init() != 0) { + RTE_LOG(ERR, EAL, "%s(): insufficient ioport permissions for PCI device %s\n", + __func__, dev->name); + return -1; + } if ((uintptr_t) dev->mem_resource[bar].addr <= UINT16_MAX) { p->base = (uintptr_t)dev->mem_resource[bar].addr; ret = 0;