igb: Fix possible panic caused by Rx traffic arrival while interface is down
authorCarolyn Wyborny <carolyn.wyborny@intel.com>
Tue, 30 Apr 2013 00:21:32 +0000 (00:21 +0000)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Tue, 21 May 2013 09:55:38 +0000 (02:55 -0700)
This patch reorders disabling napi and irqs during igb_down.
This is done to avoid possible panic's found in other Intel drivers
when Rx traffic arrives while interface is going down.

Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/igb/igb_main.c

index 2c8f7e04b02bff6c2e49f48b7d2c7985e5a23329..6a0c1b66ce54116b88a8aaf33bcf0518a7ef7ca3 100644 (file)
@@ -1667,10 +1667,13 @@ void igb_down(struct igb_adapter *adapter)
        wrfl();
        msleep(10);
 
-       for (i = 0; i < adapter->num_q_vectors; i++)
+       igb_irq_disable(adapter);
+
+       for (i = 0; i < adapter->num_q_vectors; i++) {
+               napi_synchronize(&(adapter->q_vector[i]->napi));
                napi_disable(&(adapter->q_vector[i]->napi));
+       }
 
-       igb_irq_disable(adapter);
 
        del_timer_sync(&adapter->watchdog_timer);
        del_timer_sync(&adapter->phy_info_timer);