There is a small error in this patch: 2016-07-04 17:16, Jan Viktorin: > The pci_vfio_has_supported_extensions is not PCI-specific and it is a private > function of the eal_pci_vfio.c. We just rename the function and make it > available even for non-PCI devices. |...] |> --- a/lib/librte_eal/linuxapp/eal/eal_vfio.c > +++ b/lib/librte_eal/linuxapp/eal/eal_vfio.c > @@ -62,6 +62,39 @@ vfio_set_iommu_type(int vfio_container_fd) { > } > > int > +vfio_has_supported_extensions(int vfio_container_fd) { > + int ret; > + unsigned idx, n_extensions = 0; > + for (idx = 0; idx < RTE_DIM(iommu_types); idx++) { > + const struct vfio_iommu_type *t = &iommu_types[idx]; > + > + ret = ioctl(vfio_container_fd, VFIO_CHECK_EXTENSION, > + t->type_id); > + if (ret < 0) { > + RTE_LOG(ERR, EAL, " could not get IOMMU type, " > + "error %i (%s)\n", errno, > + strerror(errno)); > + close(vfio_container_fd);
lib/librte_eal/linuxapp/eal/eal_vfio.c:77:4: error: implicit declaration of function ?close? It is fixed in patch 8 with "#include <unistd.h>".