Received: from eggs.gnu.org ([2001:4830:134:3::10]:45450) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bm70E-0001ON-5N for qemu-devel@nongnu.org; Mon, 19 Sep 2016 18:25:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bm708-00028U-4U for qemu-devel@nongnu.org; Mon, 19 Sep 2016 18:25:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42458) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bm707-00028K-Qw for qemu-devel@nongnu.org; Mon, 19 Sep 2016 18:25:24 -0400 Date: Mon, 19 Sep 2016 16:25:21 -0600 From: Alex Williamson Message-ID: <20160919162521.3569caa2@t450s.home> In-Reply-To: <8e7e7357-cad4-f9ca-4104-97cadd347a13@redhat.com> References: <00d96f24-5df0-d16b-d4e1-838333989dee@nvidia.com> <20160919153600.70599974@t450s.home> <8e7e7357-cad4-f9ca-4104-97cadd347a13@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC v2] libvirt vGPU QEMU integration List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Kirti Wankhede , "libvir-list@redhat.com" , qemu-devel , Neo Jia , Andy Currid , "Tian, Kevin" , "Song, Jike" , "bjsdjshi@linux.vnet.ibm.com" , Gerd Hoffmann On Mon, 19 Sep 2016 23:50:56 +0200 Paolo Bonzini wrote: > On 19/09/2016 23:36, Alex Williamson wrote: > > On Tue, 20 Sep 2016 02:05:52 +0530 > > Kirti Wankhede wrote: > >> 'fb_length': > >> Read-only file. Mandatory. > >> Returns {K,M,G}, size of framebuffer. > > > > This can't be mandatory, it's only relevant to vGPU devices, vGPUs are > > just one user of mediated devices. [...] > > > >> 'params' > >> Write-Only file. Optional. > >> String input. Libvirt would pass the string given in XML file to > >> this file and then create mdev device. Set empty string to clear params. > >> For example, set parameter 'frame_rate_limiter=0' to disable frame rate > >> limiter for performance benchmarking, then create device of type 11. The > >> device created would have that parameter set by vendor driver. > > > > Might as well just call it "magic", there's absolutely no ability to > > introspect what parameters are allowed or even valid here. Can all > > parameters be changed dynamically? Do parameter changes apply to > > existing devices or only future devices? This is a poorly specified > > interface. I'd prefer this be done via module options on the vendor > > driver. > > Or additional files in the mdev's sysfs directory? Sure, the vendor driver could certainly support that, it'd be vendor specific of course. > >> The parent device would look like: > >> > >> > >> pci_0000_86_00_0 > >> > >> 0 > >> 134 > >> 0 > >> 0 > > > > This is the parent device address? > > (Since this is taken from an email of mine, this is libvirt's XML > interpretation of the udev database and the contents of sysfs. Try > "virsh nodedev-dumpxml pci_0000_00_02_0" for an example that is > unrelated to mdev). > > >> 2. Create/destroy mediated device > >> > >> With above example, vGPU device XML would look like: > >> > >> > >> my-vgpu > >> pci_0000_86_00_0 > >> > >> > >> 1 > >> 'frame_rate_limiter=0' > >> > >> > >> > >> 'type id' is mandatory. > > > > I was under the impression that the vendor supplied "name" was the one > > unique identifier. We're certainly not going to create a registrar to > > hand out type ids to each vendor, so what makes type id unique? > > Why does it have to be unique? It's just parroting what libvirt said in > the block of the parent's nodedev-dumpxml. > > (Though I guess going by name could be useful as well. Perhaps both > could be allowed). Do we not want to be able to migrate a VM to another host and have the XML mean something? Off-line or on-line, mdev device may support migration. Thanks, Alex