From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Burakov, Anatoly" Subject: Re: [PATCH] eal/vfio: export all VFIO functions when not compiling VFIO Date: Mon, 16 Apr 2018 13:05:51 +0100 Message-ID: References: <2776485.EdHvyZj5u1@xps> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org, Bruce Richardson , shahafs@mellanox.com, hemant.agrawal@nxp.com, gaetan.rivet@6wind.com To: Thomas Monjalon Return-path: Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 2484B1B023 for ; Mon, 16 Apr 2018 14:05:55 +0200 (CEST) In-Reply-To: <2776485.EdHvyZj5u1@xps> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 16-Apr-18 12:55 PM, Thomas Monjalon wrote: > 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? As it was, it was inside #ifdef VFIO_PRESENT. It can be at the top, or it can be where it is in this patch, not much difference. > > [...] >> +int __rte_experimental >> +rte_vfio_get_group_fd(__rte_unused int iommu_group_num) >> +{ >> + return -1; >> +} >> + >> #endif > > This #endif needs a comment. > Will do. -- Thanks, Anatoly