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 A3A066A8B for ; Wed, 10 Dec 2014 08:12:48 +0100 (CET) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 09 Dec 2014 23:12:47 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.07,551,1413270000"; d="scan'208";a="635401930" Received: from pgsmsx107.gar.corp.intel.com ([10.221.44.105]) by fmsmga001.fm.intel.com with ESMTP; 09 Dec 2014 23:12:46 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by PGSMSX107.gar.corp.intel.com (10.221.44.105) with Microsoft SMTP Server (TLS) id 14.3.195.1; Wed, 10 Dec 2014 15:12:29 +0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.110]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.5]) with mapi id 14.03.0195.001; Wed, 10 Dec 2014 15:12:28 +0800 From: "Qiu, Michael" To: Aashima Arora , "dev@dpdk.org" Thread-Topic: [dpdk-dev] Accessing a Virtual Function Driver in Guest Machine via VFIO Thread-Index: AQHQEL3VsTx7MvhW60qFHdtjacQKzA== Date: Wed, 10 Dec 2014 07:12:27 +0000 Message-ID: <533710CFB86FA344BFBF2D6802E60286C9E62D@SHSMSX101.ccr.corp.intel.com> References: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] Accessing a Virtual Function Driver in Guest Machine via VFIO 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, 10 Dec 2014 07:12:49 -0000 On 12/6/2014 3:01 AM, Aashima Arora wrote:=0A= > Hi,=0A= > I was trying to access the pci config space(BAR) of the virtual function= =0A= > device visible in the virtual machine, similar to what DPDK does on host= =0A= > via both UIO and VFIO. Did the following steps.=0A= >=0A= > 1. Bound PF Drivers to ixgbe and spawned virtual function drivers , bound= =0A= > them to vfio-pci and set their mac addresses via ip link. Ran Qemu and= =0A= > assigned the VF Device using vfio-pci device assignment and initialized t= he=0A= > virtual machine.=0A= > insmod igb max_vfs=3D2=0A= >=0A= > ./x86_64-softmmu/qemu-system-x86_64 -cpu host -boot c -hda=0A= > /home/vm-images/vm2.imgsnapshot -m 2048M -smp 2 --enable-kvm -name 'vm2'= =0A= > -vnc :2 -pidfile /tmp/vm2.pid -driile=3Dfat:rw:/tmp/share,snapshot=3Doff= =0A= > -device vfio-pci,host=3D01:10.1,id=3Dnet1=0A= >=0A= >=0A= > 2. The VF Device was visible with another pci address.=0A= >=0A= > 00:04.0 Ethernet controller: Intel Corporation 82599ES 10-Gigabit SFI/SFP= +=0A= > Network=0A= > Connection (rev 01)=0A= >=0A= > Further ran DPDK testpmd on top of VM but bound the virtual function driv= er=0A= > to igb_uio instead of vfio-pci. It ran successfully. The ixgbevf pmd=0A= > driver is able to access the BAR registers in pci_uio_map_resource via=0A= > mmaping somewhere close to hugepages. I was not able to bind the virtual= =0A= > function driver in VM to vfio-pci and hence DPDK would not be able to run= =0A= > with VFIO enabled as it complains of no IOMMU support. I also believe tha= t=0A= > there is little logic in binding the vf device to vfio-pci again since qe= mu=0A= > has already taken care of it and hardware support is involved.=0A= >=0A= > So my questions are=0A= > a. vfio is meant to be a replacement for both uio and device assignment= =0A= > for qemu. This doesnt seem simultaneous. Comment?=0A= =0A= What do you mean "device assignment" ? You mean pass-through? =0A= > b. Is there any way to access VF device using VFIO in guest userspace?= =0A= > Have you run DPDK in guest machine with VFIO support enabled and all=0A= > dependent modules inserted and did it work?=0A= =0A= As I knows, the answer is *NO*, because the iommu is not support in guest.= =0A= > c. Is igb_uio or uio_pci_generic in future the only way to access the=0A= > device in guest userspace?=0A= =0A= It depends, who knows what will happen in future :)=0A= =0A= Thanks,=0A= Michael=0A= > *Regards*=0A= >=0A= =0A=