From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50515) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fik5R-0006WY-DW for qemu-devel@nongnu.org; Thu, 26 Jul 2018 13:30:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fik5M-00067L-FG for qemu-devel@nongnu.org; Thu, 26 Jul 2018 13:30:01 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:45792) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fik5M-00066u-6F for qemu-devel@nongnu.org; Thu, 26 Jul 2018 13:29:56 -0400 Message-ID: <1532625946.2458.187.camel@oracle.com> From: Knut Omang Date: Thu, 26 Jul 2018 19:25:46 +0200 In-Reply-To: <9e3bedbf-e6a7-61ae-babd-79a9ec13da24@gmail.com> References: <1407239306.11199051.1530240887935.JavaMail.zimbra@redhat.com> <20180705194311-mutt-send-email-mst@kernel.org> <20180726145214.GD17777@stefanha-x1.localdomain> <488bdc8d-e36c-ad3e-f7b3-a45a78a99dda@gmail.com> <1532623112.2458.172.camel@oracle.com> <20180726193949-mutt-send-email-mst@kernel.org> <1532623371.2458.174.camel@oracle.com> <9e3bedbf-e6a7-61ae-babd-79a9ec13da24@gmail.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] Question: SRIOV support over Win Hyper-V VM running in QEMU process on Linux host List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Marcel Apfelbaum , "Michael S. Tsirkin" Cc: Stefan Hajnoczi , Elijah Shakkour , "qemu-devel@nongnu.org" , Tal Attaly On Thu, 2018-07-26 at 20:05 +0300, Marcel Apfelbaum wrote: > > On 07/26/2018 07:42 PM, Knut Omang wrote: > > On Thu, 2018-07-26 at 19:41 +0300, Michael S. Tsirkin wrote: > > > On Thu, Jul 26, 2018 at 06:38:32PM +0200, Knut Omang wrote: > > > > On Thu, 2018-07-26 at 18:51 +0300, Marcel Apfelbaum wrote: > > > > > Hi > > > > > > > > > > On 07/26/2018 05:52 PM, Stefan Hajnoczi wrote: > > > > > > On Thu, Jul 12, 2018 at 07:33:14AM +0000, Elijah Shakkour wrote: > > > > > > > Hey, > > > > > > > > > > > > > > Our team is adding a NIC functional emulation to QEMU. > > > > > > > One of the features we are adding to this NIC is SRIOV. > > > > > > > > > > > > > > Here is the error message I get when checking SRIOV support > > > > > > > of our > > > > > > > emulated NIC on Win2016 server (the hyper-v VM). > > > > > > > " > > > > > > > SR-IOV cannot be used on this system as the PCI Express hardware > > > > > > > does > > > > > > > not > > > > > > > support Access Control Services (ACS) at any root port. > > > > > > > > > > QEMU's emulated PCI Express Root Ports do not support ACS yet, however > > > > > I > > > > > am not sure ACS is a prerequisite > > > > > for SR-IOV. We would need ARI support for allowing more than 8VFs, but > > > > > QEMU doesn't support that either (yet). > > > > > > > > > > Knut Omag has some working patches, he successfully implemented SR-IOV > > > > > with QEMU, see: > > > > > https://github.com/knuto/qemu/tree/sriov_patches_v7 > > > > > > > > > > The code was not merged since we need at least a device with SR-IOV > > > > > support to justify the addition. > > > > > > > > FYI, I recently rebased these to latest master but just didn't get to > > > > push > > > > them > > > > out. I did just now - they are available here: > > > > > > > > https://github.com/knuto/qemu/tree/sriov_patches_v8 > > > > > > > > As far as I know ARI support with my patch set works just fine - I have > > > > tested > > > > it with lots of VFs. > > > > > > > > One of the patches in the series (pci: Make use of the devfn property > > > > when > > > > registering new devices) is necessary to make ARI work as it should with > > > > SR/IOV. > > > > > > > > For the hardware model I developed the SR/IOV patches for, I also added > > > > enough > > > > ACS support in the root port (PCIe capability helper patch + usage in > > > > ioh3420) to make VFIO "happy". I haven't submitted them because they > > > > are "questionable" since they likely do not reflect the actual features > > > > of > > > > the > > > > ioh3420. > > > > > > In that the actual ioh3420 doesn't support ACS? > > > > yes.. I don't have one so I don't know but that was my assumption.. > > Hi Knut, > > We have now a generic PCIe Root Port we can add whatever we want to it. > See please hw/pci-bridge/gen_pcie_root_port.c. Ok, I see! - I wasn't aware of that. I was thinking more in terms of just emulating a slightly newer Intel root port but never got around to that. > So your patches add both ARI and ACS support, nice! > Maybe it worth merging at least these features. I'll have a look at the generic root port, it is probably a natural extension for v9 of the sriov patch set :-) Thanks, Knut > > Thanks, > Marcel > > > > > Knut > > > > > > I can make those available if interesting. > > > > > > > > Thanks, > > > > Knut > > > > > > > > > > > Contact your system vendor for further information. > > > > > > > " > > > > > > > > > > > > I'm not sure what the status of emulated SR-IOV is so I have CCed > > > > > > Michael Tsirkin and Marcel Apfelbaum, the PCI maintainers in QEMU. > > > > > > > > > > Thanks, > > > > > Marcel > > > > > > > > > > > > Could you please advise about what could be the issue here? > > > > > > > > > > > > > > BTW: I use same configuration (VM XML file attached) when running > > > > > > > linux VM > > > > > > > (RH7.2) image (instead of Win Hyper-V) over the same host and > > > > > > > SRIOV is > > > > > > > working for me there. > > > > > > > > > > > > > > Here the XML file I use to define the VM (our emulated NIC is > > > > > > > added at > > > > > > > the > > > > > > > end of XML): > > > > > > > " > > > > > > > > > > > > > > ; > > > > > > > > > > > > > > nst105 > > > > > > > 0249a525-2ee2-432b-a1f5-a6db83b089a3 > > > > > > > 8388608 > > > > > > > 8388608 > > > > > > > 8 > > > > > > > > > > > > > > /machine > > > > > > > > > > > > > > > > > > > > > hvm > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > SandyBridge > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > destroy > > > > > > > restart > > > > > > > destroy > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > /opt/qemu/bin/qemu-system-x86_64 > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >
> > > > > > unit='0'/> > > > > > > > > > > > > > > > > > > > > >
> > > > > > function='0x7'/> > > > > > > > > > > > > > > > > > > > > > > > > > > > >
> > > > > > function='0x0' multifunction='on'/> > > > > > > > > > > > > > > > > > > > > > > > > > > > >
> > > > > > function='0x1'/> > > > > > > > > > > > > > > > > > > > > > > > > > > > >
> > > > > > function='0x2'/> > > > > > > > > > > > > > > > > > > > > >
> > > > > > function='0x2'/> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >
> > > > > > function='0x0' multifunction='on'/> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >
> > > > > > function='0x1'/> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >
> > > > > > function='0x2'/> > > > > > > > > > > > > > > > > > > > > > > > > > > > >
> > > > > > function='0x0'/> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >
> > > > > > function='0x0'/> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >
> > > > > > function='0x0'/> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > listen='127.0.0.1' > > > > > > > keymap='en-us'> > > > > > > > > > > > > > > > > > > > > >