igb: Fix Tx hangs seen when loading igb with max_vfs > 7.
authorEmil Tantilov <emil.s.tantilov@intel.com>
Thu, 1 Jul 2010 13:38:40 +0000 (13:38 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 2 Jul 2010 05:45:56 +0000 (22:45 -0700)
Check the value of max_vfs at the time of assignment of vfs_allocated_count.

The previous check in igb_probe_vfs was too late as by that time the rx/tx
rings were initialized with the wrong offset.

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/igb/igb_main.c

index e79689eeb1fe5aa0faea20865f91db327facd5dc..d811462ab9b64e081fe993bfecb1cb76c95ad568 100644 (file)
@@ -2091,9 +2091,6 @@ static void __devinit igb_probe_vfs(struct igb_adapter * adapter)
 #ifdef CONFIG_PCI_IOV
        struct pci_dev *pdev = adapter->pdev;
 
-       if (adapter->vfs_allocated_count > 7)
-               adapter->vfs_allocated_count = 7;
-
        if (adapter->vfs_allocated_count) {
                adapter->vf_data = kcalloc(adapter->vfs_allocated_count,
                                           sizeof(struct vf_data_storage),
@@ -2258,7 +2255,7 @@ static int __devinit igb_sw_init(struct igb_adapter *adapter)
 
 #ifdef CONFIG_PCI_IOV
        if (hw->mac.type == e1000_82576)
-               adapter->vfs_allocated_count = max_vfs;
+               adapter->vfs_allocated_count = (max_vfs > 7) ? 7 : max_vfs;
 
 #endif /* CONFIG_PCI_IOV */
        adapter->rss_queues = min_t(u32, IGB_MAX_RX_QUEUES, num_online_cpus());