diff options
author | Todd Fujinaka <todd.fujinaka@intel.com> | 2015-08-07 20:27:39 -0400 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2015-08-18 17:06:07 -0400 |
commit | ceee3450b3a85db05a107d54fbea031c77d30401 (patch) | |
tree | 6a8675721576a9b2a6c75fb8ed44d8f04bc84ef4 /drivers/net/ethernet/intel | |
parent | fae5ecaee3e6265c2aec29ac238ccc29c6f11fc3 (diff) |
igb: make sure SR-IOV init uses the right number of queues
Recent changes to igb_probe_vfs() could lead to the PF holding onto all
of the queues. Reorder igb_probe_vfs() to be before
gb_init_queue_configuration() and add some more error checking.
Signed-off-by: Todd Fujinaka <todd.fujinaka@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@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 | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c index 1ebdb461fed3..1902ef8f4a0b 100644 --- a/drivers/net/ethernet/intel/igb/igb_main.c +++ b/drivers/net/ethernet/intel/igb/igb_main.c | |||
@@ -179,6 +179,8 @@ static void igb_check_vf_rate_limit(struct igb_adapter *); | |||
179 | #ifdef CONFIG_PCI_IOV | 179 | #ifdef CONFIG_PCI_IOV |
180 | static int igb_vf_configure(struct igb_adapter *adapter, int vf); | 180 | static int igb_vf_configure(struct igb_adapter *adapter, int vf); |
181 | static int igb_pci_enable_sriov(struct pci_dev *dev, int num_vfs); | 181 | static int igb_pci_enable_sriov(struct pci_dev *dev, int num_vfs); |
182 | static int igb_disable_sriov(struct pci_dev *dev); | ||
183 | static int igb_pci_disable_sriov(struct pci_dev *dev); | ||
182 | #endif | 184 | #endif |
183 | 185 | ||
184 | #ifdef CONFIG_PM | 186 | #ifdef CONFIG_PM |
@@ -2651,6 +2653,9 @@ err_eeprom: | |||
2651 | err_sw_init: | 2653 | err_sw_init: |
2652 | kfree(adapter->shadow_vfta); | 2654 | kfree(adapter->shadow_vfta); |
2653 | igb_clear_interrupt_scheme(adapter); | 2655 | igb_clear_interrupt_scheme(adapter); |
2656 | #ifdef CONFIG_PCI_IOV | ||
2657 | igb_disable_sriov(pdev); | ||
2658 | #endif | ||
2654 | pci_iounmap(pdev, hw->hw_addr); | 2659 | pci_iounmap(pdev, hw->hw_addr); |
2655 | err_ioremap: | 2660 | err_ioremap: |
2656 | free_netdev(netdev); | 2661 | free_netdev(netdev); |
@@ -2981,6 +2986,8 @@ static int igb_sw_init(struct igb_adapter *adapter) | |||
2981 | } | 2986 | } |
2982 | #endif /* CONFIG_PCI_IOV */ | 2987 | #endif /* CONFIG_PCI_IOV */ |
2983 | 2988 | ||
2989 | igb_probe_vfs(adapter); | ||
2990 | |||
2984 | igb_init_queue_configuration(adapter); | 2991 | igb_init_queue_configuration(adapter); |
2985 | 2992 | ||
2986 | /* Setup and initialize a copy of the hw vlan table array */ | 2993 | /* Setup and initialize a copy of the hw vlan table array */ |
@@ -2993,8 +3000,6 @@ static int igb_sw_init(struct igb_adapter *adapter) | |||
2993 | return -ENOMEM; | 3000 | return -ENOMEM; |
2994 | } | 3001 | } |
2995 | 3002 | ||
2996 | igb_probe_vfs(adapter); | ||
2997 | |||
2998 | /* Explicitly disable IRQ since the NIC can be in any state. */ | 3003 | /* Explicitly disable IRQ since the NIC can be in any state. */ |
2999 | igb_irq_disable(adapter); | 3004 | igb_irq_disable(adapter); |
3000 | 3005 | ||