From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi0-f44.google.com (mail-oi0-f44.google.com [209.85.218.44]) by dpdk.org (Postfix) with ESMTP id A08572C16 for ; Fri, 26 Feb 2016 09:29:08 +0100 (CET) Received: by mail-oi0-f44.google.com with SMTP id k67so917104oia.3 for ; Fri, 26 Feb 2016 00:29:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=GxovLUZG+2pQFeql5aNOd9KFuy9di80y9+qL5ffL72Y=; b=TCTpfgIddfgJcxmALcHQdlrsKXnXTZ4Un8E7SHjdRkrVzsFX9Tp1MpCK8iAQ+KHlo/ fOgH4EFIC+/j4Fto2i5/n8iphJjcylYXXpablIv+AEk55H6ap/EQ4bhkbksuoQFRomPY AJkq0XxhecFL5jt3f+mVu9GozlbUgPw3Ml4nFoaAFKla7eWtt6E8EMgOw9ylg6i1S9+n xjG2C76JGWDoOs+IHlZNDQqZ4oZsVMJCpHasoZ0egsZu3bG+v0/+e+d3UrTkqcg98vaB 20EOCBnTqIZxaQbO7uhy+qg32Pqfj1f6r2d/OBCflbcHKniFc9ScZ0B5OpKIlSUPzX3/ ConA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=GxovLUZG+2pQFeql5aNOd9KFuy9di80y9+qL5ffL72Y=; b=bGRAZK+V2dEYhllSJbFi+HOchdVt0mXLTjtqEW5V+05+wLB2ul5SEuJ6tySCewNvUz Es8Sqp84fcH9Th0wbojWpk/fxiJNB8F1XiTPEwfKId+qALtgyDNpU5f+M306H5TZ8Wfz K+6toDo1xRXykPVksEz47m/xKewlOBaSBLPgISB37cG9zSefG9THq9gx6e4gOGQjiKdJ egVmfSwFXDdjGwY8V5JIWOho6wbt4QiF6Nsw38P5t3CVSaptUa/WigJvTz+2hvIf5PjG +nXcsyUdFOvNOsZevGmjmHjfezu94Ze2tymBjp9QNlA6PgoxCauHGSHs5l6wEsPtroMQ 91gw== X-Gm-Message-State: AD7BkJJ1EqR8kZG9I2Z0Dej5FuZ9h835RQlqGyX3O2+aNF89EsWIj743Hi47cHbs7/uSg8MFQQ5fJEn8s/GC105Z X-Received: by 10.202.74.132 with SMTP id x126mr212283oia.22.1456475348165; Fri, 26 Feb 2016 00:29:08 -0800 (PST) MIME-Version: 1.0 Received: by 10.76.180.72 with HTTP; Fri, 26 Feb 2016 00:28:48 -0800 (PST) In-Reply-To: <20160226022358.GG14300@yliu-dev.sh.intel.com> References: <20160226022358.GG14300@yliu-dev.sh.intel.com> From: David Marchand Date: Fri, 26 Feb 2016 09:28:48 +0100 Message-ID: To: Yuanhan Liu Content-Type: text/plain; charset=UTF-8 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] virtio PMD is not working with master version 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, 26 Feb 2016 08:29:09 -0000 On Fri, Feb 26, 2016 at 3:23 AM, Yuanhan Liu wrote: > Mauricio, thanks for the testing and report. > > On Thu, Feb 25, 2016 at 02:30:18PM +0100, David Marchand wrote: >> >From the logs, I would say I broke uio_pci_generic since we are in >> "uio" case, but uio portio sysfs does not exist. >> virtio pmd fell back to ioports discovery before my change. > > Maybe we can do same? I suppose, but see below. > > --- > diff --git a/lib/librte_eal/linuxapp/eal/eal_pci.c b/lib/librte_eal/linuxapp/eal/eal_pci.c > index 4346973..579731c 100644 > --- a/lib/librte_eal/linuxapp/eal/eal_pci.c > +++ b/lib/librte_eal/linuxapp/eal/eal_pci.c > @@ -685,12 +685,11 @@ int > rte_eal_pci_ioport_map(struct rte_pci_device *dev, int bar, > struct rte_pci_ioport *p) > { > - int ret; > + int ret = -1; > > switch (dev->kdrv) { > #ifdef VFIO_PRESENT > case RTE_KDRV_VFIO: > - ret = -1; > if (pci_vfio_is_enabled()) > ret = pci_vfio_ioport_map(dev, bar, p); > break; > @@ -700,14 +699,14 @@ rte_eal_pci_ioport_map(struct rte_pci_device *dev, int bar, > ret = pci_uio_ioport_map(dev, bar, p); > break; > default: > + break; > + } > + > #if defined(RTE_ARCH_X86_64) || defined(RTE_ARCH_I686) > - /* special case for x86 ... */ > + /* special case for x86 ... */ > + if (ret) > ret = pci_ioport_map(dev, bar, p); > -#else > - ret = -1; > #endif > - break; > - } What if we are supposed to do vfio here, but for some reason init failed ? Next thing, we will call ioport_read in vfio context, but init went through the ioports parsing => boom ? Another issue is that when device is bound to a kernel driver (let's say virtio-pci here), then init will succeed and pmd will kick in the device registers. This special case should really be narrowed down to "uio" and "none" driver cases. -- David Marchand