From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.tuxdriver.com (charlotte.tuxdriver.com [70.61.120.58]) by dpdk.org (Postfix) with ESMTP id EE7DA5927 for ; Fri, 28 Nov 2014 15:56:14 +0100 (CET) Received: from cpe-098-026-066-094.nc.res.rr.com ([98.26.66.94] helo=localhost) by smtp.tuxdriver.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.63) (envelope-from ) id 1XuMxs-0006lE-9S; Fri, 28 Nov 2014 09:56:10 -0500 Date: Fri, 28 Nov 2014 09:56:06 -0500 From: Neil Horman To: "Qiu, Michael" Message-ID: <20141128145606.GA7736@localhost.localdomain> References: <1417108480-28341-1-git-send-email-ssujith@cisco.com> <533710CFB86FA344BFBF2D6802E60286C9B11F@SHSMSX101.ccr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <533710CFB86FA344BFBF2D6802E60286C9B11F@SHSMSX101.ccr.corp.intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Score: -2.9 (--) X-Spam-Status: No Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH] enicpmd: compilation error during inclusion of vfio.h 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: Fri, 28 Nov 2014 14:56:15 -0000 On Fri, Nov 28, 2014 at 02:09:40AM +0000, Qiu, Michael wrote: > Hi all, > > I have no comments on this issue, but I indeed see many places do have > this kernel issue(before/now/future), so can solve this issue globally? > > Thus, we do not need to fix this case by case. > > One solution(not sure if it works or not): > > 1. features and kernel version required list. > 2. When config DPDK before build, automatically check this list and if > not mach, just disable this feature in config file even though user set > it manually. > Instead of enumerating a kernel version, this should be designed as an enumeration of feature sets. That way you can enable DPDK features based on kernel feature availability (i.e. kernel version doesn't necessecarily imply feature set, like when a distribution backports a given feature to an older kernel. What would really make the most sense I think is to convert the configuration system to autoconf/automake, so that these tests can be preformed at config time. Neil > Thus main code may not need to change. > > Does this works? > > Thanks, > Michael > > On 11/28/2014 1:16 AM, Sujith Sankar wrote: > > Inclusion of vfio.h was giving compilation errors if kernel version is less > > than 3.6.0 and if RTE_EAL_VFIO was on in config. > > > > Replaced inclusion of vfio.h with eal_vfio.h and replaced RTE_EAL_VFIO with > > VFIO_PRESENT in enicpmd code. > > > > Signed-off-by: Sujith Sankar > > --- > > lib/librte_pmd_enic/Makefile | 1 + > > lib/librte_pmd_enic/enic_main.c | 13 +++++-------- > > 2 files changed, 6 insertions(+), 8 deletions(-) > > > > diff --git a/lib/librte_pmd_enic/Makefile b/lib/librte_pmd_enic/Makefile > > index d4c2f66..befc552 100644 > > --- a/lib/librte_pmd_enic/Makefile > > +++ b/lib/librte_pmd_enic/Makefile > > @@ -39,6 +39,7 @@ LIB = librte_pmd_enic.a > > > > CFLAGS += -I$(RTE_SDK)/lib/librte_hash/ -I$(RTE_SDK)/lib/librte_pmd_enic/vnic/ > > CFLAGS += -I$(RTE_SDK)/lib/librte_pmd_enic/ > > +CFLAGS += -I$(RTE_SDK)/lib/librte_eal/linuxapp/eal/ > > CFLAGS += -O3 -Wno-deprecated > > > > VPATH += $(RTE_SDK)/lib/librte_pmd_enic/src > > diff --git a/lib/librte_pmd_enic/enic_main.c b/lib/librte_pmd_enic/enic_main.c > > index 4b857bb..f6f00d3 100644 > > --- a/lib/librte_pmd_enic/enic_main.c > > +++ b/lib/librte_pmd_enic/enic_main.c > > @@ -39,9 +39,6 @@ > > #include > > #include > > #include > > -#ifdef RTE_EAL_VFIO > > -#include > > -#endif > > > > #include > > #include > > @@ -631,7 +628,7 @@ int enic_enable(struct enic *enic) > > > > vnic_dev_enable_wait(enic->vdev); > > > > -#ifndef RTE_EAL_VFIO > > +#ifndef VFIO_PRESENT > > /* Register and enable error interrupt */ > > rte_intr_callback_register(&(enic->pdev->intr_handle), > > enic_intr_handler, (void *)enic->rte_dev); > > @@ -995,7 +992,7 @@ int enic_setup_finish(struct enic *enic) > > return 0; > > } > > > > -#ifdef RTE_EAL_VFIO > > +#ifdef VFIO_PRESENT > > static void enic_eventfd_init(struct enic *enic) > > { > > enic->eventfd = enic->pdev->intr_handle.fd; > > @@ -1033,7 +1030,7 @@ int enic_get_link_status(struct enic *enic) > > } > > > > > > -#ifdef RTE_EAL_VFIO > > +#ifdef VFIO_PRESENT > > static int enic_create_err_intr_thread(struct enic *enic) > > { > > pthread_attr_t intr_attr; > > @@ -1111,7 +1108,7 @@ static void enic_dev_deinit(struct enic *enic) > > if (eth_dev->data->mac_addrs) > > rte_free(eth_dev->data->mac_addrs); > > > > -#ifdef RTE_EAL_VFIO > > +#ifdef VFIO_PRESENT > > enic_clear_intr_mode(enic); > > #endif > > } > > @@ -1167,7 +1164,7 @@ static int enic_dev_init(struct enic *enic) > > */ > > enic_get_res_counts(enic); > > > > -#ifdef RTE_EAL_VFIO > > +#ifdef VFIO_PRESENT > > /* Set interrupt mode based on resource counts and system > > * capabilities > > */ > >