Netdev List
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: kuba@kernel.org
Cc: davem@davemloft.net, netdev@vger.kernel.org, edumazet@google.com,
	pabeni@redhat.com, andrew+netdev@lunn.ch, horms@kernel.org,
	michael.chan@broadcom.com, manishc@marvell.com,
	joshwash@google.com, hramamurthy@google.com, tariqt@nvidia.com,
	saeedm@nvidia.com, daniel@iogearbox.net, hawk@kernel.org,
	sdf@fomichev.me, willemb@google.com,
	przemyslaw.kitszel@intel.com, bpf@vger.kernel.org,
	nktgrg@google.com
Subject: Re: [PATCH net-next v2 9/9] eth: gve: drop the now-dead HW-GRO vs XDP interlock
Date: Mon, 23 Nov 2026 01:33:52 +0000	[thread overview]
Message-ID: <179539763293.3135.3326411357299687013@kernel.org> (raw)
In-Reply-To: <20261122010112.1471146-10-kuba@kernel.org>

Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider.

Critical: 0 · High: 0 · Medium: 1 · Low: 1

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] A rejected XDP attach on a running gve DQO device with HW-GRO
  on (the DQO default) now rebuilds all of the device's hardware queues…
- [Low] gve's XDP attach path no longer reports its own error when HW-GRO
  cannot be turned off, because the HW-GRO handling now happens inside…

--

eth: gve: drop the now-dead HW-GRO vs XDP interlock

This patch removes two gve checks: one refused XDP while HW-GRO was on,
the other refused HW-GRO while XDP was attached. The core now clears
NETIF_F_GRO_HW before ndo_bpf runs and keeps it off while a program is
attached. Attaching XDP with HW-GRO on now succeeds with HW-GRO turned
off instead of failing with -EOPNOTSUPP.

> diff --git a/drivers/net/ethernet/google/gve/gve_main.c b/drivers/net/ethernet/google/gve/gve_main.c
> index 35cf0f06a0f27..59ced629dcf6b 100644
> --- a/drivers/net/ethernet/google/gve/gve_main.c
> +++ b/drivers/net/ethernet/google/gve/gve_main.c
> @@ -1804,12 +1804,6 @@ static int gve_verify_xdp_configuration(struct net_device *dev,
>  		return -EOPNOTSUPP;
>  	}
>  
> -	if (dev->features & NETIF_F_GRO_HW) {
> -		NL_SET_ERR_MSG_MOD(extack,
> -				   "XDP is not supported when HW-GRO is on.");
> -		return -EOPNOTSUPP;
> -	}
> -
>  	if (priv->header_split_enabled) {
>  		NL_SET_ERR_MSG_MOD(extack,
>  				   "XDP is not supported when header-data split is enabled.");

[Severity: Medium]
With this check gone, a rejected XDP attach on a running gve DQO device
with HW-GRO on (the DQO default) seems to rebuild every hardware queue
twice before it fails. Is that intended?

In dev_xdp_attach(), HW-GRO is cleared before dev_xdp_install() and
ndo_bpf get a chance to refuse:

net/core/dev.c:dev_xdp_attach() {
    ...
		if (new_prog) {
			dev->xdp_pending = 1;
			err = dev_xdp_clear_rx_agg(dev, extack);
			if (err)
				goto err_clear_pending;
		}

		err = dev_xdp_install(dev, mode, bpf_op, extack, flags, new_prog);
		if (err)
			goto err_clear_pending;
    ...
err_clear_pending:
	dev->xdp_pending = 0;
	netdev_update_features(dev);
	return err;
}

dev_xdp_clear_rx_agg()->netdev_update_features() reaches
gve_set_features() with GRO_HW cleared. On a running device that runs a
full gve_adjust_config(): gve_queues_mem_alloc(), gve_close(), then
gve_queues_start(). RSC is fixed per queue when the queue is created, in
gve_adminq_create_rx_queue():

	cmd->create_rx_queue.enable_rsc =
		!!(priv->dev->features & NETIF_F_GRO_HW);

The remaining refusals only run after that rebuild. First come the core
checks in dev_xdp_install(), then
gve_xdp()->gve_verify_xdp_configuration(), which checks queue format,
header split, buffer size, MTU and queue counts.

If any of them fails, err_clear_pending calls netdev_update_features()
again. GRO_HW is still in wanted_features, so gve_adjust_config() runs a
second time to turn RSC back on.

DQO_QPL looks like the easiest way to hit this. gve_init_priv() enables
NETIF_F_GRO_HW for every DQO format, but gve_set_netdev_xdp_features()
leaves xdp_features at 0 for DQO_QPL:

	} else {
		xdp_features = 0;
	}

As a result, every native attach on a running DQO_QPL device rebuilds the
queues twice and then fails with "XDP is not supported on this queue
format.". The MTU and queue-count refusals can be hit the same way on
DQO_RDA, for example with a jumbo MTU.

Either rebuild can also fail in gve_queues_start(), which leaves the
interface running with no live queues:

	err = gve_queues_start(priv, tx_alloc_cfg, rx_alloc_cfg);
	if (err) {
		netif_err(priv, drv, priv->dev,
			  "Adjust config failed to start new queues, !!! DISABLING ALL QUEUES !!!\n");
		gve_queues_mem_remove(priv);
		gve_turndown(priv);
		return err;
	}

