From nobody Wed Oct 15 22:41:25 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E20BF179215; Sun, 24 Mar 2024 23:39:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711323592; cv=none; b=njYmXjgmziW9Iv0qQj74al4qcXhzJPdjQhSt+ujAlN/MOOCSCqNEoGF8/ybPLw5r/xC2xkUaDesldPMVRO/VrxDPssvl4hqQcku8wi3dzT5ty3tZYcsNwHGWumOEAkb+jjqX+a2Tp+gf/w7fPULmo9kaVs61xTDPFt8IKWbSa+E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711323592; c=relaxed/simple; bh=1iSWyDGqMjAOjyD45RQQNwJCnJjHhCq9814UWAMzE/0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=VKO+9RMBtyGdZRlE025r+ryO6Xh92F1zVx8dCc/5H3fc/CvdLMcF2cy2xHD/FU0YqoLFzfZ3HbAnSyWBhXr5h9pTH+6S/56Bzk/66H033ViC1hwoeJojZ1v/M86PY3k+a94Gj8sEPuLpZ75s+mJ8IzKk9jRqzPzYE3iPGZcr4TQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=A+ZpfALu; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="A+ZpfALu" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0DB25C43394; Sun, 24 Mar 2024 23:39:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711323590; bh=1iSWyDGqMjAOjyD45RQQNwJCnJjHhCq9814UWAMzE/0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=A+ZpfALuYGP5jydpPFFQQ2GN7NuID8NkUpulGCqwTB7wHSe/nnu4+euzrDrgflc5v TugVBBMimIvZSD5i4KaBFDst2H7VHLOO6RunilJ1iFvz7aGWOJkFYw1AUjKNsodZLL R8mY+JCKoNpNVmLWfJP0FZipkolpBdj45ucAJSyM+6GvSJ7oS+Vr1CwDcs2nUK1Lk/ wn/MVQqFyqwATvz1WXAU6eUzIakoMaT/GnAhZbcJ2kyQy3dUa6NhbB4gejdikNBlSe 80a9MvIewQmDL7YyOEIdwmWVGjVx0o+ohSb4Zt38feG+ZzYt+Rjku4rgH8+K6bywB6 2HHfpXSMUCSQQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Ignat Korchagin , =?UTF-8?q?Toke=20H=C3=B8iland-J=C3=B8rgensen?= , "David S . Miller" , Sasha Levin Subject: [PATCH 5.15 297/317] net: veth: do not manipulate GRO when using XDP Date: Sun, 24 Mar 2024 19:34:37 -0400 Message-ID: <20240324233458.1352854-298-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324233458.1352854-1-sashal@kernel.org> References: <20240324233458.1352854-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: quoted-printable From: Ignat Korchagin [ Upstream commit d7db7775ea2e31502d46427f5efd385afc4ff1eb ] Commit d3256efd8e8b ("veth: allow enabling NAPI even without XDP") tried to= fix the fact that GRO was not possible without XDP, because veth did not use NA= PI without XDP. However, it also introduced the behaviour that GRO is always enabled, when XDP is enabled. While it might be desired for most cases, it is confusing for the user at b= est as the GRO flag suddenly changes, when an XDP program is attached. It also introduces some complexities in state management as was partially addressed= in commit fe9f801355f0 ("net: veth: clear GRO when clearing XDP even when down= "). But the biggest problem is that it is not possible to disable GRO at all, w= hen an XDP program is attached, which might be needed for some use cases. Fix this by not touching the GRO flag on XDP enable/disable as the code alr= eady supports switching to NAPI if either GRO or XDP is requested. Link: https://lore.kernel.org/lkml/20240311124015.38106-1-ignat@cloudflare.= com/ Fixes: d3256efd8e8b ("veth: allow enabling NAPI even without XDP") Fixes: fe9f801355f0 ("net: veth: clear GRO when clearing XDP even when down= ") Signed-off-by: Ignat Korchagin Reviewed-by: Toke H=C3=B8iland-J=C3=B8rgensen Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/veth.c | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/drivers/net/veth.c b/drivers/net/veth.c index 0102f86d48676..cfacf8965bc59 100644 --- a/drivers/net/veth.c +++ b/drivers/net/veth.c @@ -1388,8 +1388,6 @@ static netdev_features_t veth_fix_features(struct net= _device *dev, if (peer_priv->_xdp_prog) features &=3D ~NETIF_F_GSO_SOFTWARE; } - if (priv->_xdp_prog) - features |=3D NETIF_F_GRO; =20 return features; } @@ -1481,14 +1479,6 @@ static int veth_xdp_set(struct net_device *dev, stru= ct bpf_prog *prog, } =20 if (!old_prog) { - if (!veth_gro_requested(dev)) { - /* user-space did not require GRO, but adding - * XDP is supposed to get GRO working - */ - dev->features |=3D NETIF_F_GRO; - netdev_features_change(dev); - } - peer->hw_features &=3D ~NETIF_F_GSO_SOFTWARE; peer->max_mtu =3D max_mtu; } @@ -1499,14 +1489,6 @@ static int veth_xdp_set(struct net_device *dev, stru= ct bpf_prog *prog, if (dev->flags & IFF_UP) veth_disable_xdp(dev); =20 - /* if user-space did not require GRO, since adding XDP - * enabled it, clear it now - */ - if (!veth_gro_requested(dev)) { - dev->features &=3D ~NETIF_F_GRO; - netdev_features_change(dev); - } - if (peer) { peer->hw_features |=3D NETIF_F_GSO_SOFTWARE; peer->max_mtu =3D ETH_MAX_MTU; --=20 2.43.0