From mboxrd@z Thu Jan 1 00:00:00 1970 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) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Apr 2018 05:05:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,459,1517904000"; d="scan'208";a="48249093" Received: from aburakov-mobl.ger.corp.intel.com (HELO [10.237.220.128]) ([10.237.220.128]) by orsmga001.jf.intel.com with ESMTP; 16 Apr 2018 05:05:52 -0700 To: Thomas Monjalon Cc: dev@dpdk.org, Bruce Richardson , shahafs@mellanox.com, hemant.agrawal@nxp.com, gaetan.rivet@6wind.com References: <2776485.EdHvyZj5u1@xps> From: "Burakov, Anatoly" Message-ID: Date: Mon, 16 Apr 2018 13:05:51 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <2776485.EdHvyZj5u1@xps> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] eal/vfio: export all VFIO functions when not compiling VFIO X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Apr 2018 12:05:56 -0000 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