[dpdk-dev] [PATCH] eal/vfio: export all VFIO functions when not compiling VFIO

Thomas Monjalon thomas at monjalon.net
Mon Apr 16 13:55:35 CEST 2018


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.




More information about the dev mailing list