From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id B73B32A5F for ; Wed, 23 Dec 2015 03:00:14 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP; 22 Dec 2015 18:00:14 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,466,1444719600"; d="scan'208";a="622521031" Received: from yliu-dev.sh.intel.com (HELO yliu-dev) ([10.239.66.49]) by FMSMGA003.fm.intel.com with ESMTP; 22 Dec 2015 18:00:13 -0800 Date: Wed, 23 Dec 2015 10:01:35 +0800 From: Yuanhan Liu To: Peter Xu Message-ID: <20151223020135.GU18863@yliu-dev.sh.intel.com> 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=us-ascii Content-Disposition: inline In-Reply-To: <20151222095641.GH7532@pxdev.xzpeter.org> User-Agent: Mutt/1.5.23 (2014-03-12) 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: Wed, 23 Dec 2015 02:00:15 -0000 On Tue, Dec 22, 2015 at 05:56:41PM +0800, 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. Sorry, I simply overlook that. I was thinking it will quit here for the RTE_KDRV_UNKNOWN case. > I tried to run IO and it could work, > but I am not sure whether it is safe, and how. I also did a quick test then, however, with the virtio 1.0 patchset I sent before, which sets the RTE_PCI_DRV_NEED_MAPPING, resulting to pci_map_device() failure and virtio pmd is not initiated at all. > > 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. Why not? That's what the DPDK document asked to do (http://dpdk.org/doc/guides/linux_gsg/build_dpdk.html): 3.6. Binding and Unbinding Network Ports to/from the Kernel Modules As of release 1.4, DPDK applications no longer automatically unbind all supported network ports from the kernel driver in use. Instead, all ports that are to be used by an DPDK application must be bound to the uio_pci_generic, igb_uio or vfio-pci module before the application is run. Any network ports under Linux* control will be ignored by the DPDK poll-mode drivers and cannot be used by the application. --yliu