Re: [PATCH v5] vfio: Support for no-IOMMU mode
From: Burakov, Anatoly <hidden>
Date: 2016-01-28 10:03:08
2016-01-27 16:50, Anatoly Burakov:quoted
--- a/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c +++ b/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c +int vfio_type1_dma_map(int); +int vfio_noiommu_dma_map(int);WARNING:AVOID_EXTERNS: externs should be avoided in .c files I agree with checkpatch, they should be static ;)
Will fix that.
quoted
--- a/lib/librte_eal/linuxapp/eal/eal_vfio.h +++ b/lib/librte_eal/linuxapp/eal/eal_vfio.h +/* older kernels may not have no-IOMMU mode */ #ifndef +VFIO_NOIOMMU_IOMMU #define VFIO_NOIOMMU_IOMMU 8 #endifShouldn't it be defined privately in .c file?
We already have other VFIO-related definitions in that file, specifically the PCI defines that aren't present in earlier kernels. This definition is similar in nature - it will be present in kernels starting from 4.5 (when NOIOMMU was introduced), but earlier kernels will need this defined. I didn't want to go similar route with redefining everything VFIO-related, but maybe it makes sense in this case for consistency's sake? E.g. #define RTE_VFIO_TYPE1 VFIO_TYPE1_IOMMU [we're already in an ifdef linux >= 3.6, so define type1 unconditionally] #if linux < 4.5 #define RTE_VFIO_NOIOMMU 8 #else #define RTE_VFIO_NOIOMMU VFIO_NOIOMMU_IOMMU #endif Or something like that? Thanks, Anatoly