From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
Cc: Alexander Duyck <alexander.h.duyck@intel.com>,
netdev@vger.kernel.org, gospo@redhat.com, sassmann@redhat.com,
Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [net-next 09/14] igb: Use pci_vfs_assigned instead of igb_vfs_are_assigned
Date: Wed, 24 Apr 2013 21:08:42 -0700 [thread overview]
Message-ID: <1366862927-1855-10-git-send-email-jeffrey.t.kirsher@intel.com> (raw)
In-Reply-To: <1366862927-1855-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Alexander Duyck <alexander.h.duyck@intel.com>
This change makes it so that the igb driver uses the generic helper
pci_vfs_assigned instead of the igb specific function igb_vfs_are_assigned.
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Sibai Li <sibai.li@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/igb/igb_main.c | 36 +------------------------------
1 file changed, 1 insertion(+), 35 deletions(-)
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index dcaa354..b94a3c5 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -180,7 +180,6 @@ static void igb_check_vf_rate_limit(struct igb_adapter *);
#ifdef CONFIG_PCI_IOV
static int igb_vf_configure(struct igb_adapter *adapter, int vf);
-static bool igb_vfs_are_assigned(struct igb_adapter *adapter);
#endif
#ifdef CONFIG_PM
@@ -2402,7 +2401,7 @@ static int igb_disable_sriov(struct pci_dev *pdev)
/* reclaim resources allocated to VFs */
if (adapter->vf_data) {
/* disable iov and allow time for transactions to clear */
- if (igb_vfs_are_assigned(adapter)) {
+ if (pci_vfs_assigned(pdev)) {
dev_warn(&pdev->dev,
"Cannot deallocate SR-IOV virtual functions while they are assigned - VFs will not be deallocated\n");
return -EPERM;
@@ -5242,39 +5241,6 @@ static int igb_vf_configure(struct igb_adapter *adapter, int vf)
return 0;
}
-static bool igb_vfs_are_assigned(struct igb_adapter *adapter)
-{
- struct pci_dev *pdev = adapter->pdev;
- struct pci_dev *vfdev;
- int dev_id;
-
- switch (adapter->hw.mac.type) {
- case e1000_82576:
- dev_id = IGB_82576_VF_DEV_ID;
- break;
- case e1000_i350:
- dev_id = IGB_I350_VF_DEV_ID;
- break;
- default:
- return false;
- }
-
- /* loop through all the VFs to see if we own any that are assigned */
- vfdev = pci_get_device(PCI_VENDOR_ID_INTEL, dev_id, NULL);
- while (vfdev) {
- /* if we don't own it we don't care */
- if (vfdev->is_virtfn && vfdev->physfn == pdev) {
- /* if it is assigned we cannot release it */
- if (vfdev->dev_flags & PCI_DEV_FLAGS_ASSIGNED)
- return true;
- }
-
- vfdev = pci_get_device(PCI_VENDOR_ID_INTEL, dev_id, vfdev);
- }
-
- return false;
-}
-
#endif
static void igb_ping_all_vfs(struct igb_adapter *adapter)
{
--
1.7.11.7
next prev parent reply other threads:[~2013-04-25 4:09 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-25 4:08 [net-next v2 00/14][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
2013-04-25 4:08 ` [net-next 01/14] ixgbe: fix possible divide by zero in ixgbe_update_itr Jeff Kirsher
2013-04-25 4:08 ` [net-next 02/14] ixgbe: add driver support for x520 OCP adapter Jeff Kirsher
2013-04-25 4:08 ` [net-next 03/14] ixgbe: rename wol_supported to more fitting wol_enabled Jeff Kirsher
2013-04-25 4:08 ` [net-next 04/14] ixgbe: add SFP+ LX module support Jeff Kirsher
2013-04-25 4:08 ` [net-next 05/14] ixgbe: add WOL support for new subdevice ID Jeff Kirsher
2013-04-25 4:08 ` [net-next 06/14] igb: SERDES loopback sigdetect bit on i210 devices Jeff Kirsher
2013-04-25 4:08 ` [net-next 07/14] igb: Add SMBI semaphore to I210/I211 Jeff Kirsher
2013-04-25 4:08 ` [net-next v2 08/14] pci: Add SRIOV helper function to determine if VFs are assigned to guest Jeff Kirsher
2013-04-25 4:08 ` Jeff Kirsher [this message]
2013-04-25 4:08 ` [net-next 10/14] igb: display a warning message when SmartSpeed works Jeff Kirsher
2013-04-25 4:08 ` [net-next 11/14] igb: Retain HW VLAN filtering while in promiscuous + VT mode Jeff Kirsher
2013-04-25 4:08 ` [net-next 12/14] igb: Remove dead code path Jeff Kirsher
2013-04-25 4:08 ` [net-next 13/14] igb: Remove id's that will not be productized for Linux Jeff Kirsher
2013-04-25 4:08 ` [net-next 14/14] igb: Bump version of driver Jeff Kirsher
2013-04-25 5:08 ` [net-next v2 00/14][pull request] Intel Wired LAN Driver Updates David Miller
-- strict thread matches above, loose matches on Subject: below --
2013-04-20 9:48 [net-next " Jeff Kirsher
2013-04-20 9:49 ` [net-next 09/14] igb: Use pci_vfs_assigned instead of igb_vfs_are_assigned 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=1366862927-1855-10-git-send-email-jeffrey.t.kirsher@intel.com \
--to=jeffrey.t.kirsher@intel.com \
--cc=alexander.h.duyck@intel.com \
--cc=davem@davemloft.net \
--cc=gospo@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=sassmann@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).