From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 2CAFB379E for ; Tue, 22 Dec 2015 12:39:23 +0100 (CET) Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 5DF80693C0; Tue, 22 Dec 2015 11:39:22 +0000 (UTC) Received: from pxdev.xzpeter.org (vpn1-6-183.pek2.redhat.com [10.72.6.183]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tBMBdEqN001294 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 22 Dec 2015 06:39:17 -0500 Date: Tue, 22 Dec 2015 19:39:12 +0800 From: Peter Xu To: "Xie, Huawei" Message-ID: <20151222113912.GA30780@pxdev.xzpeter.org> References: <20151222035041.GA7532@pxdev.xzpeter.org> <20151222070029.GO18863@yliu-dev.sh.intel.com> <20151222082338.GG7532@pxdev.xzpeter.org> <20151222083246.GT18863@yliu-dev.sh.intel.com> <20151222095641.GH7532@pxdev.xzpeter.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 Cc: DPDK Dev Subject: Re: [dpdk-dev] [Question] How pmd virtio works without UIO? 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: Tue, 22 Dec 2015 11:39:23 -0000 On Tue, Dec 22, 2015 at 10:47:21AM +0000, Xie, Huawei wrote: > On 12/22/2015 5:57 PM, Peter Xu wrote: > > On Tue, Dec 22, 2015 at 04:32:46PM +0800, Yuanhan Liu wrote: > >> Actually, you are right. I mentioned in the last email that this is > >> for configuration part. To answer your question in this email, you > >> will not be able to go that further (say initiating virtio pmd) if > >> you don't unbind the origin virtio-net driver, and bind it to igb_uio > >> (or something similar). > >> > >> The start point is from rte_eal_pci_scan, where the sub-function > >> pci_san_one just initates a DPDK bond driver. > > I am not sure whether I do understand your meaning correctly > > (regarding "you willl not be able to go that furture"): The problem > > is that, we _can_ run testpmd without unbinding the ports and bind > > to UIO or something. What we need to do is boot the guest, reserve > > huge pages, and run testpmd (keeping its kernel driver as > > "virtio-pci"). In pci_scan_one(): > > > > if (!ret) { > > if (!strcmp(driver, "vfio-pci")) > > dev->kdrv = RTE_KDRV_VFIO; > > else if (!strcmp(driver, "igb_uio")) > > dev->kdrv = RTE_KDRV_IGB_UIO; > > else if (!strcmp(driver, "uio_pci_generic")) > > dev->kdrv = RTE_KDRV_UIO_GENERIC; > > else > > dev->kdrv = RTE_KDRV_UNKNOWN; > > } else > > dev->kdrv = RTE_KDRV_UNKNOWN; > > > > I think it should be going to RTE_KDRV_UNKNOWN > > (driver=="virtio-pci") here. I tried to run IO and it could work, > > but I am not sure whether it is safe, and how. > > Good catch, peter. > Actually recently customers complain that with this feature, DPDK always > tries to take over this virtio-pci device, which is unwanted behavior. > Using blacklist could workaround this issue. > However, the real serious problem is that kernel driver is still > managing this device. > > Changchun, Thomas: > I think we should fix this, but firstly i wonder why using port IO to > get PCI resource is more secure. I am not familiar with this, however, shouldn't port IO from userspace the most dangerous way to access PCI resource? > > > > > Also, I am not sure whether I need to (at least) unbind the > > virtio-pci driver, so that there should have no kernel driver > > running for the virtio device before DPDK using it. > If you unbind, you have no entry under /proc/ioports for virtio IO port. I tried to unbind one of the virtio net device, I see the PCI entry still there. Before unbind: [root@vm proc]# lspci -k -s 00:03.0 00:03.0 Ethernet controller: Red Hat, Inc Virtio network device Subsystem: Red Hat, Inc Device 0001 Kernel driver in use: virtio-pci [root@vm proc]# cat /proc/ioports | grep c060-c07f c060-c07f : 0000:00:03.0 c060-c07f : virtio-pci After unbind: [root@vm proc]# lspci -k -s 00:03.0 00:03.0 Ethernet controller: Red Hat, Inc Virtio network device Subsystem: Red Hat, Inc Device 0001 [root@vm proc]# cat /proc/ioports | grep c060-c07f c060-c07f : 0000:00:03.0 So... does this means that it is an alternative to black list solution? Peter > > > > Thanks > > Peter > > > >> --yliu >