igb: do not re-register DCA requester on device reset
authorAlexander Duyck <alexander.h.duyck@intel.com>
Thu, 21 May 2009 13:06:56 +0000 (13:06 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 22 May 2009 00:19:09 +0000 (17:19 -0700)
The current driver is re-registering the DCA requester after every reset.
Instead of doing this we should only be updating the on board DCA registers
and not unregistering/re-registering our requester.

Signed-off-by: Alexander Duyck <alexander.h.duyck@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 ffd7315399970a2a8da661dd9f3d86cdb4974c55..2ec98091948b9955967e09334e08cb49842444e7 100644 (file)
@@ -996,6 +996,11 @@ void igb_down(struct igb_adapter *adapter)
                igb_reset(adapter);
        igb_clean_all_tx_rings(adapter);
        igb_clean_all_rx_rings(adapter);
+#ifdef CONFIG_IGB_DCA
+
+       /* since we reset the hardware DCA settings were cleared */
+       igb_setup_dca(adapter);
+#endif
 }
 
 void igb_reinit_locked(struct igb_adapter *adapter)
@@ -1457,9 +1462,6 @@ static int __devinit igb_probe(struct pci_dev *pdev,
        if (dca_add_requester(&pdev->dev) == 0) {
                adapter->flags |= IGB_FLAG_DCA_ENABLED;
                dev_info(&pdev->dev, "DCA enabled\n");
-               /* Always use CB2 mode, difference is masked
-                * in the CB driver. */
-               wr32(E1000_DCA_CTRL, E1000_DCA_CTRL_DCA_MODE_CB2);
                igb_setup_dca(adapter);
        }
 #endif
@@ -3771,11 +3773,15 @@ static void igb_update_tx_dca(struct igb_ring *tx_ring)
 
 static void igb_setup_dca(struct igb_adapter *adapter)
 {
+       struct e1000_hw *hw = &adapter->hw;
        int i;
 
        if (!(adapter->flags & IGB_FLAG_DCA_ENABLED))
                return;
 
+       /* Always use CB2 mode, difference is masked in the CB driver. */
+       wr32(E1000_DCA_CTRL, E1000_DCA_CTRL_DCA_MODE_CB2);
+
        for (i = 0; i < adapter->num_tx_queues; i++) {
                adapter->tx_ring[i].cpu = -1;
                igb_update_tx_dca(&adapter->tx_ring[i]);