[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAErkTsR0Av6sFnabSSJ7TNtix8Y_QLX+xb6vShvx3P0GyV3w9A@mail.gmail.com>
Date: Mon, 6 Jan 2025 15:25:53 -0800
From: Jeroen de Borst <jeroendb@...gle.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: davem@...emloft.net, netdev@...r.kernel.org, edumazet@...gle.com,
pabeni@...hat.com, pkaligineedi@...gle.com, shailend@...gle.com,
hawk@...nel.org, john.fastabend@...il.com, willemb@...gle.com,
bpf@...r.kernel.org
Subject: Re: [PATCH net] eth: gve: use appropriate helper to set xdp_features
Reviewed-By: Jeroen de Borst <jeroendb@...gle.com>
On Mon, Jan 6, 2025 at 10:02 AM Jakub Kicinski <kuba@...nel.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@...nel.org>
> ---
> CC: jeroendb@...gle.com
> CC: pkaligineedi@...gle.com
> CC: shailend@...gle.com
> CC: hawk@...nel.org
> CC: john.fastabend@...il.com
> CC: willemb@...gle.com
> CC: bpf@...r.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
>
Powered by blists - more mailing lists