From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id ED4172A5F for ; Tue, 22 Dec 2015 09:33:26 +0100 (CET) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 22 Dec 2015 00:33:27 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,463,1444719600"; d="scan'208";a="867129710" Received: from yliu-dev.sh.intel.com (HELO yliu-dev) ([10.239.66.49]) by fmsmga001.fm.intel.com with ESMTP; 22 Dec 2015 00:31:31 -0800 Date: Tue, 22 Dec 2015 16:32:46 +0800 From: Yuanhan Liu To: Peter Xu Message-ID: <20151222083246.GT18863@yliu-dev.sh.intel.com> References: <20151222035041.GA7532@pxdev.xzpeter.org> <20151222070029.GO18863@yliu-dev.sh.intel.com> <20151222082338.GG7532@pxdev.xzpeter.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151222082338.GG7532@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: Tue, 22 Dec 2015 08:33:27 -0000 On Tue, Dec 22, 2015 at 04:23:38PM +0800, Peter Xu wrote: > On Tue, Dec 22, 2015 at 03:00:29PM +0800, Yuanhan Liu wrote: > > On Tue, Dec 22, 2015 at 11:50:41AM +0800, Peter Xu wrote: > > > Hi, > > > > > > I got a question related to how virtio pmd driver work without > > > UIO layer. > > > > > > I see that in virtio PMD driver, DPDK will first try to init the > > > device using UIO interfaces. If it fails, it will try to init by > > > manipulating IO ports directly (see virtio_resource_init()). > > > > > > For the ioport case, is it okay to do it like this? E.g., in > > > eth_virtio_dev_init(), we are resetting the virtio device, however, > > > this device should still be owned by virtio-pci driver in the > > > kernel. > > > > > > How is that working? Did I miss anything? > > > > That's for configuration part: as far as we can read/write the right > > PCI port, virtio pmd configuration will work. Note that on this case, > > uio just provides another way to tell you where the port is. > > Will there be any conflict? For example, when we start testpmd in > the guest without UIO (now, guest virtio net device is using > virtio-pci driver), we directly do read/write to IO ports of the > virtio device, reset it, and configure it. During the time, > virtio-pci driver of the virtio device should be still working (we > could see it by doing lspci -k), never knowing that the device is > reset. So... It seems like that both DPDK and virtio-pci are > manipulating the device. After that, for example, when host trigger > interrupt for guest vring, who (DPDK or virtio-pci) will handle it? > > I would understand if we unbind the virtio-pci driver before taking > over the device. But it seems not. 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. --yliu