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
Subject: Re: [PATCH net-next 8/8] eth: gve: drop the now-dead HW-GRO vs XDP interlock
Date: Sun, 22 Nov 2026 17:03:11 +0000 [thread overview]
Message-ID: <179536699175.3135.17888123102023780384@kernel.org> (raw)
In-Reply-To: <20261118232315.3593731-9-kuba@kernel.org>
Thank you for your contribution! Sashiko AI review found 3 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 2 · 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 gve XDP attach that gve will reject now rebuilds every queue
twice before failing.
- [Medium] Removing the `priv->xdp_prog && GRO_HW` refusal from
gve_set_features() lets gve rebuild its DQO RX queues with RSC on…
- [Low] The core reports a misleading -EBUSY "required by another
feature" when gve's ndo_set_features fails while it is clearing HW-GRO…
--
eth: gve: drop the now-dead HW-GRO vs XDP interlock
This patch removes two gve checks. One refused an XDP attach while
NETIF_F_GRO_HW was on, and the other refused to turn NETIF_F_GRO_HW back
on while an XDP program was attached. The core now clears HW-GRO before
ndo_bpf runs and keeps it off while a program is attached, so an XDP
attach with HW-GRO on now succeeds with HW-GRO turned off.
> diff --git a/drivers/net/ethernet/google/gve/gve_main.c b/drivers/net/ethernet/google/gve/gve_main.c
> index 0ee69bc11d836..8b65b8119662d 100644
> --- a/drivers/net/ethernet/google/gve/gve_main.c
> +++ b/drivers/net/ethernet/google/gve/gve_main.c
> @@ -1798,12 +1798,6 @@ static int gve_verify_xdp_configuration(struct net_device *dev,
> struct gve_priv *priv = netdev_priv(dev);
> u16 max_xdp_mtu;
>
> - 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, does an XDP attach that gve will reject anyway now
rebuild all of the queues twice before it fails?
In dev_xdp_attach(), the core clears HW-GRO before the driver sees the
program:
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;
}
On a running DQO device with HW-GRO on (the probe default), the sequence
is:
dev_xdp_clear_rx_agg()
netdev_update_features()
gve_set_features()
gve_adjust_config() <- rebuild 1, RSC off
dev_xdp_install()
gve_xdp()
gve_verify_xdp_configuration() <- returns -EOPNOTSUPP
err_clear_pending:
netdev_update_features()
gve_set_features()
gve_adjust_config() <- rebuild 2, RSC back on
gve_verify_xdp_configuration() can still refuse the attach at that point
in several cases:
- a jumbo MTU above 2048 - ETH_HLEN
- a packet_buffer_size other than SZ_2K
- header split with a frags-capable program (the core hds_config check
only rejects !xdp_has_frags)
- an RX/TX queue count mismatch
Before this change, the same request failed with -EOPNOTSUPP and the
queues were left alone. Now a refused attach interrupts traffic twice.
Either rebuild can also end up in the failure branch of
gve_adjust_config():
err = gve_queues_start(priv, tx_alloc_cfg, rx_alloc_cfg);
if (err) {
...
gve_queues_mem_remove(priv);
gve_turndown(priv);
return err;
}
Would it make sense to check gve's XDP preconditions before the core
reconfigures HW-GRO? If not, could the commit message mention this cost
on the failure path? The ordering comes from the core patch "net: state
the "XDP excludes HW-GRO" rule in the core".
> @@ -2212,12 +2206,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;
> - }
[Severity: Medium]
Can this check still fire when the core's XDP state and gve's
priv->xdp_prog disagree after a failed detach?
dev_xdp_detach_link() ignores the driver's return value and then
recomputes the features:
net/core/dev.c:dev_xdp_detach_link() {
...
WARN_ON(dev_xdp_install(dev, mode, bpf_op, NULL, 0, NULL));
dev_xdp_set_link(dev, mode, NULL);
netdev_update_features(dev);
...
}
gve_set_xdp() only writes priv->xdp_prog on success. So when the detach
fails, the program and the XDP rings stay active. There are at least two
ways for gve's detach to fail:
(a) gve_xdp() runs gve_verify_xdp_configuration() even for a NULL
program. gve has no ndo_change_mtu, so the MTU can be raised above
2048 - ETH_HLEN while XDP is attached. The detach then fails with
-EOPNOTSUPP.
(b) gve_configure_rings_xdp(priv, 0)->gve_adjust_config()->
gve_queues_mem_alloc() returns -ENOMEM.
Once the link is cleared, dev_xdp_prog_count() returns 0. That means
__netdev_update_features() keeps NETIF_F_GRO_HW from wanted_features
and calls gve_set_features().
Before this patch, the priv->xdp_prog check reverted that change. Now
gve_adjust_config() runs with the XDP rings still configured, and
gve_adminq_create_rx_queue() programs RSC from dev->features alone:
cmd->create_rx_queue.enable_rsc =
!!(priv->dev->features & NETIF_F_GRO_HW);
The DQO RX path would then run the program that is still attached on
only the first 2K buffer of each coalesced frame. A later
"ethtool -K rx-gro-hw on" would reach the same state.
Doesn't that contradict the statement in the commit message that
"neither of these can fire any more"?
> if (netif_running(netdev)) {
> err = gve_adjust_config(priv, &tx_alloc_cfg, &rx_alloc_cfg);
> if (err)
[Severity: Low]
The core's dev_xdp_clear_rx_agg() is now the only thing that turns
HW-GRO off before XDP on gve. What error does userspace see when this
gve_adjust_config() call fails during an XDP attach?
If gve_queues_mem_alloc(), gve_close() or gve_queues_start() fails,
gve_set_features() jumps to revert_features. That restores orig_features
with NETIF_F_GRO_HW still set:
revert_features:
netdev->features = orig_features;
return err;
__netdev_update_features() logs the real errno with netdev_err() and
returns -1, but netdev_update_features() throws that away.
dev_xdp_clear_rx_agg() then treats the bit that is still set as a
feature dependency:
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, so no feature dependency exists here.
Could the core check the return value of __netdev_update_features(), so
that this case reports the driver's error instead of -EBUSY and a
dependency message? This also comes from the core patch "net: state the
"XDP excludes HW-GRO" rule in the core".
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261118232315.3593731-1-kuba%40kernel.org
prev parent reply other threads:[~2026-11-22 17:03 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-18 23:23 [PATCH net-next 0/8] net: adjust HW GRO and LRO feature handling Jakub Kicinski
2026-11-18 23:23 ` [PATCH net-next 1/8] net: stop making HW-GRO depend on SW GRO Jakub Kicinski
2026-11-22 17:03 ` netdev-bot+sashiko
2026-11-18 23:23 ` [PATCH net-next 2/8] selftests: drv-net: drop the generic XDP hack from the HW GRO setup Jakub Kicinski
2026-11-19 21:40 ` Willem de Bruijn
2026-11-22 17:03 ` netdev-bot+sashiko
2026-11-18 23:23 ` [PATCH net-next 3/8] net: state the "XDP excludes HW-GRO" rule in the core Jakub Kicinski
2026-11-19 22:59 ` Willem de Bruijn
2026-11-20 22:13 ` Jakub Kicinski
2026-11-22 17:03 ` netdev-bot+sashiko
2026-11-18 23:23 ` [PATCH net-next 4/8] net: state the "XDP excludes LRO" " Jakub Kicinski
2026-11-19 23:02 ` Willem de Bruijn
2026-11-19 23:24 ` sashiko-bot
2026-11-22 17:03 ` netdev-bot+sashiko
2026-11-18 23:23 ` [PATCH net-next 5/8] eth: mlx5e: drop the now-dead HW-GRO and LRO vs XDP handling Jakub Kicinski
2026-11-19 15:42 ` Dragos Tatulea
2026-11-22 17:03 ` netdev-bot+sashiko
2026-11-18 23:23 ` [PATCH net-next 6/8] eth: bnxt_en: don't clear HW-GRO and LRO for XDP in ndo_fix_features Jakub Kicinski
2026-11-18 23:23 ` [PATCH net-next 7/8] eth: qede: drop the now-dead HW-GRO vs XDP handling Jakub Kicinski
2026-11-22 17:03 ` netdev-bot+sashiko
2026-11-18 23:23 ` [PATCH net-next 8/8] eth: gve: drop the now-dead HW-GRO vs XDP interlock Jakub Kicinski
2026-11-18 23:44 ` Ankit Garg
2026-11-19 22:14 ` Harshitha Ramamurthy
2026-11-22 17:03 ` 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=179536699175.3135.17888123102023780384@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=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