From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id E3B87C3B8 for ; Thu, 28 Jan 2016 11:03:08 +0100 (CET) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga102.fm.intel.com with ESMTP; 28 Jan 2016 02:03:08 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,358,1449561600"; d="scan'208";a="37644567" Received: from irsmsx104.ger.corp.intel.com ([163.33.3.159]) by fmsmga004.fm.intel.com with ESMTP; 28 Jan 2016 02:03:07 -0800 Received: from irsmsx109.ger.corp.intel.com ([169.254.13.100]) by IRSMSX104.ger.corp.intel.com ([163.33.3.159]) with mapi id 14.03.0248.002; Thu, 28 Jan 2016 10:03:06 +0000 From: "Burakov, Anatoly" To: Thomas Monjalon Thread-Topic: [dpdk-dev] [PATCH v5] vfio: Support for no-IOMMU mode Thread-Index: AQHRWSL6nBa7VduRNE+FbgXFqTzuEJ8PmAYAgAEYpnA= Date: Thu, 28 Jan 2016 10:03:06 +0000 Message-ID: References: <1453905124-28544-1-git-send-email-anatoly.burakov@intel.com> <1453913438-22991-1-git-send-email-anatoly.burakov@intel.com> <7496408.z4nt1qSYiL@xps13> In-Reply-To: <7496408.z4nt1qSYiL@xps13> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH v5] vfio: Support for no-IOMMU mode X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jan 2016 10:03:09 -0000 > 2016-01-27 16:50, Anatoly Burakov: > > --- a/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c > > +++ b/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c > > +int vfio_type1_dma_map(int); > > +int vfio_noiommu_dma_map(int); >=20 > WARNING:AVOID_EXTERNS: externs should be avoided in .c files I agree with > checkpatch, they should be static ;) >=20 Will fix that. > > --- 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 >=20 > Shouldn't it be defined privately in .c file? We already have other VFIO-related definitions in that file, specifically t= he PCI defines that aren't present in earlier kernels. This definition is s= imilar in nature - it will be present in kernels starting from 4.5 (when NO= IOMMU was introduced), but earlier kernels will need this defined. I didn't= want to go similar route with redefining everything VFIO-related, but mayb= e 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 >= =3D 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? Thanks, Anatoly