From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <thomas@monjalon.net>
Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com
 [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id B78F91B308
 for <dev@dpdk.org>; Mon, 30 Oct 2017 10:27:23 +0100 (CET)
Received: from compute1.internal (compute1.nyi.internal [10.202.2.41])
 by mailout.nyi.internal (Postfix) with ESMTP id 3C2AF20A96;
 Mon, 30 Oct 2017 05:27:23 -0400 (EDT)
Received: from frontend2 ([10.202.2.161])
 by compute1.internal (MEProxy); Mon, 30 Oct 2017 05:27:23 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h=
 cc:content-transfer-encoding:content-type:date:from:in-reply-to
 :message-id:mime-version:references:subject:to:x-me-sender
 :x-me-sender:x-sasl-enc; s=mesmtp; bh=Lx8+rWnvYcKXYrLRMoKbOkedMZ
 /XLstHwYWV2n6/72Q=; b=mNiWklcRAAyqsMbmkF9iVH2VW2U7T1jKtHYdXy2iMW
 Onn9HSPb7q/AyqdMcfZ5dQ2GCQJ1Z+8JjVLBgxTdOlyIULfHj0PEL5BMVvcne8Mj
 GW4TwyzkiNMTR9+XgucnOdcOx8cRC7rXf8WB/LbjiO7N9ovBjo4HU4+0VsuyxI0K
 I=
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:content-transfer-encoding:content-type
 :date:from:in-reply-to:message-id:mime-version:references
 :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=Lx8+rW
 nvYcKXYrLRMoKbOkedMZ/XLstHwYWV2n6/72Q=; b=MfUaQgxNR1RSYViNC0ZJX9
 T36E9SuFvMnToVk/Oir4tiMveE3yYMF127ZikYfEYvEWwS0a3WDO+m27DAQkYXy7
 eiTu0qSi/Uv8K+JGcTJ2Z3x/yRFg494t8UXZ28Be44Kjh+n2L6sA6H+QMeVnv1VS
 0xXsRnHW5WDwr4VfbFBiXOytGein8eW+jEmgAT7QGoIhj3wQhchHWsswL0PuFc4G
 9kW1l2j/QFpN+sxLpHyLMhdkfiW9c+dIuqJ1HxJkiO2U5sDHJDLy2JXQCFrK8e2l
 B8es0F9SbUX04l9deWp1jRkgX/RbfD6S2856wqkdjPRsLCsOjjYRSL1BcnBOIuJQ
 ==
X-ME-Sender: <xms:e_D2WTgke61hIP1QhTj6r-pCGCsCINKWa2hvYtNkK1rgc3C4vEepcw>
Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184])
 by mail.messagingengine.com (Postfix) with ESMTPA id DC49824335;
 Mon, 30 Oct 2017 05:27:22 -0400 (EDT)
From: Thomas Monjalon <thomas@monjalon.net>
To: =?ISO-8859-1?Q?Ga=EBtan?= Rivet <gaetan.rivet@6wind.com>,
 Ferruh Yigit <ferruh.yigit@intel.com>
Cc: Jerin Jacob <jerin.jacob@caviumnetworks.com>, dev@dpdk.org
Date: Mon, 30 Oct 2017 10:27:22 +0100
Message-ID: <3786691.UAh344p4j6@xps>
In-Reply-To: <20171030091736.GH10890@bidouze.vm.6wind.com>
References: <20171028062053.6615-1-jerin.jacob@caviumnetworks.com>
 <6e9922c5-9659-a42a-4213-700ebe1e5714@intel.com>
 <20171030091736.GH10890@bidouze.vm.6wind.com>
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="iso-8859-1"
Subject: Re: [dpdk-dev] [PATCH] bus/pci: fix vfio mode
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Mon, 30 Oct 2017 09:27:24 -0000

30/10/2017 10:17, Ga=EBtan Rivet:
> Hi Ferruh,
>=20
> On Mon, Oct 30, 2017 at 02:00:43AM -0700, Ferruh Yigit wrote:
> > On 10/30/2017 1:06 AM, Ga=EBtan Rivet wrote:
> > > Hi Jerin,
> > >=20
> > > On Sat, Oct 28, 2017 at 11:50:52AM +0530, Jerin Jacob wrote:
> > >> The definition of VFIO_PRESENT is "eal_vfio.h", Fail to
> > >> include eal_vfio.h will result in disabling vfio.
> > >>
> > >> Fixes: 279b581c897d ("vfio: expose functions")
> > >>
> > >=20
> > > Thanks for the fix, sorry for VFIO.
> > > I tried to let go of VFIO_PRESENT in the PCI patchset, unfortunately =
I did
> > > not do a good-enough job.
> > >=20
> > > Instead of reinstating the dependency on the private eal_vfio.h heade=
r,
> > > I'd suggest replacing all VFIO_PRESENT references within the PCI bus =
by
> > > RTE_EAL_VFIO, and make the pci_vfio.c compilation depend on it within
> > > the linux Makefile. Something like:
> > >=20
> > > ---8<---
> > >=20
> > > grep -rl VFIO_PRESENT drivers/bus/pci/linux/ |while read -r file
> > > do sed -i 's;VFIO_PRESENT;RTE_EAL_VFIO;' $file
> > > done
> >=20
> > VFIO_PRESENT is the combination of the if user enabled VFIO and if Linu=
x kernel
> > supports it.
> >=20
> > Why not add same check and VFIO_PRESENT definition to rte_vfio.h:
> >=20
> >   --- a/lib/librte_eal/common/include/rte_vfio.h
> >   +++ b/lib/librte_eal/common/include/rte_vfio.h
> >   @@ -34,7 +34,13 @@
> >    #ifndef _RTE_VFIO_H_
> >    #define _RTE_VFIO_H_
> >=20
> >   +#if !defined(VFIO_PRESENT) && defined(RTE_EAL_VFIO)
> >   +#include <linux/version.h>
> >   +#if LINUX_VERSION_CODE >=3D KERNEL_VERSION(3, 6, 0)
> >    #include <linux/vfio.h>
> >   +#define VFIO_PRESENT
> >   +#endif /* >=3D 3.6.0 */
> >   +#endif
> >   +
> >   +#ifdef VFIO_PRESENT
> >=20
> >   ... Need to wrap here in case VFIO disabled ...
> >=20
> >   #endif
> >=20
>=20
> It would work indeed.
>=20
> I mostly dislike having whole compilation units disabled silently on a
> linux version check. I think that if someone wanted to support kernels <
> 3.6, they ought to do the work of disabling RTE_EAL_VFIO.
>=20
> A build error could be thrown to help those users toward the right
> solution, but I think that the meaning of having this option enabled
> should be enforced: if it is enabled, it is compiled. If dependencies
> are not met, then the option should be disabled.

+1 to avoid implicit disabling.