diff options
author | Alexander Duyck <alexander.h.duyck@intel.com> | 2013-03-25 20:03:26 -0400 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2013-04-24 23:18:32 -0400 |
commit | b09186d29ec1fb75f9235b1ea51699f14d1e7298 (patch) | |
tree | 97c658026323cbcb53db111d905d9ae3dc405713 /drivers/net/ethernet/intel | |
parent | 5a8eb24292ffd68604cedeb24ad2b4bc02cfc037 (diff) |
igb: Use pci_vfs_assigned instead of igb_vfs_are_assigned
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>
Diffstat (limited to 'drivers/net/ethernet/intel')
-rw-r--r-- | drivers/net/ethernet/intel/igb/igb_main.c | 36 |
1 files changed, 1 insertions, 35 deletions
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c index dcaa35481dd7..b94a3c551d31 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 *); | |||
180 | 180 | ||
181 | #ifdef CONFIG_PCI_IOV | 181 | #ifdef CONFIG_PCI_IOV |
182 | static int igb_vf_configure(struct igb_adapter *adapter, int vf); | 182 | static int igb_vf_configure(struct igb_adapter *adapter, int vf); |
183 | static bool igb_vfs_are_assigned(struct igb_adapter *adapter); | ||
184 | #endif | 183 | #endif |
185 | 184 | ||
186 | #ifdef CONFIG_PM | 185 | #ifdef CONFIG_PM |
@@ -2402,7 +2401,7 @@ static int igb_disable_sriov(struct pci_dev *pdev) | |||
2402 | /* reclaim resources allocated to VFs */ | 2401 | /* reclaim resources allocated to VFs */ |
2403 | if (adapter->vf_data) { | 2402 | if (adapter->vf_data) { |
2404 | /* disable iov and allow time for transactions to clear */ | 2403 | /* disable iov and allow time for transactions to clear */ |
2405 | if (igb_vfs_are_assigned(adapter)) { | 2404 | if (pci_vfs_assigned(pdev)) { |
2406 | dev_warn(&pdev->dev, | 2405 | dev_warn(&pdev->dev, |
2407 | "Cannot deallocate SR-IOV virtual functions while they are assigned - VFs will not be deallocated\n"); | 2406 | "Cannot deallocate SR-IOV virtual functions while they are assigned - VFs will not be deallocated\n"); |
2408 | return -EPERM; | 2407 | return -EPERM; |
@@ -5242,39 +5241,6 @@ static int igb_vf_configure(struct igb_adapter *adapter, int vf) | |||
5242 | return 0; | 5241 | return 0; |
5243 | } | 5242 | } |
5244 | 5243 | ||
5245 | static bool igb_vfs_are_assigned(struct igb_adapter *adapter) | ||
5246 | { | ||
5247 | struct pci_dev *pdev = adapter->pdev; | ||
5248 | struct pci_dev *vfdev; | ||
5249 | int dev_id; | ||
5250 | |||
5251 | switch (adapter->hw.mac.type) { | ||
5252 | case e1000_82576: | ||
5253 | dev_id = IGB_82576_VF_DEV_ID; | ||
5254 | break; | ||
5255 | case e1000_i350: | ||
5256 | dev_id = IGB_I350_VF_DEV_ID; | ||
5257 | break; | ||
5258 | default: | ||
5259 | return false; | ||
5260 | } | ||
5261 | |||
5262 | /* loop through all the VFs to see if we own any that are assigned */ | ||
5263 | vfdev = pci_get_device(PCI_VENDOR_ID_INTEL, dev_id, NULL); | ||
5264 | while (vfdev) { | ||
5265 | /* if we don't own it we don't care */ | ||
5266 | if (vfdev->is_virtfn && vfdev->physfn == pdev) { | ||
5267 | /* if it is assigned we cannot release it */ | ||
5268 | if (vfdev->dev_flags & PCI_DEV_FLAGS_ASSIGNED) | ||
5269 | return true; | ||
5270 | } | ||
5271 | |||
5272 | vfdev = pci_get_device(PCI_VENDOR_ID_INTEL, dev_id, vfdev); | ||
5273 | } | ||
5274 | |||
5275 | return false; | ||
5276 | } | ||
5277 | |||
5278 | #endif | 5244 | #endif |
5279 | static void igb_ping_all_vfs(struct igb_adapter *adapter) | 5245 | static void igb_ping_all_vfs(struct igb_adapter *adapter) |
5280 | { | 5246 | { |