Skip to content

Commit f5b7f49

Browse files
agarg2008gregkh
authored andcommitted
gve: defer interrupt enabling until NAPI registration
commit 3d970ed upstream. Currently, interrupts are automatically enabled immediately upon request. This allows interrupt to fire before the associated NAPI context is fully initialized and cause failures like below: [ 0.946369] Call Trace: [ 0.946369] <IRQ> [ 0.946369] __napi_poll+0x2a/0x1e0 [ 0.946369] net_rx_action+0x2f9/0x3f0 [ 0.946369] handle_softirqs+0xd6/0x2c0 [ 0.946369] ? handle_edge_irq+0xc1/0x1b0 [ 0.946369] __irq_exit_rcu+0xc3/0xe0 [ 0.946369] common_interrupt+0x81/0xa0 [ 0.946369] </IRQ> [ 0.946369] <TASK> [ 0.946369] asm_common_interrupt+0x22/0x40 [ 0.946369] RIP: 0010:pv_native_safe_halt+0xb/0x10 Use the `IRQF_NO_AUTOEN` flag when requesting interrupts to prevent auto enablement and explicitly enable the interrupt in NAPI initialization path (and disable it during NAPI teardown). This ensures that interrupt lifecycle is strictly coupled with readiness of NAPI context. Cc: stable@vger.kernel.org Fixes: 1dfc2e4 ("gve: Refactor napi add and remove functions") Signed-off-by: Ankit Garg <nktgrg@google.com> Reviewed-by: Jordan Rhee <jordanrhee@google.com> Reviewed-by: Joshua Washington <joshwash@google.com> Signed-off-by: Harshitha Ramamurthy <hramamurthy@google.com> Link: https://patch.msgid.link/20251219102945.2193617-1-hramamurthy@google.com Signed-off-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent d579cc5 commit f5b7f49

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

drivers/net/ethernet/google/gve/gve_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ static int gve_alloc_notify_blocks(struct gve_priv *priv)
500500
block->priv = priv;
501501
err = request_irq(priv->msix_vectors[msix_idx].vector,
502502
gve_is_gqi(priv) ? gve_intr : gve_intr_dqo,
503-
0, block->name, block);
503+
IRQF_NO_AUTOEN, block->name, block);
504504
if (err) {
505505
dev_err(&priv->pdev->dev,
506506
"Failed to receive msix vector %d\n", i);

drivers/net/ethernet/google/gve/gve_utils.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,13 @@ void gve_add_napi(struct gve_priv *priv, int ntfy_idx,
111111
struct gve_notify_block *block = &priv->ntfy_blocks[ntfy_idx];
112112

113113
netif_napi_add(priv->dev, &block->napi, gve_poll);
114+
enable_irq(block->irq);
114115
}
115116

116117
void gve_remove_napi(struct gve_priv *priv, int ntfy_idx)
117118
{
118119
struct gve_notify_block *block = &priv->ntfy_blocks[ntfy_idx];
119120

121+
disable_irq(block->irq);
120122
netif_napi_del(&block->napi);
121123
}

0 commit comments

Comments
 (0)