The upcoming page pool conversion requires that NAPI is disabled during
reconfiguration windows. Otherwise pool destruction would fail the
assertion that NAPI will not race, causing a benign but loud warning.

Move napi_disable into e1000e_down and add a napi_enable to e1000e_up.
This follows convention of all other Intel drivers.

Because napi_disable would hang if called twice, all callers of
e1000e_down must now be serialized. As of this patch, I'm convinced this
is true.

Signed-off-by: Matt Vollrath <[email protected]>
Assisted-by: Claude:claude-5-fable
---
 drivers/net/ethernet/intel/e1000e/netdev.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c 
b/drivers/net/ethernet/intel/e1000e/netdev.c
index 194166531bc8..6d846cacb026 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -3527,6 +3527,8 @@ void e1000e_up(struct e1000_adapter *adapter)
        /* hardware has been reset, we need to reload some things */
        e1000_configure(adapter);
 
+       napi_enable(&adapter->napi);
+
        clear_bit(__E1000_DOWN, &adapter->state);
 
        if (adapter->msix_entries)
@@ -3601,7 +3603,7 @@ void e1000e_down(struct e1000_adapter *adapter, bool 
reset)
 
        e1000_irq_disable(adapter);
 
-       napi_synchronize(&adapter->napi);
+       napi_disable(&adapter->napi);
 
        timer_delete_sync(&adapter->watchdog_timer);
        timer_delete_sync(&adapter->phy_info_timer);
@@ -4055,7 +4057,6 @@ int e1000e_close(struct net_device *netdev)
 
        netif_queue_set_napi(netdev, 0, NETDEV_QUEUE_TYPE_RX, NULL);
        netif_queue_set_napi(netdev, 0, NETDEV_QUEUE_TYPE_TX, NULL);
-       napi_disable(&adapter->napi);
 
        e1000e_free_tx_resources(adapter->tx_ring);
        e1000e_free_rx_resources(adapter->rx_ring);
-- 
2.43.0

Reply via email to