BPF List
 help / color / mirror / Atom feed
* [PATCH net 0/2] gve: fix XDP program and XSK pool removal after a config change
@ 2026-12-03  6:12 Amaan Cheval
  2026-12-03  6:12 ` [PATCH net 1/2] gve: do not verify the XDP configuration on program or pool removal Amaan Cheval
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Amaan Cheval @ 2026-12-03  6:12 UTC (permalink / raw)
  To: netdev
  Cc: joshwash, hramamurthy, andrew+netdev, davem, edumazet, kuba,
	pabeni, ast, daniel, hawk, john.fastabend, sdf, bpf, willemb,
	jeroendb, pkaligineedi, nktgrg, jordanrhee, przemyslaw.kitszel,
	debarghyak, treapking, Amaan Cheval

gve checks that the device configuration supports XDP on every ndo_bpf
call, including the ones that remove a program or disable an AF_XDP
zero-copy pool. Once the MTU has been raised past the XDP limit, removal
is refused, which the core does not expect: netlink removal fails, and a
bpf_link release leaves the program running in the driver.

Patch 1 runs the check only when a program is installed or a pool is
enabled. The bug was reproduced and the
fix tested on gVNIC in GQI-QPL mode (GCE n2-standard-4) on net and, as
a backport, on Debian 13's 6.12.117, and in DQO-RDA mode
(c3-standard-4) on net; reproduce.sh is at
https://github.com/AmaanC/sticky-xdp
The results on net were taken with both patches applied; patch 2 does
not touch the removal paths. The 6.12.117 backport had patch 1 alone.

Patch 2 fixes a separate problem on the line patch 1 moves: the pool
path passes an extack that is not valid for XDP_SETUP_XSK_POOL. It is
latent with CONFIG_INIT_STACK_ALL_ZERO and was reproduced on a kernel
built with CONFIG_INIT_STACK_ALL_PATTERN.

Other drivers avoid the first problem by running their checks only when
a program is installed (mlx5, ice, veth), and by refusing an MTU change
that an attached program cannot handle (those three, and i40e, ixgbe,
igc). gve already refuses HW-GRO, header split and RX buffer size
changes, and queue count changes that XDP cannot use, while a program is
attached, but not an MTU change, and those guards do not cover a
zero-copy pool that was enabled without a program: raising the queue
counts then makes the pool disable fail in the same way. This series
makes gve run its check only on install and pool enable, so that
removal no longer depends on the configuration passing the XDP check.

Not changed by this series: gve still lets the MTU be raised past the
XDP limit while a program is attached, and the GQI receive path runs
the program only on frames that fit one buffer, so larger frames would
reach the stack without it. That is a separate problem.

A removal can also still fail if gve cannot rebuild its queues in
gve_adjust_config(), reached from gve_set_xdp(); that takes an
allocation or device failure, not a configuration change, and is not
addressed here.

Also not changed, both found by reading the code during review of this
series and not reproduced:
- gve_xsk_pool_disable() unmaps the pool before it stops the queue, so
  a receive poll that is still running can use a pool whose device
  pointer has been cleared. That needs a separate fix.
- xp_assign_dev() and xp_disable_drv_zc() pass drivers an on-stack
  struct netdev_bpf that is not zeroed, and idpf_xsk_pool_setup() also
  reads extack from it. Zeroing it in the core would cover every
  driver; patch 2 fixes gve on its own and does not depend on that.

Both were found with the help of an AI coding assistant, used
interactively to read the driver and the XDP core, write the
reproducers and run the tests; details are in each patch.

Amaan Cheval (2):
  gve: do not verify the XDP configuration on program or pool removal
  gve: do not pass extack to the XDP check on XSK pool setup

 drivers/net/ethernet/google/gve/gve_main.c | 23 ++++++++++++++++------
 1 file changed, 17 insertions(+), 6 deletions(-)


base-commit: ef3e21c61baa74e39a49b75318bd4541562ec43f
-- 
2.47.3


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-12-03 11:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-03  6:12 [PATCH net 0/2] gve: fix XDP program and XSK pool removal after a config change Amaan Cheval
2026-12-03  6:12 ` [PATCH net 1/2] gve: do not verify the XDP configuration on program or pool removal Amaan Cheval
2026-12-03  6:12 ` [PATCH net 2/2] gve: do not pass extack to the XDP check on XSK pool setup Amaan Cheval
2026-12-03 11:11 ` [PATCH net 0/2] gve: fix XDP program and XSK pool removal after a config change Maciej Fijalkowski
2026-12-03 11:45   ` Amaan Cheval

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox