On Thu, 2017-10-05 at 16:31 +0200, Kashyap Chamarthy wrote: > [Sorry, I'm a bit late in responding, as I missed this e-mail.] > > On Thu, Jun 08, 2017 at 07:35:52AM -0700, mwoodpatr...@gmail.com wrote: > > I wanted to play around with SR-IOV using qemu and was wondering if there > > are any qemu emulated SR-IOV devices I could experiment with? > > Near as I know there isn't any existing emulated SR-IOV device in QEMU. > But yes, an emulated SR-IOV would also be useful for testing purposes > for projects like OpenStack, without having the need for real hardware. > > > If not I plan on creating one and would appreciate any pointers to documents > > describing how to add an emulated device that supports more than 8 functions > > and has ARI enabled > > I'm far from an expert on this area, but just wanted to point out that > there's some existing support for SR-IOV in QEMU, added via: > > [PATCH v6 0/4] pcie: Add support for Single Root I/O Virtualization -- > https://lists.nongnu.org/archive/html/qemu-devel/2015-10/msg05155.html > > Knut Omang (Cced) who added the above support also had some notes here > on how to implement an SR-IOV capable device.: > > https://lists.nongnu.org/archive/html/qemu-devel/2015-10/msg05157.html > -- pcie: Add some SR/IOV API documentation in docs/pcie_sriov.txt > > "Add a small intro + minimal documentation for how to implement > SR/IOV support for an emulated device. > > > [...]
These are not (yet) in QEMU but can still be found here: https://github.com/knuto/qemu I try to rebase them from time to time. The reason why Michael has not accepted them (yet) is to my understanding the lack of working example devices - correct me if I am wrong. I did provide the igb device which works as a proof of concept of a device with 32 VFs and use of stride and ARI in that the SR/IOV logic itself can be verified, but it is not a working device, just a quick hack on the e1000 code to make it look like an igb with SR/IOV support. But as far as I know, several people have used the SR/IOV patches for their own device models. We have a fairly elaborate and complex model (of an Infiniband HCA) that uses this, and that has been used quite extensively, the problem is that the main part of the code implementing the device is inside a simulation model outside of QEMU, just communicating PCIe transactions with QEMU over a TCP connection. So it is not that easy to make use of inside QEMU. I do however want to pursue ways to provide the QEMU side of that implementation to QEMU, as a tool for other device developers. If there are more people interested in this domain, maybe we should have a BoF session about it at KVM Forum. Thanks, Knut