Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

eth: gve: use appropriate helper to set xdp_features

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")
Reviewed-By: Jeroen de Borst <jeroendb@google.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Link: https://patch.msgid.link/20250106180210.1861784-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

+9 -5
+9 -5
drivers/net/ethernet/google/gve/gve_main.c
··· 2241 2241 2242 2242 static void gve_set_netdev_xdp_features(struct gve_priv *priv) 2243 2243 { 2244 + xdp_features_t xdp_features; 2245 + 2244 2246 if (priv->queue_format == GVE_GQI_QPL_FORMAT) { 2245 - priv->dev->xdp_features = NETDEV_XDP_ACT_BASIC; 2246 - priv->dev->xdp_features |= NETDEV_XDP_ACT_REDIRECT; 2247 - priv->dev->xdp_features |= NETDEV_XDP_ACT_NDO_XMIT; 2248 - priv->dev->xdp_features |= NETDEV_XDP_ACT_XSK_ZEROCOPY; 2247 + xdp_features = NETDEV_XDP_ACT_BASIC; 2248 + xdp_features |= NETDEV_XDP_ACT_REDIRECT; 2249 + xdp_features |= NETDEV_XDP_ACT_NDO_XMIT; 2250 + xdp_features |= NETDEV_XDP_ACT_XSK_ZEROCOPY; 2249 2251 } else { 2250 - priv->dev->xdp_features = 0; 2252 + xdp_features = 0; 2251 2253 } 2254 + 2255 + xdp_set_features_flag(priv->dev, xdp_features); 2252 2256 } 2253 2257 2254 2258 static int gve_init_priv(struct gve_priv *priv, bool skip_describe_device)