Skip to content

fix(gve): use gve_schedule_reset on adminq flow rule timeout - #95

Closed
renich wants to merge 1 commit into
GoogleCloudPlatform:releasefrom
renich:fix/adminq-reset-deadlock-93
Closed

renich wants to merge 1 commit into
GoogleCloudPlatform:releasefrom
renich:fix/adminq-reset-deadlock-93

Conversation

@renich

@renich renich commented Aug 4, 2026

Copy link
Copy Markdown

Summary

Fixes a hard deadlock (AB-BA circular lock inversion) during early boot or driver reset on EL10 / RHEL 10 kernels when AdminQ flow rule configuration times out.

Root Cause

Calling gve_reset() synchronously inside gve_adminq_configure_flow_rule() when an AdminQ command times out violates the driver's lock hierarchy. When invoked under netlink / ethtool callbacks, this creates a lock inversion deadlock with rtnl_lock.

Fix

Replaces direct gve_reset() with gve_schedule_reset() to defer reset execution safely to gve_service_task under the proper lock context.

Fixes #93

CC: @hramamurthy12 @josh8551021 @jordanrh1 @agarg2008

Co-developed-by: Gemini AI renich+gemini@woralelandia.com
Signed-off-by: Rénich Bon Ćirić renich@woralelandia.com

Calling gve_reset() synchronously inside gve_adminq_configure_flow_rule()
when an AdminQ command times out violates the driver's lock hierarchy and
can trigger a hard AB-BA lock inversion deadlock with rtnl_lock when
invoked under netlink / ethtool callbacks.

Replace direct gve_reset() with gve_schedule_reset() to defer reset
execution safely to gve_service_task under the proper lock context.

Fixes GoogleCloudPlatform#93

Co-developed-by: Gemini AI <renich+gemini@woralelandia.com>
Signed-off-by: Rénich Bon Ćirić <renich@woralelandia.com>
@hramamurthy12

Copy link
Copy Markdown
Collaborator

Hi, I missed this earlier when closing #93 that this patch is trying to fix Issue #93.

Could you provide a splat for this particular issue if you encountered it?

Like mentioned in Issue #93, we have a fix in progress to fix the following stack track during boot time on modern EL10 / RHEL 10 kernels.

INFO: task NetworkManager:968 blocked for more than 122 seconds.
Call Trace:
 <TASK>
 __schedule+0x2bc/0x710
 schedule+0x27/0x80
 schedule_preempt_disabled+0x15/0x30
 __mutex_lock.constprop.0+0x42d/0x820
 gve_add_napi+0x46/0x70 [gve]
 gve_queues_start+0xa6/0x460 [gve]
 gve_open+0x105/0x130 [gve]
 __dev_open+0x113/0x280
 __dev_change_flags+0x1bb/0x220
 netif_change_flags+0x26/0x70
 do_setlink.isra.0+0x360/0xd70
 rtnl_newlink+0x368/0x600
 ...
 </TASK>

But we haven't come across a stack trace related to this particular path through gve_adminq_configure_flow_rule().

We also scanned our backend to see if the AdminQ was returning this particular error(which indicates programming the one flow steering rule timed out but the AdminQ itself is active for future commands) and we did not see any occurrences of it.

If you did hit this issue, would be great if you could give us more information here or file a support ticket.

@renich

renich commented Aug 8, 2026

Copy link
Copy Markdown
Author

Hi @hramamurthy12,

Thanks for the follow-up! You are correct—linking Issue #93 here was a reference mistake. Issue #93 was originally opened for the CentOS Stream 10 gve_add_napi deadlock (which MR !3007 addresses).

PR #95 was created during a static lock hierarchy audit of the driver's reset paths. Calling gve_reset(priv, true) synchronously on AdminQ flow rule timeout (err == -ETIME) under ethtool/netlink callbacks attempts to acquire rtnl_lock inside an inner driver lock context, causing an AB-BA lock inversion. Replacing it with gve_schedule_reset(priv) safely defers reset execution to gve_service_task out-of-band.

Przemek Kitszel reviewed the logic on netdev and approved it ("code looks good"). We've submitted [PATCH net v2] upstream with the Fixes tag updated to 57718b60df9b ("gve: Add flow steering adminq commands"), added Przemek's Reviewed-by:, and removed the misleading #93 link.

@hramamurthy12

Copy link
Copy Markdown
Collaborator

Hi, I don't see a need for this patch.

The issue the commit message describes can't happen: gve_reset() does not acquire the rtnl_lock(). Also, there is no inner driver lock context that is acquired at this point. The inner driver lock context that the AI is complaining about is possibly priv->adminq_lock but that is already released on error by gve_adminq_execute_cmd().

gve_reset() is also written in such a way that the onus is on the caller to acquire the appropriate locks - either through the ethtool core when calling gve_user_reset()/gve_set_rxnfc() or explicitly by gve_handle_reset(). So a deadlock is not possible.

We'd be happy to look at any issue that is reproducible or there is a splat for. As such, since there is no reproducer and we also have info from our backend that this -ETIME Adminq error hasn't surfaced, I'm closing this issue. Please file an issue along with a splat if you do encounter it.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deadlock: Lock inversion between rtnl_lock and service_task_mutex in gve_add_napi

2 participants