From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f174.google.com (mail-wi0-f174.google.com [209.85.212.174]) by dpdk.org (Postfix) with ESMTP id 5E0A7E72 for ; Fri, 10 Jul 2015 14:17:12 +0200 (CEST) Received: by wifm2 with SMTP id m2so44821302wif.1 for ; Fri, 10 Jul 2015 05:17:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type; bh=EQbOamE3GCyv4XH3MuH4PsXIc0H3EK0Xp4rq+P64UNE=; b=AAh8LGhFdZSvqdDiSAdfch/FwK4/l7Vy0/tzzu4/YKCtMxpo4QKQMFPVykLzAxvbka gIFKvv6fh/jwEgy66eKg91Lg4eoxVBm47W2Tr8ky8ynhRCrwzs+C9qSh/PCRrv7RVoe3 2k4iL5M2R4RKLpANYL+EpJmoHJfdIClJ2TEklfb05iMu1JMTxB+0cQk91mYAVsnwftG/ Q36j1O10CFptp1M2RvNLNr5+xbKQMfs5CHM6iKDAGHBjUaEE215AXhbnJl+Pck+PP1Id /ofnlbO/bd6rhji9RZGb93OaG/mbyPfNxX7buiR6KsBqOCrXnUSWg79eWf3WKqvY2TPI z28g== X-Gm-Message-State: ALoCoQn+zw77eOGLsQJIaDDRiMSUaZPq+kcq9+JsuxFETxkLgFR5xSr3nG8ldbpJdEFuzEG4ECj1 X-Received: by 10.194.179.167 with SMTP id dh7mr41995661wjc.15.1436530632124; Fri, 10 Jul 2015 05:17:12 -0700 (PDT) Received: from xps13.localnet (136-92-190-109.dsl.ovh.fr. [109.190.92.136]) by smtp.gmail.com with ESMTPSA id az1sm8081939wib.0.2015.07.10.05.17.10 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Jul 2015 05:17:11 -0700 (PDT) From: Thomas Monjalon To: Bruce Richardson , David Marchand , michael.qiu@intel.com, Tetsuya Mukawa Date: Fri, 10 Jul 2015 14:16:03 +0200 Message-ID: <26119720.PorKJiMAo6@xps13> Organization: 6WIND User-Agent: KMail/4.14.8 (Linux/4.0.4-2-ARCH; KDE/4.14.8; x86_64; ; ) In-Reply-To: <20150710113826.GA10608@bricha3-MOBL3> References: <1436514439-4893-1-git-send-email-michael.qiu@intel.com> <20150710113826.GA10608@bricha3-MOBL3> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH] BugFix: VFIO never works 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, 10 Jul 2015 12:17:12 -0000 2015-07-10 12:38, Bruce Richardson: > On Fri, Jul 10, 2015 at 01:25:49PM +0200, David Marchand wrote: > > On Fri, Jul 10, 2015 at 10:34 AM, Tetsuya Mukawa wrote: > > > On 2015/07/10 16:47, Michael Qiu wrote: > > > > Commit 35b3313e322b ("pci: merge mapping functions for linux and bsd") > > > > > > > > introduced a bug that all vfio will be > > > > blocked. > > > > > > > > Root cause is that VFIO_PRESENT is unaccessable in eal > > > > common level. > > > > > > > > This patch is to fix this. > > > > > > > > Signed-off-by: Michael Qiu [...] > > > > --- a/lib/librte_eal/common/eal_common_pci.c > > > > +++ b/lib/librte_eal/common/eal_common_pci.c > > > > @@ -146,10 +146,8 @@ pci_map_device(struct rte_pci_device *dev) > > > > /* try mapping the NIC resources using VFIO if it exists */ > > > > switch (dev->kdrv) { > > > > case RTE_KDRV_VFIO: > > > > -#ifdef VFIO_PRESENT > > > > if (pci_vfio_is_enabled()) > > > > ret = pci_vfio_map_resource(dev); > > > > -#endif > > > > > > > This is a common file, vfio is not available on BSD. > > I missed that during review. > > > > Did you test build on BSD ? > > > Just tried it. BSD build fails with this patch applied. > > Rather than using ifdefs, we could also look at providing dummy functions for > vfio in BSD. They would never be called by this code as drivers in BSD should > never have dev->kdrv == RTE_KDRV_VFIO. Why not implementing different versions of pci_map_device() and pci_unmap_device() in linuxapp and bsdapp EAL? They are only wrappers so no code would be duplicated.