[dpdk-dev] [PATCH] eal: fix compilation without VFIO

Burakov, Anatoly anatoly.burakov at intel.com
Thu Apr 12 16:13:22 CEST 2018


On 12-Apr-18 2:34 PM, Shahaf Shuler wrote:
> a compilation error occurred when compiling with CONFIG_RTE_EAL_VFIO=n
> 
> == Build lib/librte_eal/linuxapp/eal
>    CC eal_vfio.o
> /download/dpdk/lib/librte_eal/linuxapp/eal/eal_vfio.c:1535:1: error: no
> previous prototype for 'rte_vfio_dma_map' [-Werror=missing-prototypes]
>   rte_vfio_dma_map(uint64_t __rte_unused vaddr, __rte_unused uint64_t
> iova,
>   ^
> /download/dpdk/lib/librte_eal/linuxapp/eal/eal_vfio.c:1542:1: error: no
> previous prototype for 'rte_vfio_dma_unmap' [-Werror=missing-prototypes]
>   rte_vfio_dma_unmap(uint64_t __rte_unused vaddr, uint64_t __rte_unused
> iova,
>   ^
> 
> As there is no use for those dummy functions without VFIO removing them
> completely.
> 
> Fixes: 73a639085938 ("vfio: allow to map other memory regions")
> Cc: anatoly.burakov at intel.com
> 
> Signed-off-by: Shahaf Shuler <shahafs at mellanox.com>
> ---
>   lib/librte_eal/linuxapp/eal/eal_vfio.c | 16 ----------------
>   1 file changed, 16 deletions(-)
> 
> diff --git a/lib/librte_eal/linuxapp/eal/eal_vfio.c b/lib/librte_eal/linuxapp/eal/eal_vfio.c
> index 589d7d4787..4163bd4e08 100644
> --- a/lib/librte_eal/linuxapp/eal/eal_vfio.c
> +++ b/lib/librte_eal/linuxapp/eal/eal_vfio.c
> @@ -1529,20 +1529,4 @@ rte_vfio_noiommu_is_enabled(void)
>   	return c == 'Y';
>   }
>   
> -#else
> -
> -int __rte_experimental
> -rte_vfio_dma_map(uint64_t __rte_unused vaddr, __rte_unused uint64_t iova,
> -		  __rte_unused uint64_t len)
> -{
> -	return -1;
> -}
> -
> -int __rte_experimental
> -rte_vfio_dma_unmap(uint64_t __rte_unused vaddr, uint64_t __rte_unused iova,
> -		    __rte_unused uint64_t len)
> -{
> -	return -1;
> -}
> -
>   #endif
> 

These functions are part of public API, like rest of functions in this 
header. They're in the map file. Should we perhaps go the BSD way and 
provide EAL with dummy prototypes as well? See bsdapp/eal/eal.c:763 onwards.

-- 
Thanks,
Anatoly


More information about the dev mailing list