From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752942AbaHTNoa (ORCPT ); Wed, 20 Aug 2014 09:44:30 -0400 Received: from exprod7og119.obsmtp.com ([64.18.2.16]:47194 "EHLO exprod7og119.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752898AbaHTNo0 (ORCPT ); Wed, 20 Aug 2014 09:44:26 -0400 MIME-Version: 1.0 In-Reply-To: <1408538771.11383.33.camel@ul30vt.home> References: <1408538771.11383.33.camel@ul30vt.home> Date: Wed, 20 Aug 2014 19:14:25 +0530 Message-ID: Subject: Re: How to get the number of VFs assigned to the guests in XEN From: Sreekanth Reddy To: Alex Williamson Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, konrad.wilk@oracle.com, "Martin K. Petersen" , Christoph Hellwig , boris.ostrovsky@oracle.com, Sathya Prakash , Nagalakshmi Nandigama Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thanks Alex, Then, Is there any other ways to stop accidental unload of PF driver while still some VFs are accessing by the running VMs. Regards, Sreekanth On Wed, Aug 20, 2014 at 6:16 PM, Alex Williamson wrote: > On Wed, 2014-08-20 at 16:39 +0530, Sreekanth Reddy wrote: >> HI, >> >> For SRIOV support, currently in the KVM environment, mpt3sas driver >> can use the API pci_vfs_assigned() to know the number of VFs that are >> currently assigned to the running VMs. So that during the PF driver >> unload time, if the return value of this API is greater than zero the >> our driver won't call the pci_disable_sriov() to disable the VFs. >> >> Now for the same purpose in XEN environment, is there any API similar >> to pci_vfs_assigned() which the low lever device driver can use to >> know 'the number of VFs that are currently assigned to the running >> VMs'. In XEN environment this API pci_vfs_assigned() will return >> always zero even though VFs are assigned to the running VMs. > > Note that pci_vfs_assigned() assigned is only used by legacy KVM device > assignment and primarily as a workaround for not using an actual > host-based device driver to manage device ownership. When using > VFIO-based device assignment with KVM, pci_vfs_assigned() is not > updated. Please don't rely on this interface. Thanks, > > Alex >