[PATCH net-next v5 2/6] e1000e: disable NAPI when bringing the interface down

From: Matteo Croce

Date: Fri Dec 04 2026 - 15:44:29 EST


e1000e_down() only synchronizes with a running NAPI poll, leaving NAPI
enabled, and NAPI is only disabled in e1000e_close().

A page_pool tied to a NAPI instance can only be destroyed when the NAPI
is disabled, as there must be no concurrent users of the pool's direct
recycling cache. This is needed to allocate the Rx buffers from a
page_pool which is created and destroyed when the interface is brought
up and down, e.g. on MTU changes.

Disable NAPI in e1000e_down() and enable it in e1000e_up(), as most
drivers do. e1000e_close() no longer needs to disable it, as when the
device is present it calls e1000e_down(), and when it is not present it
was already brought down when it was detached.

Signed-off-by: Matteo Croce <technoboy85@xxxxxxxxx>
---
drivers/net/ethernet/intel/e1000e/netdev.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
index 996bd6f5fa83..4badd502f3ce 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -4257,6 +4257,8 @@ void e1000e_up(struct e1000_adapter *adapter)

clear_bit(__E1000_DOWN, &adapter->state);

+ napi_enable(&adapter->napi);
+
if (adapter->msix_entries)
e1000_configure_msix(adapter);
e1000_irq_enable(adapter);
@@ -4329,7 +4331,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);
@@ -4774,6 +4776,9 @@ int e1000e_close(struct net_device *netdev)

pm_runtime_get_sync(&pdev->dev);

+ /* A device which is not present was already brought down, and its
+ * NAPI disabled, when it was detached.
+ */
if (netif_device_present(netdev)) {
e1000e_down(adapter, true);
e1000_free_irq(adapter);
@@ -4784,7 +4789,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.56.1