gve: Add adminq lock for queues creation and destruction
authorZiwei Xiao <ziweixiao@google.com>
Sat, 14 Jun 2025 00:07:50 +0000 (00:07 +0000)
committerJakub Kicinski <kuba@kernel.org>
Mon, 16 Jun 2025 22:27:24 +0000 (15:27 -0700)
commit21235ad935e907008481ea7fdf8837c5eddbd80e
tree421a300b2e6c0f86563f74825bbbca07286b789a
parentacd16380523b400400523fe54c7499320e558e80
gve: Add adminq lock for queues creation and destruction

Adminq commands for queues creation and destruction were not
consistently protected by the driver's adminq_lock. This was previously
benign as these operations were always initiated from contexts holding
kernel-level locks (e.g., rtnl_lock, netdev_lock), which provided
serialization.

Upcoming PTP aux_work will issue adminq commands directly from the
driver to read the NIC clock, without such kernel lock protection.
To prevent race conditions with this new PTP work, this patch ensures
the adminq_lock is held during queues creation and destruction.

Signed-off-by: Ziwei Xiao <ziweixiao@google.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: Harshitha Ramamurthy <hramamurthy@google.com>
Link: https://patch.msgid.link/20250614000754.164827-5-hramamurthy@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/google/gve/gve_adminq.c