* [PATCH net] eth: gve: use appropriate helper to set xdp_features
@ 2025-01-06 18:02 Jakub Kicinski
2025-01-06 23:25 ` Jeroen de Borst
2025-01-08 2:20 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 4+ messages in thread
From: Jakub Kicinski @ 2025-01-06 18:02 UTC (permalink / raw)
To: davem
Cc: netdev, edumazet, pabeni, Jakub Kicinski, jeroendb, pkaligineedi,
shailend, hawk, john.fastabend, willemb, bpf
Commit f85949f98206 ("xdp: add xdp_set_features_flag utility routine")
added routines to inform the core about XDP flag changes.
GVE support was added around the same time and missed using them.
GVE only changes the flags on error recover or resume.
Presumably the flags may change during resume if VM migrated.
User would not get the notification and upper devices would
not get a chance to recalculate their flags.
Fixes: 75eaae158b1b ("gve: Add XDP DROP and TX support for GQI-QPL format")
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
CC: jeroendb@google.com
CC: pkaligineedi@google.com
CC: shailend@google.com
CC: hawk@kernel.org
CC: john.fastabend@gmail.com
CC: willemb@google.com
CC: bpf@vger.kernel.org
---
drivers/net/ethernet/google/gve/gve_main.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/google/gve/gve_main.c b/drivers/net/ethernet/google/gve/gve_main.c
index 8a8f6ab12a98..533e659b15b3 100644
--- a/drivers/net/ethernet/google/gve/gve_main.c
+++ b/drivers/net/ethernet/google/gve/gve_main.c
@@ -2241,14 +2241,18 @@ static void gve_service_task(struct work_struct *work)
static void gve_set_netdev_xdp_features(struct gve_priv *priv)
{
+ xdp_features_t xdp_features;
+
if (priv->queue_format == GVE_GQI_QPL_FORMAT) {
- priv->dev->xdp_features = NETDEV_XDP_ACT_BASIC;
- priv->dev->xdp_features |= NETDEV_XDP_ACT_REDIRECT;
- priv->dev->xdp_features |= NETDEV_XDP_ACT_NDO_XMIT;
- priv->dev->xdp_features |= NETDEV_XDP_ACT_XSK_ZEROCOPY;
+ xdp_features = NETDEV_XDP_ACT_BASIC;
+ xdp_features |= NETDEV_XDP_ACT_REDIRECT;
+ xdp_features |= NETDEV_XDP_ACT_NDO_XMIT;
+ xdp_features |= NETDEV_XDP_ACT_XSK_ZEROCOPY;
} else {
- priv->dev->xdp_features = 0;
+ xdp_features = 0;
}
+
+ xdp_set_features_flag(priv->dev, xdp_features);
}
static int gve_init_priv(struct gve_priv *priv, bool skip_describe_device)
--
2.47.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net] eth: gve: use appropriate helper to set xdp_features
2025-01-06 18:02 [PATCH net] eth: gve: use appropriate helper to set xdp_features Jakub Kicinski
@ 2025-01-06 23:25 ` Jeroen de Borst
2025-01-07 9:30 ` Willem de Bruijn
2025-01-08 2:20 ` patchwork-bot+netdevbpf
1 sibling, 1 reply; 4+ messages in thread
From: Jeroen de Borst @ 2025-01-06 23:25 UTC (permalink / raw)
To: Jakub Kicinski
Cc: davem, netdev, edumazet, pabeni, pkaligineedi, shailend, hawk,
john.fastabend, willemb, bpf
Reviewed-By: Jeroen de Borst <jeroendb@google.com>
On Mon, Jan 6, 2025 at 10:02 AM Jakub Kicinski <kuba@kernel.org> wrote:
>
> Commit f85949f98206 ("xdp: add xdp_set_features_flag utility routine")
> added routines to inform the core about XDP flag changes.
> GVE support was added around the same time and missed using them.
>
> GVE only changes the flags on error recover or resume.
> Presumably the flags may change during resume if VM migrated.
> User would not get the notification and upper devices would
> not get a chance to recalculate their flags.
>
> Fixes: 75eaae158b1b ("gve: Add XDP DROP and TX support for GQI-QPL format")
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> ---
> CC: jeroendb@google.com
> CC: pkaligineedi@google.com
> CC: shailend@google.com
> CC: hawk@kernel.org
> CC: john.fastabend@gmail.com
> CC: willemb@google.com
> CC: bpf@vger.kernel.org
> ---
> drivers/net/ethernet/google/gve/gve_main.c | 14 +++++++++-----
> 1 file changed, 9 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/net/ethernet/google/gve/gve_main.c b/drivers/net/ethernet/google/gve/gve_main.c
> index 8a8f6ab12a98..533e659b15b3 100644
> --- a/drivers/net/ethernet/google/gve/gve_main.c
> +++ b/drivers/net/ethernet/google/gve/gve_main.c
> @@ -2241,14 +2241,18 @@ static void gve_service_task(struct work_struct *work)
>
> static void gve_set_netdev_xdp_features(struct gve_priv *priv)
> {
> + xdp_features_t xdp_features;
> +
> if (priv->queue_format == GVE_GQI_QPL_FORMAT) {
> - priv->dev->xdp_features = NETDEV_XDP_ACT_BASIC;
> - priv->dev->xdp_features |= NETDEV_XDP_ACT_REDIRECT;
> - priv->dev->xdp_features |= NETDEV_XDP_ACT_NDO_XMIT;
> - priv->dev->xdp_features |= NETDEV_XDP_ACT_XSK_ZEROCOPY;
> + xdp_features = NETDEV_XDP_ACT_BASIC;
> + xdp_features |= NETDEV_XDP_ACT_REDIRECT;
> + xdp_features |= NETDEV_XDP_ACT_NDO_XMIT;
> + xdp_features |= NETDEV_XDP_ACT_XSK_ZEROCOPY;
> } else {
> - priv->dev->xdp_features = 0;
> + xdp_features = 0;
> }
> +
> + xdp_set_features_flag(priv->dev, xdp_features);
> }
>
> static int gve_init_priv(struct gve_priv *priv, bool skip_describe_device)
> --
> 2.47.1
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net] eth: gve: use appropriate helper to set xdp_features
2025-01-06 23:25 ` Jeroen de Borst
@ 2025-01-07 9:30 ` Willem de Bruijn
0 siblings, 0 replies; 4+ messages in thread
From: Willem de Bruijn @ 2025-01-07 9:30 UTC (permalink / raw)
To: Jeroen de Borst, Jakub Kicinski
Cc: davem, netdev, edumazet, pabeni, pkaligineedi, shailend, hawk,
john.fastabend, willemb, bpf
Jeroen de Borst wrote:
> Reviewed-By: Jeroen de Borst <jeroendb@google.com>
>
>
>
> On Mon, Jan 6, 2025 at 10:02 AM Jakub Kicinski <kuba@kernel.org> wrote:
> >
> > Commit f85949f98206 ("xdp: add xdp_set_features_flag utility routine")
> > added routines to inform the core about XDP flag changes.
> > GVE support was added around the same time and missed using them.
> >
> > GVE only changes the flags on error recover or resume.
> > Presumably the flags may change during resume if VM migrated.
> > User would not get the notification and upper devices would
> > not get a chance to recalculate their flags.
> >
> > Fixes: 75eaae158b1b ("gve: Add XDP DROP and TX support for GQI-QPL format")
> > Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Thanks!
> > ---
> > CC: jeroendb@google.com
Reminder: please don't top post
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net] eth: gve: use appropriate helper to set xdp_features
2025-01-06 18:02 [PATCH net] eth: gve: use appropriate helper to set xdp_features Jakub Kicinski
2025-01-06 23:25 ` Jeroen de Borst
@ 2025-01-08 2:20 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-01-08 2:20 UTC (permalink / raw)
To: Jakub Kicinski
Cc: davem, netdev, edumazet, pabeni, jeroendb, pkaligineedi, shailend,
hawk, john.fastabend, willemb, bpf
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Mon, 6 Jan 2025 10:02:10 -0800 you wrote:
> Commit f85949f98206 ("xdp: add xdp_set_features_flag utility routine")
> added routines to inform the core about XDP flag changes.
> GVE support was added around the same time and missed using them.
>
> GVE only changes the flags on error recover or resume.
> Presumably the flags may change during resume if VM migrated.
> User would not get the notification and upper devices would
> not get a chance to recalculate their flags.
>
> [...]
Here is the summary with links:
- [net] eth: gve: use appropriate helper to set xdp_features
https://git.kernel.org/netdev/net/c/db78475ba0d3
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
end of thread, other threads:[~2025-01-08 2:20 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-06 18:02 [PATCH net] eth: gve: use appropriate helper to set xdp_features Jakub Kicinski
2025-01-06 23:25 ` Jeroen de Borst
2025-01-07 9:30 ` Willem de Bruijn
2025-01-08 2:20 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).