From: Alexander Duyck <alexander.h.duyck@intel.com>
To: Gavin Shan <shangw@linux.vnet.ibm.com>
Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>,
davem@davemloft.net, Bjorn Helgaas <bhelgaas@google.com>,
netdev@vger.kernel.org, gospo@redhat.com, sassmann@redhat.com,
"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>
Subject: Re: [net-next 08/14] pci: Add SRIOV helper function to determine if VFs are assigned to guest
Date: Mon, 22 Apr 2013 09:13:26 -0700 [thread overview]
Message-ID: <517561A6.6030506@intel.com> (raw)
In-Reply-To: <20130421051423.GA4052@shangw.(null)>
On 04/20/2013 10:14 PM, Gavin Shan wrote:
> On Sat, Apr 20, 2013 at 08:31:28PM -0700, Jeff Kirsher wrote:
>> On Sat, 2013-04-20 at 02:49 -0700, Jeff Kirsher wrote:
>>> From: Alexander Duyck <alexander.h.duyck@intel.com>
>>>
>>> This function is meant to add a helper function that will determine if a PF
>>> has any VFs that are currently assigned to a guest. We currently have been
>>> implementing this function per driver, and going forward I would like to avoid
>>> that by making this function generic and using this helper.
>>>
>>> Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
>>> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
>> Adding linux-pci mailing list and Bjorn to the CC.
>>
>> Bjorn- David Miller needs a signoff by PCI maintainer.
>>
>>> ---
>>> drivers/pci/iov.c | 41 +++++++++++++++++++++++++++++++++++++++++
>>> include/linux/pci.h | 5 +++++
>>> 2 files changed, 46 insertions(+)
>>>
>>> diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c
>>> index ee599f2..fd99720 100644
>>> --- a/drivers/pci/iov.c
>>> +++ b/drivers/pci/iov.c
>>> @@ -729,6 +729,47 @@ int pci_num_vf(struct pci_dev *dev)
>>> EXPORT_SYMBOL_GPL(pci_num_vf);
>>>
>>> /**
>>> + * pci_vfs_assigned - returns number of VFs are assigned to a guest
>>> + * @dev: the PCI device
>>> + *
>>> + * Returns number of VFs belonging to this device that are assigned to a guest.
>>> + * If device is not a physical function returns -ENODEV.
>>> + */
>>> +int pci_vfs_assigned(struct pci_dev *dev)
>>> +{
>>> + struct pci_dev *vfdev;
>>> + unsigned int vfs_assigned = 0;
>>> + unsigned short dev_id;
>>> +
>>> + /* only search if we are a PF */
>>> + if (!dev->is_physfn)
>>> + return -ENODEV;
> I think it's more reasonable to return zero here?
I suppose that is true, it would be more in keeping with how pci_num_vf
works so I will make that change.
Thanks,
Alex
next prev parent reply other threads:[~2013-04-22 16:13 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-20 9:48 [net-next 00/14][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
2013-04-20 9:49 ` [net-next 01/14] ixgbe: fix possible divide by zero in ixgbe_update_itr Jeff Kirsher
2013-04-20 9:49 ` [net-next 02/14] ixgbe: add driver support for x520 OCP adapter Jeff Kirsher
2013-04-20 9:49 ` [net-next 03/14] ixgbe: rename wol_supported to more fitting wol_enabled Jeff Kirsher
2013-04-20 9:49 ` [net-next 04/14] ixgbe: add SFP+ LX module support Jeff Kirsher
2013-04-20 9:49 ` [net-next 05/14] ixgbe: add WOL support for new subdevice ID Jeff Kirsher
2013-04-20 9:49 ` [net-next 06/14] igb: SERDES loopback sigdetect bit on i210 devices Jeff Kirsher
2013-04-20 9:49 ` [net-next 07/14] igb: Add SMBI semaphore to I210/I211 Jeff Kirsher
2013-04-20 9:49 ` [net-next 08/14] pci: Add SRIOV helper function to determine if VFs are assigned to guest Jeff Kirsher
2013-04-21 0:54 ` David Miller
2013-04-21 3:31 ` Jeff Kirsher
[not found] ` <20130421051423.GA4052@shangw.(null)>
2013-04-22 16:13 ` Alexander Duyck [this message]
2013-04-22 20:09 ` Bjorn Helgaas
2013-04-22 21:50 ` Alexander Duyck
2013-04-23 19:51 ` Greg Rose
2013-04-23 21:16 ` Don Dutile
2013-04-24 20:10 ` Bjorn Helgaas
2013-04-24 20:18 ` David Miller
2013-04-24 21:40 ` Jeff Kirsher
2013-04-24 21:35 ` Greg Rose
2013-04-20 9:49 ` [net-next 09/14] igb: Use pci_vfs_assigned instead of igb_vfs_are_assigned Jeff Kirsher
2013-04-20 9:49 ` [net-next 10/14] igb: display a warning message when SmartSpeed works Jeff Kirsher
2013-04-20 9:49 ` [net-next 11/14] igb: Retain HW VLAN filtering while in promiscuous + VT mode Jeff Kirsher
2013-04-20 9:49 ` [net-next 12/14] igb: Remove dead code path Jeff Kirsher
2013-04-20 9:49 ` [net-next 13/14] igb: Remove id's that will not be productized for Linux Jeff Kirsher
2013-04-20 9:49 ` [net-next 14/14] igb: Bump version of driver Jeff Kirsher
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=517561A6.6030506@intel.com \
--to=alexander.h.duyck@intel.com \
--cc=bhelgaas@google.com \
--cc=davem@davemloft.net \
--cc=gospo@redhat.com \
--cc=jeffrey.t.kirsher@intel.com \
--cc=linux-pci@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=sassmann@redhat.com \
--cc=shangw@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.