From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH] eal/vfio: export all VFIO functions when not compiling VFIO Date: Mon, 16 Apr 2018 13:55:35 +0200 Message-ID: <2776485.EdHvyZj5u1@xps> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org, Bruce Richardson , shahafs@mellanox.com, hemant.agrawal@nxp.com, gaetan.rivet@6wind.com To: Anatoly Burakov Return-path: Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id C18A97D30 for ; Mon, 16 Apr 2018 13:55:37 +0200 (CEST) In-Reply-To: List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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.