BPF List
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Harshitha Ramamurthy" <hramamurthy@google.com>
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH net-next v4 04/15] gve: add struct gve_device_info to hold device properties
Date: Sat, 15 Aug 2026 02:14:35 +0000	[thread overview]
Message-ID: <20260815021436.3A5451F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260814021406.3044324-5-hramamurthy@google.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] The driver ignores the hardware-requested default queue limits and blindly allocates the maximum number of queues due to an uninitialized variable introduced during refactoring.
- [Low] The conditional assignment of `max_rx_buffer_size` incorrectly drops valid device limits that are smaller than the driver's default size.
--

--- Patch [4]: [PATCH net-next v4 04/15] gve: add struct gve_device_info to hold device properties ---
commit 7fded5d146c6551cb7cea8119862eccd51e6f61f
Author: Harshitha Ramamurthy <hramamurthy@google.com>

gve: add struct gve_device_info to hold device properties

This commit introduces a new gve_device_info structure to hold negotiated
device properties for both AdminQ and upcoming MailboxQ modes. It refactors
gve_adminq_describe_device and its children to populate this structure and
centralizes device property initialization in gve_init_priv.

> diff --git a/drivers/net/ethernet/google/gve/gve_main.c b/drivers/net/ethernet/google/gve/gve_main.c
> --- a/drivers/net/ethernet/google/gve/gve_main.c
> +++ b/drivers/net/ethernet/google/gve/gve_main.c

[ ... ]

> -void gve_set_queue_properties(struct gve_priv *priv,
> -			      struct gve_device_descriptor *descriptor)
> +static void gve_set_queue_properties(struct gve_priv *priv)
>  {
> -	/* set default descriptor counts */
> -	gve_set_default_desc_cnt(priv, descriptor);
> +	struct gve_device_info *device_info = &priv->device_info;
>  
> -	priv->max_registered_pages = be64_to_cpu(descriptor->max_registered_pages);
> -	priv->tx_pages_per_qpl = be16_to_cpu(descriptor->tx_pages_per_qpl);
> -	priv->default_num_queues = be16_to_cpu(descriptor->default_num_queues);
> +	gve_set_desc_cnt(priv);
> +	priv->max_registered_pages = device_info->max_registered_pages;
> +	priv->tx_pages_per_qpl = device_info->tx_pages_per_qpl;
>  }

[Severity: Medium]
Does this leave priv->default_num_queues uninitialized?

The previous code initialized it from the descriptor. The new device_info
struct holds default_tx_queues and default_rx_queues, but it appears
priv->default_num_queues is no longer being populated.

Because of this, will gve_set_num_queues() bypass device-suggested queue
limits and always allocate the maximum possible number of queues since the
check for priv->default_num_queues > 0 will fail?

[ ... ]

> +static void gve_set_buf_sizes(struct gve_priv *priv)
> +{
> +	struct gve_device_info *device_info = &priv->device_info;
> +
> +	if (device_info->max_rx_buffer_size > priv->max_rx_buffer_size)
> +		priv->max_rx_buffer_size = device_info->max_rx_buffer_size;

[Severity: Low]
Is it intentional to only update priv->max_rx_buffer_size if the device
limit is strictly greater than the driver's current default?

The previous implementation in gve_enable_supported_features() applied the
device value unconditionally. Does this conditional check discard valid
hardware limits if they happen to be smaller than the driver's default size?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260814021406.3044324-1-hramamurthy@google.com?part=4

  reply	other threads:[~2026-08-15  2:14 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-14  2:13 [PATCH net-next v4 00/15] gve: AdminQ mode related refactors Harshitha Ramamurthy
2026-08-14  2:13 ` [PATCH net-next v4 01/15] gve: don't pass in unused parameter to gve_adminq_free Harshitha Ramamurthy
2026-08-15  2:14   ` sashiko-bot
2026-08-14  2:13 ` [PATCH net-next v4 02/15] gve: refactor initialization with helper functions Harshitha Ramamurthy
2026-08-15  2:14   ` sashiko-bot
2026-08-14  2:13 ` [PATCH net-next v4 03/15] gve: add a few helper functions to set device properties Harshitha Ramamurthy
2026-08-14  2:13 ` [PATCH net-next v4 04/15] gve: add struct gve_device_info to hold " Harshitha Ramamurthy
2026-08-15  2:14   ` sashiko-bot [this message]
2026-08-14  2:13 ` [PATCH net-next v4 05/15] gve: introduce control plane operations structure Harshitha Ramamurthy
2026-08-15  2:14   ` sashiko-bot
2026-08-14  2:13 ` [PATCH net-next v4 06/15] gve: introduce ctrl ops to set vectors and Qs Harshitha Ramamurthy
2026-08-15  2:14   ` sashiko-bot
2026-08-14  2:13 ` [PATCH net-next v4 07/15] gve: introduce gve_adminq_get_device_properties() Harshitha Ramamurthy
2026-08-14  2:13 ` [PATCH net-next v4 08/15] gve: refactor gve_init_priv for reset path Harshitha Ramamurthy
2026-08-15  2:14   ` sashiko-bot
2026-08-14  2:13 ` [PATCH net-next v4 09/15] gve: simplify reset logic Harshitha Ramamurthy
2026-08-15  2:14   ` sashiko-bot
2026-08-14  2:14 ` [PATCH net-next v4 10/15] gve: add gve_ctrl_ops for gve initialization/teardown sequences Harshitha Ramamurthy
2026-08-14  2:14 ` [PATCH net-next v4 11/15] gve: split up notify block allocation and setup paths Harshitha Ramamurthy
2026-08-14  2:14 ` [PATCH net-next v4 12/15] gve: introduce new methods to handle IRQ doorbells Harshitha Ramamurthy
2026-08-14  2:14 ` [PATCH net-next v4 13/15] gve: setup and teardown management interrupts Harshitha Ramamurthy
2026-08-14  2:14 ` [PATCH net-next v4 14/15] gve: add ctrl ops to for queue operations Harshitha Ramamurthy
2026-08-15  2:14   ` sashiko-bot
2026-08-14  2:14 ` [PATCH net-next v4 15/15] gve: add link status/speed ctrl ops Harshitha Ramamurthy
2026-08-15  2:14   ` sashiko-bot

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=20260815021436.3A5451F00A3A@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=hramamurthy@google.com \
    --cc=sashiko-reviews@lists.linux.dev \
    /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