From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yuanhan Liu Subject: Re: virtio PMD is not working with master version Date: Fri, 26 Feb 2016 10:23:58 +0800 Message-ID: <20160226022358.GG14300@yliu-dev.sh.intel.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Cc: "dev@dpdk.org" To: David Marchand Return-path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 5D1212BBB for ; Fri, 26 Feb 2016 03:23:39 +0100 (CET) Content-Disposition: inline In-Reply-To: List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Mauricio, thanks for the testing and report. On Thu, Feb 25, 2016 at 02:30:18PM +0100, David Marchand wrote: > On Thu, Feb 25, 2016 at 12:30 PM, Mauricio V=E1squez > wrote: > > ... > > EAL: PCI device 0000:00:04.0 on NUMA socket -1 > > EAL: probe driver: 1af4:1000 rte_virtio_pmd > > EAL: PCI memory mapped at 0x7f892dc00000 > > PMD: virtio_read_caps(): [40] skipping non VNDR cap id: 11 > > PMD: virtio_read_caps(): no modern virtio pci device found. > > PMD: vtpci_init(): trying with legacy virtio pci. > > EAL: eal_parse_sysfs_value(): cannot open sysfs value > > /sys/bus/pci/devices/0000:00:04.0/uio/uio0/portio/port0/start > > EAL: pci_uio_ioport_map(): cannot parse portio start > > EAL: Error - exiting with code: 1 > > Cause: Requested device 0000:00:04.0 cannot be used > > ... >=20 > [snip] >=20 > > ... > > PMD: parse_sysfs_value(): parse_sysfs_value(): cannot open sysfs valu= e > > /sys/bus/pci/devices/0000:00:04.0/uio/uio0/portio/port0/size > > PMD: virtio_resource_init_by_uio(): virtio_resource_init_by_uio(): ca= nnot > > parse size > > PMD: virtio_resource_init_by_ioports(): PCI Port IO found start=3D0xc= 100 with > > size=3D0x20 >=20 > [snip] >=20 > > > > According to git bisect it appears to be that it does not work anymor= e after > > the b8f04520ad71 ("virtio: use PCI ioport API") commit. >=20 > >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? --- diff --git a/lib/librte_eal/linuxapp/eal/eal_pci.c b/lib/librte_eal/linux= app/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 =3D -1; =20 switch (dev->kdrv) { #ifdef VFIO_PRESENT case RTE_KDRV_VFIO: - ret =3D -1; if (pci_vfio_is_enabled()) ret =3D 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 =3D 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 =3D pci_ioport_map(dev, bar, p); -#else - ret =3D -1; #endif - break; - } =20 if (!ret) p->dev =3D dev; ------------------------------------------------------- If that looks okay to you, I could send a formal patch. --yliu > Problem can be workaround for now by unbinding your device from > uio_pci_generic or on the contrary bind to igb_uio. >=20 > I've been sick at home, all this week. > Will see next week for a fix unless someone sends one. >=20 >=20 > --=20 > David Marchand