From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v5] vfio: Support for no-IOMMU mode Date: Thu, 28 Jan 2016 14:27:28 +0100 Message-ID: <11561920.qTvBVVv5us@xps13> References: <1453905124-28544-1-git-send-email-anatoly.burakov@intel.com> <7496408.z4nt1qSYiL@xps13> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org To: "Burakov, Anatoly" Return-path: Received: from mail-wm0-f53.google.com (mail-wm0-f53.google.com [74.125.82.53]) by dpdk.org (Postfix) with ESMTP id 1B8EDC45A for ; Thu, 28 Jan 2016 14:28:40 +0100 (CET) Received: by mail-wm0-f53.google.com with SMTP id p63so24740291wmp.1 for ; Thu, 28 Jan 2016 05:28:40 -0800 (PST) In-Reply-To: List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 2016-01-28 10:03, Burakov, Anatoly: > > 2016-01-27 16:50, Anatoly Burakov: > > > --- a/lib/librte_eal/linuxapp/eal/eal_vfio.h > > > +++ b/lib/librte_eal/linuxapp/eal/eal_vfio.h > > > +/* older kernels may not have no-IOMMU mode */ #ifndef > > > +VFIO_NOIOMMU_IOMMU #define VFIO_NOIOMMU_IOMMU 8 #endif > > > > Shouldn't it be defined privately in .c file? > > We already have other VFIO-related definitions in that file, specifically the PCI defines that aren't present in earlier kernels. This definition is similar in nature - it will be present in kernels starting from 4.5 (when NOIOMMU was introduced), but earlier kernels will need this defined. I didn't want to go similar route with redefining everything VFIO-related, but maybe it makes sense in this case for consistency's sake? E.g. > > #define RTE_VFIO_TYPE1 VFIO_TYPE1_IOMMU [we're already in an ifdef linux >= 3.6, so define type1 unconditionally] > #if linux < 4.5 > #define RTE_VFIO_NOIOMMU 8 > #else > #define RTE_VFIO_NOIOMMU VFIO_NOIOMMU_IOMMU > #endif > > Or something like that? OK you can keep it as is or define a RTE constant. Up to you.