16/04/2018 12:59, Anatoly Burakov: > --- a/lib/librte_eal/common/include/rte_vfio.h > +++ b/lib/librte_eal/common/include/rte_vfio.h > @@ -33,10 +33,6 @@ > #define VFIO_NOIOMMU_MODE \ > "/sys/module/vfio/parameters/enable_unsafe_noiommu_mode" > > -#ifdef __cplusplus > -extern "C" { > -#endif > - > /* NOIOMMU is defined from kernel version 4.5 onwards */ > #ifdef VFIO_NOIOMMU_IOMMU > #define RTE_VFIO_NOIOMMU VFIO_NOIOMMU_IOMMU > @@ -44,6 +40,17 @@ extern "C" { > #define RTE_VFIO_NOIOMMU 8 > #endif > > +#else /* not VFIO_PRESENT */ > + > +/* we don't need an actual definition, only pointer is used */ > +struct vfio_device_info; > + > +#endif /* VFIO_PRESENT */ > + > +#ifdef __cplusplus > +extern "C" { > +#endif
Why moving this extern "C"? Could it be at the top of the file? [...] > +int __rte_experimental > +rte_vfio_get_group_fd(__rte_unused int iommu_group_num) > +{ > + return -1; > +} > + > #endif This #endif needs a comment.