Received: from eggs.gnu.org ([2001:4830:134:3::10]:52032) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmZNL-00071M-Ds for qemu-devel@nongnu.org; Wed, 21 Sep 2016 00:43:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bmZNJ-0006ks-0Y for qemu-devel@nongnu.org; Wed, 21 Sep 2016 00:43:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43070) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmZNI-0006kX-NA for qemu-devel@nongnu.org; Wed, 21 Sep 2016 00:43:12 -0400 Date: Tue, 20 Sep 2016 22:43:11 -0600 From: Alex Williamson Message-ID: <20160920224311.4df089de@t450s.home> In-Reply-To: References: <00d96f24-5df0-d16b-d4e1-838333989dee@nvidia.com> <20160919153600.70599974@t450s.home> <3ae29391-5883-eb0c-5e93-3f93ef1bb143@nvidia.com> <20160920084323.55a032fc@t450s.home> 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: "Tian, Kevin" Cc: Kirti Wankhede , "libvir-list@redhat.com" , qemu-devel , Paolo Bonzini , Neo Jia , Andy Currid , "Song, Jike" , "bjsdjshi@linux.vnet.ibm.com" , Gerd Hoffmann On Wed, 21 Sep 2016 04:10:53 +0000 "Tian, Kevin" wrote: > > From: Kirti Wankhede [mailto:kwankhede@nvidia.com] > > Sent: Wednesday, September 21, 2016 12:23 AM > > > > > > On 9/20/2016 8:13 PM, Alex Williamson wrote: > > > On Tue, 20 Sep 2016 19:51:58 +0530 > > > Kirti Wankhede wrote: > > > > > >> On 9/20/2016 3:06 AM, Alex Williamson wrote: > > >>> On Tue, 20 Sep 2016 02:05:52 +0530 > > >>> Kirti Wankhede wrote: > > >>> > > >>>> Hi libvirt experts, > > >>>> > > >>>> > > >>>> 'create': > > >>>> Write-only file. Mandatory. > > >>>> Accepts string to create mediated device. > > >>>> > > >>>> 'name': > > >>>> Read-Only file. Mandatory. > > >>>> Returns string, the name of that type id. > > >>>> > > >>>> '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. > > >>> > > >> > > >> As per our discussion in BOF, we would define class and its attributes. > > >> As I mentioned above these are attributes of "display" class. > > > > > > Just as I didn't know here, how does libvirt know the class of a given > > > type id? > > > > > > > Yes, we need some way to identify the class as Daniel mentioned in his > > suggestion. Add a file 'class' in mdev_supported_types that would return > > the class. > > > > > > 'display' class or 'gpu' class? display represents only part of GPU > functionalities. I assume you want to provide an unique class ID > for each type, instead of allowing multiple classes each identifying > a subset of controllable GPU resources (e.g. 'display', 'render', etc.)... Not sure where you're going with this, we're not creating a programming interface for the device, that exists through the vfio API. I believe the intention here is simply a user level classification for the purpose of being able to interpret the attributes provided in a logical way. > for unique class ID, I once considered whether it could be directly > inherited from class of parent device, since typically a vendor driver > creates mdev devices using the same type as physical device. But later > I realized one potential value of keep a class field for mdev types, > e.g. if we want to extend mdev to FPGA which could be programmed > as different classes of functionalities. :-) And how do we generically determine the class of a parent device? We cannot assume the parent device is PCI. Thanks, Alex