[dpdk-dev] [PATCH v5] vfio: Support for no-IOMMU mode

Thomas Monjalon thomas.monjalon at 6wind.com
Thu Jan 28 14:27:28 CET 2016


2016-01-28 10:03, Burakov, Anatoly:
> > 2016-01-27 16:50, Anatoly Burakov:
> > > --- 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 #endif
> > 
> > Shouldn'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?

OK you can keep it as is or define a RTE constant. Up to you.


More information about the dev mailing list