Before the series, gve refused the same request right away with no
hardware side effects. The new ordering comes from the earlier patch
"net: state the "XDP excludes HW-GRO" rule in the core", which put
dev_xdp_clear_rx_agg() ahead of dev_xdp_install() and ndo_bpf.

The commit message only describes the success case ("now succeeds with
HW-GRO turned off"). Even a successful attach now rebuilds the queues
twice: once for the GRO_HW toggle and once in gve_configure_rings_xdp().

Could the gve configuration checks run before the core clears HW-GRO? If
the double rebuild is acceptable, could the commit message say so?

> @@ -2218,12 +2212,6 @@ static int gve_set_features(struct net_device *netdev,
>  	if ((netdev->features & NETIF_F_GRO_HW) !=
>  	    (features & NETIF_F_GRO_HW)) {
>  		netdev->features ^= NETIF_F_GRO_HW;
> -		if (priv->xdp_prog && (netdev->features & NETIF_F_GRO_HW)) {
> -			netdev_warn(netdev,
> -				    "HW-GRO is not supported when XDP is on.");
> -			err = -EOPNOTSUPP;
> -			goto revert_features;
> -		}
>  		if (netif_running(netdev)) {
>  			err = gve_adjust_config(priv, &tx_alloc_cfg, &rx_alloc_cfg);
>  			if (err)

[Severity: Low]
If gve_adjust_config() fails here while the core is turning HW-GRO off
for an XDP attach, does the user get the real error back?

gve_set_features() restores orig_features and returns the errno.
__netdev_update_features() only logs that errno and returns -1, and
netdev_update_features() discards the -1. dev_xdp_clear_rx_agg() then
just re-reads dev->features:

net/core/dev.c:dev_xdp_clear_rx_agg() {
    ...
	netdev_update_features(dev);

	agg = dev->features & NETIF_F_XDP_DISABLES;
	if (agg) {
		NL_SET_ERR_MSG_FMT(extack,
				   "unable to disable %s, required by another feature",
				   dev_xdp_rx_agg_name(agg));
		return -EBUSY;
	}
    ...
}

gve has no ndo_fix_features, and no gve feature depends on HW-GRO. For
gve, GRO_HW can only stay on because gve_set_features() failed: -ENOMEM
from gve_queues_mem_alloc(), an adminq error from gve_close(), or a
gve_queues_start() failure.

The user gets -EBUSY and a feature-dependency message instead of the
real errno.

If gve_queues_start() was the failure, the device is also left turned
down. The later netdev_update_features() call in err_clear_pending finds
features already equal to wanted_features and does nothing. Nothing in
the extack shows that the NIC has lost its queues.

Before the series, gve refused the same request itself with a specific
-EOPNOTSUPP extack. The new error reporting comes from the earlier patch
"net: state the "XDP excludes HW-GRO" rule in the core".

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261122010112.1471146-1-kuba%40kernel.org

      reply	other threads:[~2026-11-23  1:33 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-22  1:01 [PATCH net-next v2 0/9] net: make core auto-disable HW-GRO and LRO when XDP gets attached Jakub Kicinski
2026-11-22  1:01 ` [PATCH net-next v2 1/9] net: stop making HW-GRO depend on SW GRO Jakub Kicinski
2026-11-22  1:01 ` [PATCH net-next v2 2/9] selftests: drv-net: gro_stats: use the shared set_ethtool_feat() Jakub Kicinski
2026-11-22  1:01 ` [PATCH net-next v2 3/9] selftests: drv-net: drop the generic XDP hack from the HW GRO setup Jakub Kicinski
2026-11-22  1:01 ` [PATCH net-next v2 4/9] net: state the "XDP excludes HW-GRO" rule in the core Jakub Kicinski
2026-11-23  1:33   ` netdev-bot+sashiko
2026-11-22  1:01 ` [PATCH net-next v2 5/9] net: state the "XDP excludes LRO" " Jakub Kicinski
2026-11-23  1:33   ` netdev-bot+sashiko
2026-11-22  1:01 ` [PATCH net-next v2 6/9] eth: mlx5e: drop the now-dead HW-GRO and LRO vs XDP handling Jakub Kicinski
2026-11-23  1:33   ` netdev-bot+sashiko
2026-11-22  1:01 ` [PATCH net-next v2 7/9] eth: bnxt_en: don't clear HW-GRO and LRO for XDP in ndo_fix_features Jakub Kicinski
2026-11-22  1:01 ` [PATCH net-next v2 8/9] eth: qede: drop the now-dead HW-GRO vs XDP handling Jakub Kicinski
2026-11-22  1:01 ` [PATCH net-next v2 9/9] eth: gve: drop the now-dead HW-GRO vs XDP interlock Jakub Kicinski
2026-11-23  1:33   ` netdev-bot+sashiko [this message]

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=179539763293.3135.3326411357299687013@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hawk@kernel.org \
    --cc=horms@kernel.org \
    --cc=hramamurthy@google.com \
    --cc=joshwash@google.com \
    --cc=kuba@kernel.org \
    --cc=manishc@marvell.com \
    --cc=michael.chan@broadcom.com \
    --cc=netdev@vger.kernel.org \
    --cc=nktgrg@google.com \
    --cc=pabeni@redhat.com \
    --cc=przemyslaw.kitszel@intel.com \
    --cc=saeedm@nvidia.com \
    --cc=sdf@fomichev.me \
    --cc=tariqt@nvidia.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