From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from jaguar.aricent.com (jaguar.aricent.com [121.241.96.11]) by dpdk.org (Postfix) with ESMTP id 3F55D6AAE for ; Fri, 5 Dec 2014 18:29:24 +0100 (CET) Received: from jaguar.aricent.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D9A34218B41 for ; Fri, 5 Dec 2014 22:59:22 +0530 (IST) Received: from GURCASV02.AD.ARICENT.COM (unknown [10.203.26.92]) by jaguar.aricent.com (Postfix) with ESMTPS id BA0CE218011 for ; Fri, 5 Dec 2014 22:59:22 +0530 (IST) Received: from GURMBXV02.AD.ARICENT.COM (10.203.26.97) by GURMBXV03.AD.ARICENT.COM (10.203.26.98) with Microsoft SMTP Server (TLS) id 15.0.847.32; Fri, 5 Dec 2014 22:59:22 +0530 Received: from GURMBXV02.AD.ARICENT.COM ([169.254.4.159]) by GURMBXV02.AD.ARICENT.COM ([169.254.4.159]) with mapi id 15.00.0847.030; Fri, 5 Dec 2014 22:59:21 +0530 From: Aashima Arora To: "dev@dpdk.org" Thread-Topic: Accessing Virtual Function Device on Guest Machine using VFIO Thread-Index: AQHQEKz8G0x/Dzb7q06Tu+SlQq2INw== Date: Fri, 5 Dec 2014 17:29:20 +0000 Message-ID: References: <1417729325-9410-1-git-send-email-linville@tuxdriver.com> <8974312.4KPnm9h9PX@xps13> <20141205162453.GB28319@tuxdriver.com>,<128892442.7P4I1l0Tzy@xps13> In-Reply-To: <128892442.7P4I1l0Tzy@xps13> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [182.68.249.163] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-TM-AS-MML: disable Subject: [dpdk-dev] Accessing Virtual Function Device on Guest Machine using 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: Fri, 05 Dec 2014 17:29:24 -0000 Hi, I was trying to access the pci config space(BAR) of the virtual function de= vice visible in the virtual machine, similar to what DPDK does on host via = both UIO and VFIO. Did the following steps. 1. Bound PF Drivers to ixgbe and spawned virtual function drivers , bound t= hem to vfio-pci and set their mac addresses via ip link. Ran Qemu and assi= gned the VF Device using vfio-pci device assignment and initialized the vir= tual machine. insmod igb max_vfs=3D2 ./x86_64-softmmu/qemu-system-x86_64 -cpu host -boot c -hda /home/vm-images/= vm2.imgsnapshot -m 2048M -smp 2 --enable-kvm -name 'vm2' -vnc :2 -pidfile /= tmp/vm2.pid -driile=3Dfat:rw:/tmp/share,snapshot=3Doff -device vfio-pci,hos= t=3D01:10.1,id=3Dnet1 2. The VF Device was visible with another pci address. 00:04.0 Ethernet controller: Intel Corporation 82599ES 10-Gigabit SFI/SFP+ = Network Connection (rev 01) Further ran DPDK testpmd on top of VM but bound the virtual function driver= to igb_uio instead of vfio-pci. It ran successfully. The ixgbevf pmd driv= er is able to access the BAR registers in pci_uio_map_resource via mmaping = somewhere close to hugepages. I was not able to bind the virtual function d= river in VM to vfio-pci and hence DPDK would not be able to run with VFIO e= nabled as it complains of no IOMMU support. I also believe that there is li= ttle logic in binding the vf device to vfio-pci again since qemu has alread= y taken care of it and hardware support is involved. So my questions are a. vfio is meant to be a replacement for both uio and device assignment fo= r qemu. This doesnt seem simultaneous. Comment? b. Is there any way to access VF device using VFIO in guest userspace? Hav= e you run DPDK in guest machine with VFIO support enabled and all dependent= modules inserted and did it work? c. Is igb_uio or uio_pci_generic in future the only way to access the devi= ce in guest userspace? "DISCLAIMER: This message is proprietary to Aricent and is intended solely = for the use of the individual to whom it is addressed. It may contain privi= leged or confidential information and should not be circulated or used for = any purpose other than for what it is intended. If you have received this m= essage in error, please notify the originator immediately. If you are not t= he intended recipient, you are notified that you are strictly prohibited fr= om using, copying, altering, or disclosing the contents of this message. Ar= icent accepts no responsibility for loss or damage arising from the use of = the information transmitted by this email including damage from virus."