Commit ceee3450 authored by Todd Fujinaka's avatar Todd Fujinaka Committed by Jeff Kirsher

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: default avatarTodd Fujinaka <todd.fujinaka@intel.com>
Tested-by: default avatarAaron Brown <aaron.f.brown@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent fae5ecae
...@@ -179,6 +179,8 @@ static void igb_check_vf_rate_limit(struct igb_adapter *); ...@@ -179,6 +179,8 @@ static void igb_check_vf_rate_limit(struct igb_adapter *);
#ifdef CONFIG_PCI_IOV #ifdef CONFIG_PCI_IOV
static int igb_vf_configure(struct igb_adapter *adapter, int vf); static int igb_vf_configure(struct igb_adapter *adapter, int vf);
static int igb_pci_enable_sriov(struct pci_dev *dev, int num_vfs); static int igb_pci_enable_sriov(struct pci_dev *dev, int num_vfs);
static int igb_disable_sriov(struct pci_dev *dev);
static int igb_pci_disable_sriov(struct pci_dev *dev);
#endif #endif
#ifdef CONFIG_PM #ifdef CONFIG_PM
...@@ -2651,6 +2653,9 @@ static int igb_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -2651,6 +2653,9 @@ static int igb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
err_sw_init: err_sw_init:
kfree(adapter->shadow_vfta); kfree(adapter->shadow_vfta);
igb_clear_interrupt_scheme(adapter); igb_clear_interrupt_scheme(adapter);
#ifdef CONFIG_PCI_IOV
igb_disable_sriov(pdev);
#endif
pci_iounmap(pdev, hw->hw_addr); pci_iounmap(pdev, hw->hw_addr);
err_ioremap: err_ioremap:
free_netdev(netdev); free_netdev(netdev);
...@@ -2981,6 +2986,8 @@ static int igb_sw_init(struct igb_adapter *adapter) ...@@ -2981,6 +2986,8 @@ static int igb_sw_init(struct igb_adapter *adapter)
} }
#endif /* CONFIG_PCI_IOV */ #endif /* CONFIG_PCI_IOV */
igb_probe_vfs(adapter);
igb_init_queue_configuration(adapter); igb_init_queue_configuration(adapter);
/* Setup and initialize a copy of the hw vlan table array */ /* 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,8 +3000,6 @@ static int igb_sw_init(struct igb_adapter *adapter)
return -ENOMEM; return -ENOMEM;
} }
igb_probe_vfs(adapter);
/* Explicitly disable IRQ since the NIC can be in any state. */ /* Explicitly disable IRQ since the NIC can be in any state. */
igb_irq_disable(adapter); igb_irq_disable(adapter);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment