[Intel-wired-lan] [PATCH net-next 06/15] iavf: disable interrupts before disabling napi
Tony Nguyen
anthony.l.nguyen at intel.com
Fri Jun 4 16:53:26 UTC 2021
From: Nicholas Nunley <nicholas.d.nunley at intel.com>
Interrupts should be turned off first before disabling napi, not the other
way around, since the interrupt handler can schedule napi.
Signed-off-by: Nicholas Nunley <nicholas.d.nunley at intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen at intel.com>
---
drivers/net/ethernet/intel/iavf/iavf_main.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c b/drivers/net/ethernet/intel/iavf/iavf_main.c
index eda8ebb8e7b8..1904000943dc 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_main.c
+++ b/drivers/net/ethernet/intel/iavf/iavf_main.c
@@ -970,8 +970,8 @@ void iavf_down(struct iavf_adapter *adapter)
netif_carrier_off(netdev);
netif_tx_disable(netdev);
adapter->link_up = false;
- iavf_napi_disable_all(adapter);
iavf_irq_disable(adapter);
+ iavf_napi_disable_all(adapter);
spin_lock_bh(&adapter->mac_vlan_list_lock);
@@ -2040,8 +2040,8 @@ static void iavf_disable_vf(struct iavf_adapter *adapter)
netif_carrier_off(adapter->netdev);
netif_tx_disable(adapter->netdev);
adapter->link_up = false;
- iavf_napi_disable_all(adapter);
iavf_irq_disable(adapter);
+ iavf_napi_disable_all(adapter);
iavf_free_traffic_irqs(adapter);
iavf_free_all_tx_resources(adapter);
iavf_free_all_rx_resources(adapter);
@@ -2171,6 +2171,8 @@ static void iavf_reset_task(struct work_struct *work)
}
continue_reset:
+ iavf_irq_disable(adapter);
+
/* We don't use netif_running() because it may be true prior to
* ndo_open() returning, so we can't assume it means all our open
* tasks have finished, since we're not holding the rtnl_lock here.
@@ -2182,7 +2184,6 @@ static void iavf_reset_task(struct work_struct *work)
adapter->link_up = false;
iavf_napi_disable_all(adapter);
}
- iavf_irq_disable(adapter);
adapter->state = __IAVF_RESETTING;
adapter->flags &= ~IAVF_FLAG_RESET_PENDING;
--
2.20.1
More information about the Intel-wired-lan
mailing list