From: netdev-bot+sashiko@kernel.org
To: hramamurthy@google.com
Cc: netdev@vger.kernel.org, joshwash@google.com,
andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com,
kuba@kernel.org, pabeni@redhat.com, ast@kernel.org,
daniel@iogearbox.net, hawk@kernel.org, john.fastabend@gmail.com,
sdf@fomichev.me, jordanrhee@google.com, willemb@google.com,
nktgrg@google.com, maolson@google.com, thostet@google.com,
jacob.e.keller@intel.com, debarghyak@google.com, kees@kernel.org,
bpf@vger.kernel.org, linux-kernel@vger.kernel.org,
przemyslaw.kitszel@intel.com
Subject: Re: [PATCH net-next v9 05/12] gve: refactor gve_init_priv for reset path
Date: Fri, 02 Oct 2026 10:06:31 +0000 [thread overview]
Message-ID: <179093559163.434549.8853251921845038273@kernel.org> (raw)
In-Reply-To: <20260930190428.1130007-6-hramamurthy@google.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 (1) · Low: 0
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [Medium] The commit message says "These changes are only code movement,
no functional change".
Pre-existing issues:
- [Medium] This problem wasn't introduced by this patch, but a hard reset
leaks the AdminQ dma_pool and its buffer.
--
gve: refactor gve_init_priv for reset path
This patch splits gve_init_priv() so that gve_probe() now does the AdminQ
setup (the new gve_adminq_init()) and the device property negotiation
(gve_adminq_get_device_properties()). Device setup moves into a new
gve_setup_device() helper. gve_reset_recovery() now calls
gve_adminq_init(), gve_adminq_verify_driver_compatibility() and
gve_setup_device() directly, instead of gve_init_priv(priv, true).
> diff --git a/drivers/net/ethernet/google/gve/gve_main.c b/drivers/net/ethernet/google/gve/gve_main.c
> index addfd8dc1a1a2..2fe280cf7e680 100644
> --- a/drivers/net/ethernet/google/gve/gve_main.c
> +++ b/drivers/net/ethernet/google/gve/gve_main.c
[ ... ]
> @@ -2566,15 +2541,32 @@ static int gve_reset_recovery(struct gve_priv *priv, bool was_up)
> {
> int err;
>
> - err = gve_init_priv(priv, true);
> - if (err)
> + err = gve_adminq_init(priv);
[Severity: Medium]
This isn't a bug introduced by this patch, but does a hard reset leak the
AdminQ dma_pool and its buffer here?
A hard reset is gve_reset(priv, false), or gve_reset() after gve_close()
fails. Either way it goes through:
gve_reset_and_teardown()
gve_trigger_reset()
gve_adminq_release()
gve_clear_admin_queue_ok(priv);
gve_teardown_priv_resources()
gve_adminq_free()
gve_adminq_free() then returns early, because ADMIN_QUEUE_OK is already
clear:
void gve_adminq_free(struct gve_priv *priv)
{
if (!gve_get_admin_queue_ok(priv))
return;
gve_adminq_release(priv);
dma_pool_free(priv->adminq_pool, priv->adminq, priv->adminq_bus_addr);
dma_pool_destroy(priv->adminq_pool);
...
}
So dma_pool_free() and dma_pool_destroy() never run. Then
gve_adminq_init() here calls gve_adminq_alloc(), which puts new
allocations in priv->adminq_pool and priv->adminq. The old pool and
buffer are lost.
The same thing seems to happen when gve_teardown_device_resources() calls
gve_trigger_reset() after a failed AdminQ command.
The baseline gve_init_priv(priv, true) path leaked in the same way. The
later "gve: simplify reset logic" patch in this series appears to fix it.
That patch makes gve_adminq_release() static and calls it only from
gve_adminq_free(). It also stops gve_adminq_release() from clearing
ADMIN_QUEUE_OK and removes gve_trigger_reset().
> + if (err) {
> + dev_err(&priv->pdev->dev,
> + "Failed to alloc admin queue: err=%d\n", err);
> goto err;
> + }
> +
[ ... ]
> if (was_up) {
> err = gve_open(priv->dev);
> if (err)
> - goto err;
> + return err;
[Severity: Medium]
The commit message says:
These changes are only code movement, no functional change.
Is that accurate? The patch seems to change behaviour in a few places.
First, gve_adminq_init() writes the version string before it allocates
the AdminQ:
gve_adminq_write_version(®_bar->driver_version);
return gve_adminq_alloc(priv);
gve_reset_recovery() now calls this helper. That means the driver version
string is written to the BAR0 driver_version register on every reset,
resume and recovery. Before this patch, gve_write_version() ran only once,
from gve_probe(). gve_recover() still does this at the end of the series.
Second, the order of device accesses in gve_probe() changes. The version
write now comes after the max_tx_queues/max_rx_queues ioread32be() reads
and after alloc_etherdev_mqs(). AdminQ registration,
VERIFY_DRIVER_COMPATIBILITY and DESCRIBE_DEVICE now run before ctrl_ops is
set, before map_db_bar() and before alloc_ordered_workqueue().
Third, when gve_open() fails here, the old goto err path logged "Reset
failed! !!! DISABLING ALL QUEUES !!!" and called gve_turndown(). Now the
function just returns. Neither gve_reset() nor gve_resume() logs the
error, so a failed re-open after reset or resume leaves nothing in the log.
The only place this is mentioned is the v3 changelog below the ---
line, and that text is dropped when the patch is applied. The changelog
says "don't free device resources if gve_open() fails in the reset path".
The baseline err label did not free device resources either, though.
The later "gve: simplify reset logic" patch adds a "Failed to start
queues ... DISABLING ALL QUEUES" message in gve_recover(). At this commit,
though, the message is missing.
Could the commit message describe these changes, instead of calling the
patch only code movement?
> }
> return 0;
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260930190428.1130007-1-hramamurthy%40google.com
next prev parent reply other threads:[~2026-10-02 10:06 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-30 19:04 [PATCH net-next v9 00/12] gve: AdminQ mode related refactors Harshitha Ramamurthy
2026-09-30 19:04 ` [PATCH net-next v9 01/12] gve: add struct gve_device_info to hold device properties Harshitha Ramamurthy
2026-10-02 10:06 ` netdev-bot+sashiko
2026-09-30 19:04 ` [PATCH net-next v9 02/12] gve: introduce control plane operations structure Harshitha Ramamurthy
2026-09-30 19:04 ` [PATCH net-next v9 03/12] gve: introduce ctrl ops to set vectors and Qs Harshitha Ramamurthy
2026-09-30 19:04 ` [PATCH net-next v9 04/12] gve: introduce gve_adminq_get_device_properties() Harshitha Ramamurthy
2026-09-30 19:04 ` [PATCH net-next v9 05/12] gve: refactor gve_init_priv for reset path Harshitha Ramamurthy
2026-10-02 10:06 ` netdev-bot+sashiko [this message]
2026-10-02 23:23 ` Harshitha Ramamurthy
2026-09-30 19:04 ` [PATCH net-next v9 06/12] gve: simplify reset logic Harshitha Ramamurthy
2026-10-02 10:06 ` netdev-bot+sashiko
2026-10-03 1:33 ` Joshua Washington
2026-09-30 19:04 ` [PATCH net-next v9 07/12] gve: add gve_ctrl_ops for gve initialization/teardown sequences Harshitha Ramamurthy
2026-10-02 10:06 ` netdev-bot+sashiko
2026-09-30 19:04 ` [PATCH net-next v9 08/12] gve: split up notify block allocation and setup paths Harshitha Ramamurthy
2026-09-30 19:04 ` [PATCH net-next v9 09/12] gve: introduce new methods to handle IRQ doorbells Harshitha Ramamurthy
2026-10-02 10:06 ` netdev-bot+sashiko
2026-09-30 19:04 ` [PATCH net-next v9 10/12] gve: setup and teardown management interrupts Harshitha Ramamurthy
2026-09-30 19:04 ` [PATCH net-next v9 11/12] gve: add ctrl ops for queue operations Harshitha Ramamurthy
2026-09-30 19:04 ` [PATCH net-next v9 12/12] gve: add link status/speed ctrl ops Harshitha Ramamurthy
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=179093559163.434549.8853251921845038273@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=debarghyak@google.com \
--cc=edumazet@google.com \
--cc=hawk@kernel.org \
--cc=hramamurthy@google.com \
--cc=jacob.e.keller@intel.com \
--cc=john.fastabend@gmail.com \
--cc=jordanrhee@google.com \
--cc=joshwash@google.com \
--cc=kees@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maolson@google.com \
--cc=netdev@vger.kernel.org \
--cc=nktgrg@google.com \
--cc=pabeni@redhat.com \
--cc=przemyslaw.kitszel@intel.com \
--cc=sdf@fomichev.me \
--cc=thostet@google.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
all inboxes | Powered by JetHome®