From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH] vfio: allow to map other memory regions Date: Wed, 28 Jun 2017 13:50:46 +0200 Message-ID: <8830088.21c9ZRnMaC@xps> References: <1495547976-96270-1-git-send-email-pawelx.wodkowski@intel.com> <2829321.iV2IKkVC0J@xps> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org To: "Wodkowski, PawelX" Return-path: Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by dpdk.org (Postfix) with ESMTP id 8F83A2C13 for ; Wed, 28 Jun 2017 13:50:48 +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" 28/06/2017 11:54, Wodkowski, PawelX: > > -----Original Message----- > > From: Thomas Monjalon [mailto:thomas@monjalon.net] > > Sent: Monday, June 19, 2017 11:04 PM > > To: Wodkowski, PawelX > > Cc: dev@dpdk.org > > Subject: Re: [dpdk-dev] [PATCH] vfio: allow to map other memory regions > > > > Hi, > > Some comments below > > > > 24/05/2017 13:17, Pawel Wodkowski: > > > Currently it is not possible to use memory that is not owned by DPDK to > > > perform DMA. This scenarion might be used in vhost applications (like > > > SPDK) where guest send its own memory table. To fill this gap provide > > > API to allow registering arbitrary address in VFIO container. > > > > > > Signed-off-by: Pawel Wodkowski > > > --- > > > lib/librte_eal/linuxapp/eal/Makefile | 3 + > > > lib/librte_eal/linuxapp/eal/eal_vfio.c | 142 > > +++++++++++++++++++++--- > > > lib/librte_eal/linuxapp/eal/eal_vfio.h | 10 ++ > > > lib/librte_eal/linuxapp/eal/include/rte_iommu.h | 78 +++++++++++++ > > > lib/librte_eal/linuxapp/eal/rte_eal_version.map | 8 ++ > > > 5 files changed, 224 insertions(+), 17 deletions(-) > > > create mode 100644 lib/librte_eal/linuxapp/eal/include/rte_iommu.h > > > > VFIO is not referenced in the doxygen of these functions. > > Could we use this API for something else than VFIO? > > This is for any IOMMU hw/module/driver used in host which require special > care about memory regions used for DMA. It is not restricted to VFIO even though > only VFIO is implemented. > > > > > Any API should be declared in common directory, even if it is not > > implemented for FreeBSD (returning -ENOTSUP). > > I think those function should be NOP for FreeBSD (like RTE_VFIO_NOIOMMU do) > or be conditionally compiled/included (like it is now). I decide to take second way. > Do you think that I should move rte_iommu.h to common directory and use #ifdef > there? No #ifdef please. You must define new functions in a common header and implement it for Linux and BSD. The BSD function can be return an error.