From: Matteo Croce <technoboy85@gmail.com>
To: Tony Nguyen <anthony.l.nguyen@intel.com>,
Przemek Kitszel <przemyslaw.kitszel@intel.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Jesper Dangaard Brouer <hawk@kernel.org>,
John Fastabend <john.fastabend@gmail.com>,
Mohsin Bashir <mohsin.bashr@gmail.com>,
"Nemo D'ACREMONT" <nemo.dacremont@dacremont.xyz>
Cc: netdev@vger.kernel.org, bpf@vger.kernel.org,
intel-wired-lan@lists.osuosl.org, linux-kernel@vger.kernel.org
Subject: [PATCH net-next v5 2/6] e1000e: disable NAPI when bringing the interface down
Date: Fri, 4 Dec 2026 21:43:56 +0100 [thread overview]
Message-ID: <20261204204400.87468-3-technoboy85@gmail.com> (raw)
In-Reply-To: <20261204204400.87468-1-technoboy85@gmail.com>
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@gmail.com>
---
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
next prev parent reply other threads:[~2026-12-04 20:44 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-04 20:43 [PATCH net-next v5 0/6] e1000e: add XDP support Matteo Croce
2026-12-04 20:43 ` [PATCH net-next v5 1/6] e1000e: clean the Tx ring from NAPI in MSI-X mode Matteo Croce
2026-12-04 20:43 ` Matteo Croce [this message]
2026-12-04 20:43 ` [PATCH net-next v5 3/6] e1000e: remove packet split Rx Matteo Croce
2026-12-04 20:43 ` [PATCH net-next v5 4/6] e1000e: use libeth for Rx buffer management Matteo Croce
2026-12-04 20:44 ` [PATCH net-next v5 6/6] e1000e: add .ndo_xdp_xmit support Matteo Croce
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261204204400.87468-3-technoboy85@gmail.com \
--to=technoboy85@gmail.com \
--cc=andrew+netdev@lunn.ch \
--cc=anthony.l.nguyen@intel.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hawk@kernel.org \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=john.fastabend@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mohsin.bashr@gmail.com \
--cc=nemo.dacremont@dacremont.xyz \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=przemyslaw.kitszel@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox