Skip to contentSkip to conversation

idpf: batch RCU grace periods when deleting NAPIs

PATCH Applied Eric Dumazet 2 participants 2 messages Nov 18 – Nov 21

Subsystems (3)
lore
Share & tools
lore

Eric Dumazet

author maintainer
#0 lore raw

PATCH 1/1 idpf: batch RCU grace periods when deleting NAPIs

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.

---
Cc: Tony Nguyen <[email protected]>
Cc: Przemek Kitszel <[email protected]>
Cc: Andrew Lunn <[email protected]>

---
 drivers/net/ethernet/intel/idpf/idpf_txrx.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/ethernet/intel/idpf/idpf_txrx.c +4 -1
index b346187bbf301847224cd7d1655a9294b893acb9..d76613310b12a074117662d0558d2467a21e3bc4 100644
@@ -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();
 }
 
 /**
Signature · 1 line
2.53.0
#1 lore raw
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 8 lines · On Wed, 18 Nov 2026 22:35:38 +0100 you wrote:

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.

[...]

Here is the summary with links:
- [net-next] idpf: batch RCU grace periods when deleting NAPIs

    https://git.kernel.org/netdev/net-next/c/bd5ce5c9ae25

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html