* Re: [PATCH net v2] gve: mark the flow rule cache out of sync when a rule update fails
2026-11-19 4:45 [PATCH net v2] gve: mark the flow rule cache out of sync when a rule update fails Zhao Li
@ 2026-11-20 2:31 ` Harshitha Ramamurthy
2026-11-24 10:24 ` Paolo Abeni
2026-11-24 10:30 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Harshitha Ramamurthy @ 2026-11-20 2:31 UTC (permalink / raw)
To: Zhao Li
Cc: Joshua Washington, Andrew Lunn, David S . Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Willem de Bruijn, Jordan Rhee,
Ankit Garg, Ziwei Xiao, Jeroen de Borst, Praveen Kaligineedi,
Tim Hostetler, Przemek Kitszel, Matt Olson, netdev, linux-kernel
On Wed, Nov 18, 2026 at 8:46 PM Zhao Li <enderaoelyther@gmail.com> wrote:
>
> gve_adminq_configure_flow_rule() marks the flow rule cache out of sync
> only when the device accepts the command, although a failed add,
> delete or reset can leave the device state unknown.
>
> gve_reset() sends the flow rule reset command from
> gve_teardown_control_plane_resources() and then frees and reallocates
> the cache buffers. If that command fails, the cache keeps its nonzero
> rule count and stays marked in sync, but its entries are now zeroed.
> gve_get_flow_rule_entry() then finds location 0 inside the cached range,
> since every zeroed entry has location 0, and reports an all-zero
> TCP/IPv4 rule that steers to queue 0, whatever the device holds at that
> location. Queries for other locations fall outside the cached range and
> read the rules from the device again.
>
> Mark the cache out of sync whenever a flow rule command is attempted,
> so that the next query reads the rules from the device.
>
> Found by an AI code review agent; not triggered. Compile-tested with W=1.
>
> Fixes: 57718b60df9b ("gve: Add flow steering adminq commands")
> Suggested-by: Harshitha Ramamurthy <hramamurthy@google.com>
> Signed-off-by: Zhao Li <enderaoelyther@gmail.com>
Thanks for the respin,
Reviewed-by: Harshitha Ramamurthy <hramamurthy@google.com>
> ---
> v2:
> - mark the cache out of sync on every flow rule command instead of
> clearing it when its buffers are freed (Harshitha Ramamurthy)
> - describe the problem in more detail; drop Cc: stable
> v1: https://lore.kernel.org/netdev/20261118023429.29330-1-enderaoelyther@gmail.com/
>
> No new W=1, sparse or smatch warnings.
>
> drivers/net/ethernet/google/gve/gve_adminq.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/google/gve/gve_adminq.c b/drivers/net/ethernet/google/gve/gve_adminq.c
> index 2c848f0c23dc..d0e0d9ace3bc 100644
> --- a/drivers/net/ethernet/google/gve/gve_adminq.c
> +++ b/drivers/net/ethernet/google/gve/gve_adminq.c
> @@ -1401,8 +1401,7 @@ gve_adminq_configure_flow_rule(struct gve_priv *priv,
> sizeof(struct gve_adminq_configure_flow_rule),
> flow_rule_cmd);
>
> - if (!err)
> - priv->flow_rules_cache.rules_cache_synced = false;
> + priv->flow_rules_cache.rules_cache_synced = false;
>
> return err;
> }
>
> base-commit: e203d8a4751d48aa00eda31e3b320ba8e0d47dbf
> --
> 2.56.1
>
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH net v2] gve: mark the flow rule cache out of sync when a rule update fails
2026-11-19 4:45 [PATCH net v2] gve: mark the flow rule cache out of sync when a rule update fails Zhao Li
2026-11-20 2:31 ` Harshitha Ramamurthy
@ 2026-11-24 10:24 ` Paolo Abeni
2026-11-24 10:30 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Paolo Abeni @ 2026-11-24 10:24 UTC (permalink / raw)
To: Zhao Li, Joshua Washington, Harshitha Ramamurthy, Andrew Lunn,
David S . Miller, Eric Dumazet, Jakub Kicinski
Cc: Willem de Bruijn, Jordan Rhee, Ankit Garg, Ziwei Xiao,
Jeroen de Borst, Praveen Kaligineedi, Tim Hostetler,
Przemek Kitszel, Matt Olson, netdev, linux-kernel
On 11/19/26 05:45, Zhao Li wrote:
> gve_adminq_configure_flow_rule() marks the flow rule cache out of sync
> only when the device accepts the command, although a failed add,
> delete or reset can leave the device state unknown.
>
> gve_reset() sends the flow rule reset command from
> gve_teardown_control_plane_resources() and then frees and reallocates
> the cache buffers. If that command fails, the cache keeps its nonzero
> rule count and stays marked in sync, but its entries are now zeroed.
> gve_get_flow_rule_entry() then finds location 0 inside the cached range,
> since every zeroed entry has location 0, and reports an all-zero
> TCP/IPv4 rule that steers to queue 0, whatever the device holds at that
> location. Queries for other locations fall outside the cached range and
> read the rules from the device again.
>
> Mark the cache out of sync whenever a flow rule command is attempted,
> so that the next query reads the rules from the device.
>
> Found by an AI code review agent; not triggered. Compile-tested with W=1.
>
> Fixes: 57718b60df9b ("gve: Add flow steering adminq commands")
> Suggested-by: Harshitha Ramamurthy <hramamurthy@google.com>
This is not 'net' material, applying to 'net-next'...
/P
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH net v2] gve: mark the flow rule cache out of sync when a rule update fails
2026-11-19 4:45 [PATCH net v2] gve: mark the flow rule cache out of sync when a rule update fails Zhao Li
2026-11-20 2:31 ` Harshitha Ramamurthy
2026-11-24 10:24 ` Paolo Abeni
@ 2026-11-24 10:30 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-11-24 10:30 UTC (permalink / raw)
To: Zhao Li
Cc: joshwash, hramamurthy, andrew+netdev, davem, edumazet, kuba,
pabeni, willemb, jordanrhee, nktgrg, ziweixiao, jeroendb,
pkaligineedi, thostet, przemyslaw.kitszel, maolson, netdev,
linux-kernel
Hello:
This patch was applied to netdev/net-next.git (main)
by Paolo Abeni <pabeni@redhat.com>:
On Thu, 19 Nov 2026 12:45:37 +0800 you wrote:
> gve_adminq_configure_flow_rule() marks the flow rule cache out of sync
> only when the device accepts the command, although a failed add,
> delete or reset can leave the device state unknown.
>
> gve_reset() sends the flow rule reset command from
> gve_teardown_control_plane_resources() and then frees and reallocates
> the cache buffers. If that command fails, the cache keeps its nonzero
> rule count and stays marked in sync, but its entries are now zeroed.
> gve_get_flow_rule_entry() then finds location 0 inside the cached range,
> since every zeroed entry has location 0, and reports an all-zero
> TCP/IPv4 rule that steers to queue 0, whatever the device holds at that
> location. Queries for other locations fall outside the cached range and
> read the rules from the device again.
>
> [...]
Here is the summary with links:
- [net,v2] gve: mark the flow rule cache out of sync when a rule update fails
https://git.kernel.org/netdev/net-next/c/4a791c987417
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 4+ messages in thread