From: Eric Dumazet <edumazet@kernel.org>
To: "David S . Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Willem de Bruijn <willemb@google.com>
Cc: Simon Horman <horms@kernel.org>,
netdev@vger.kernel.org, Eric Dumazet <edumazet@kernel.org>,
Tony Nguyen <anthony.l.nguyen@intel.com>,
Przemek Kitszel <przemyslaw.kitszel@intel.com>,
Andrew Lunn <andrew+netdev@lunn.ch>
Subject: [PATCH net-next] idpf: batch RCU grace periods when deleting NAPIs
Date: Wed, 18 Nov 2026 22:35:38 +0100 [thread overview]
Message-ID: <20261118213538.1485503-1-edumazet@kernel.org> (raw)
netif_napi_del() waits for an RCU grace period after each NAPI.
idpf_vport_intr_napi_del_all() calls it for every q_vector, so
stopping a vport with N vectors waits for N grace periods. This
happens on ifdown, and on each soft reset triggered by a channel,
ring size or MTU change.
Use __netif_napi_del() and a single synchronize_net() after the loop.
The callers are unchanged: idpf_vport_intr_deinit() still deletes the
NAPIs after they have been disabled and the DIM works drained, and
before the IRQs are released. The error path of idpf_vport_intr_init()
deletes NAPIs which were never enabled.
Compile tested only.
Signed-off-by: Eric Dumazet <edumazet@kernel.org>
---
Cc: Tony Nguyen <anthony.l.nguyen@intel.com>
Cc: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Cc: Andrew Lunn <andrew+netdev@lunn.ch>
---
drivers/net/ethernet/intel/idpf/idpf_txrx.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/idpf/idpf_txrx.c b/drivers/net/ethernet/intel/idpf/idpf_txrx.c
index b346187bbf301847224cd7d1655a9294b893acb9..d76613310b12a074117662d0558d2467a21e3bc4 100644
--- a/drivers/net/ethernet/intel/idpf/idpf_txrx.c
+++ b/drivers/net/ethernet/intel/idpf/idpf_txrx.c
@@ -3864,7 +3864,10 @@ static irqreturn_t idpf_vport_intr_clean_queues(int __always_unused irq,
static void idpf_vport_intr_napi_del_all(struct idpf_q_vec_rsrc *rsrc)
{
for (u16 v_idx = 0; v_idx < rsrc->num_q_vectors; v_idx++)
- netif_napi_del(&rsrc->q_vectors[v_idx].napi);
+ __netif_napi_del(&rsrc->q_vectors[v_idx].napi);
+
+ /* Observe an RCU grace period after __netif_napi_del() calls. */
+ synchronize_net();
}
/**
--
2.53.0
reply other threads:[~2026-11-18 21:35 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20261118213538.1485503-1-edumazet@kernel.org \
--to=edumazet@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=anthony.l.nguyen@intel.com \
--cc=davem@davemloft.net \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=przemyslaw.kitszel@intel.com \
--cc=willemb@google.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