aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMitch Williams <mitch.a.williams@intel.com>2015-03-27 03:12:10 -0400
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2015-03-27 05:57:43 -0400
commit63e18c252068da46ba5ab11ad8861c310afc79fd (patch)
treeced6eee0ce30c4993dde5a5782d0834eb1f9c576
parente284fc88dfb6ceb69c547abb8d78b9fde6b9dc85 (diff)
i40evf: resequence close operations
Call the netdev carrier off and TX disable functions first, before other shutdown operations. This stops the stack from hitting us with transmits while we're shutting down. Additionally, disable NAPI before disabling interrupts, or the interrupt might get re-enabled inappropriately. Finally, remove the call to netif_tx_stop_all_queues, as it is redundant - the call to netif_tx_disable already did the same thing. Change-ID: I8b2dd25231b82817746cc256234a5eeeb4abaccc Signed-off-by: Mitch Williams <mitch.a.williams@intel.com> Tested-by: Jim Young <james.m.young@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
-rw-r--r--drivers/net/ethernet/intel/i40evf/i40evf_main.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
index da901f4b9c18..b08efafee1ae 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
@@ -971,8 +971,10 @@ void i40evf_down(struct i40evf_adapter *adapter)
971 &adapter->crit_section)) 971 &adapter->crit_section))
972 usleep_range(500, 1000); 972 usleep_range(500, 1000);
973 973
974 i40evf_irq_disable(adapter); 974 netif_carrier_off(netdev);
975 netif_tx_disable(netdev);
975 i40evf_napi_disable_all(adapter); 976 i40evf_napi_disable_all(adapter);
977 i40evf_irq_disable(adapter);
976 978
977 /* remove all MAC filters */ 979 /* remove all MAC filters */
978 list_for_each_entry(f, &adapter->mac_filter_list, list) { 980 list_for_each_entry(f, &adapter->mac_filter_list, list) {
@@ -995,13 +997,7 @@ void i40evf_down(struct i40evf_adapter *adapter)
995 adapter->aq_required |= I40EVF_FLAG_AQ_DEL_VLAN_FILTER; 997 adapter->aq_required |= I40EVF_FLAG_AQ_DEL_VLAN_FILTER;
996 adapter->aq_required |= I40EVF_FLAG_AQ_DISABLE_QUEUES; 998 adapter->aq_required |= I40EVF_FLAG_AQ_DISABLE_QUEUES;
997 } 999 }
998 netif_tx_disable(netdev);
999 1000
1000 netif_tx_stop_all_queues(netdev);
1001
1002 msleep(20);
1003
1004 netif_carrier_off(netdev);
1005 clear_bit(__I40EVF_IN_CRITICAL_TASK, &adapter->crit_section); 1001 clear_bit(__I40EVF_IN_CRITICAL_TASK, &adapter->crit_section);
1006} 1002}
1007 1003