From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 882FA2A5F for ; Wed, 23 Dec 2015 03:08:45 +0100 (CET) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga101.jf.intel.com with ESMTP; 22 Dec 2015 18:08:29 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,466,1444719600"; d="scan'208";a="17946671" Received: from yliu-dev.sh.intel.com (HELO yliu-dev) ([10.239.66.49]) by fmsmga004.fm.intel.com with ESMTP; 22 Dec 2015 18:08:27 -0800 Date: Wed, 23 Dec 2015 10:09:49 +0800 From: Yuanhan Liu To: Peter Xu Message-ID: <20151223020949.GV18863@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> <20151222113912.GA30780@pxdev.xzpeter.org> <20151223015554.GC1694@pxdev.xzpeter.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151223015554.GC1694@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:08:45 -0000 On Wed, Dec 23, 2015 at 09:55:54AM +0800, Peter Xu wrote: > On Tue, Dec 22, 2015 at 04:38:30PM +0000, Xie, Huawei wrote: > > On 12/22/2015 7:39 PM, Peter Xu wrote: > > > 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? > > Oh, we could firstly check if this port is manipulated by kernel driver > > in virtio_resource_init/eth_virtio_dev_init, as long as it is not too late. Why can't we simply quit at pci_scan_one, once finding that it's not bond to uio (or similar stuff)? That would be generic enough, that we don't have to do similar checks for each new pmd driver. Or, am I missing something? > I guess there might be two problems? Which are: > > 1. How user avoid DPDK taking over virtio devices that they do not > want for IO (chooses which device to use) Isn't that what's the 'binding/unbinding' for? > 2. Driver conflict between virtio PMD in DPDK, and virtio-pci in > kernel (happens on every virtio device that DPDK uses) If you unbinded the kernel driver first, which is the suggested (or must?) way to use DPDK, that will not happen. --yliu > > For the white/black list solution, I guess it's good enough to solve > (1) for customers. I am just curious about the 2nd. > > Or say, even we black listed some virtio devices (or doing white > list), the virtio devices used by DPDK are still in danger if we > cannot make sure that virtio-pci will not touch the device any more > (even it will not touch it, it feels like errornous to not telling > virtio-pci to remove it before hand). E.g., if virtio-pci interrupt > is still working, when there are packets from outside to guest, > vp_interrupt() might be called? Then virtio-pci driver might do > read/write to vring as well? If so, that's problematic. Am I wrong? > > Peter