Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2403531lqp; Sun, 24 Mar 2024 18:04:48 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW6f6IwxdTviSB2CPAOMkmNwn6hprBEchYGFpCgafRssHtXfbuFHArfd5/7MpNG5OnWxaRQiPfhFYTaFWIGZ1LvZTBfEulg+PKx6SNoLA== X-Google-Smtp-Source: AGHT+IHJdux5RI9LWkeQ8V9+TM1WQpE5dqIP5txaiRpL7MJPwvsIiGqTiGUh4SpiyYKRRjkz0Khu X-Received: by 2002:ac8:5885:0:b0:431:5163:f7cc with SMTP id t5-20020ac85885000000b004315163f7ccmr3168767qta.7.1711328688613; Sun, 24 Mar 2024 18:04:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711328688; cv=pass; d=google.com; s=arc-20160816; b=dxy0HSu5Yo90TWCU0XlJMin4ByXuFTzupvsm48gTPEiaRmxCe0et3U+h3/n85LGBKN /Nl68FuqXaknjpHY3X7qsIZnkf49ZPkxzjUn+pJeJqZITtQNe66HB10qoZr8R3ktHGyh ZKPgiHZ/C6u2pY6ALgeAGKkY1JTIzCReZg9nEAiW3lIsIoZonrL3U1hOMZ/E5mlc4X+A AGp0yZYjtJEAkoCB1dzbqvGXfpSQMTLCl2LkdVzE1652OEV1ApMS2Kb3jr5G6TGywZaG QQ4QK+dWUTEfIgEiNa/nn2TaJyNbTby5BDzwaty5dkH3kVxY1w4tH+wTAXjyrTgLli0I JF8Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=eFSwReR9nFkV32Mn54MH2ySSeoF4IZKkswz/Td4jvbo=; fh=Ll5WlWUvueJqwFKkq29wUT0xbt+rgrRiAhe6UjOd85Q=; b=Mp5yb3MzLZeRsLR56nafOTgr32s9ILCxddHHUdajLp3cWzWB1Csu/T3NQtA3BD7DSW qhpJhe0UZKxOQjdxAdP2sCH+tv/fif1JRSpZWf9RiE7PGFS37liPr2HVn52cRDpmuhMS WOqIpero40U1nxYULAvsz/8PxwXtiwKPYkhcJVvuBVTUCSoRsXhKr06u1k5orqyWgxVN wuMcbLYMERagP6IV0zCRDCc9iRXYCvDjfOAHHFPlpKR6uICxsz3XktmHsySjYn+w9x6n 7v5vG+dNrREujwloMX1b6Qmr3DEruaFedk9WM6Q8Q7kzlb+kmusttx13FIOmx7bySohX YBwg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZkGsZSsS; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113564-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113564-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id f32-20020a05622a1a2000b004315f3292d6si49194qtb.544.2024.03.24.18.04.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Mar 2024 18:04:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-113564-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZkGsZSsS; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113564-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113564-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 54C551C24AD7 for ; Mon, 25 Mar 2024 01:04:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7C4EE1C6AEB; Sun, 24 Mar 2024 22:46:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ZkGsZSsS" 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 9F1B61C6AD0; Sun, 24 Mar 2024 22:46:06 +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=1711320366; cv=none; b=rZC1fxUeHBNOnF9e8pCu9ZrCzskyVSRRJ++W/W4m+8eyBbUngmHrUMGGj/t7d6oiv0Ncu9sFUZeZMBJIoETXvidAEaREeWoQu0qhhMkkHaGc079+kbGTncPP1oWsqYyXqObn3HglxPHwBqVWv15zfbw8Cw9reuUeACzHZsksK88= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711320366; c=relaxed/simple; bh=qJvpa+hgPSNRiSCI0QuCwjzmMhDyKe7W3jSniZg3RgU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=oVPdZ36Ppq26iDtTtxN5QHc53dyI3/GqcmD1dKsMLq4M4YxNxT+H5e3eVKcWjDTTnTu7SIz1OeYYa3fqT0rQXvH/RH5ke6YVw2tR+vSDPPPAej6o37iOjAIYc5rAmOlOvYHGoQAThNg/FQUUFzdSkfvezc8RcqMl5idDVDzBrVc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ZkGsZSsS; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id C38E9C43399; Sun, 24 Mar 2024 22:46:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711320366; bh=qJvpa+hgPSNRiSCI0QuCwjzmMhDyKe7W3jSniZg3RgU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZkGsZSsSR7rDyEn3VwxxyZGJ4oBAgV4M+Y7DGC27/lJm7h5r1zqWm+/KwaTSebb/D +RzxdUTpJmOzXJpnDA4aimyRW93HUl9MfXUPV0RBOCYj+p/doYYRAgeAZ3ZsUixmL7 I4NK8shl2qVsmsOL+HAw+TAkpJlUI744fDkN4byTQlWHFj8UtiXLPQq4q1/Rvd0TDu AwTj/NYZKHYgembtgQ70pPyuvDkbFLt0dVRhMEz3evwD05OWktF4z8SRMvj7n5bhPF Ibs4dbzD/r6vISifcrYEwce2IwXFSq8OthSuxLGYKhm/i5pB+qvuwa3F9gsqFKsW9X kQjE8yG2TNgZw== 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 6.8 673/715] net: veth: do not manipulate GRO when using XDP Date: Sun, 24 Mar 2024 18:34:12 -0400 Message-ID: <20240324223455.1342824-674-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324223455.1342824-1-sashal@kernel.org> References: <20240324223455.1342824-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: 8bit 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 NAPI 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 best 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, when 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 already 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øiland-Jørgensen 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 cd4a6fe458f95..f0b2c4d5fe43a 100644 --- a/drivers/net/veth.c +++ b/drivers/net/veth.c @@ -1533,8 +1533,6 @@ static netdev_features_t veth_fix_features(struct net_device *dev, if (peer_priv->_xdp_prog) features &= ~NETIF_F_GSO_SOFTWARE; } - if (priv->_xdp_prog) - features |= NETIF_F_GRO; return features; } @@ -1638,14 +1636,6 @@ static int veth_xdp_set(struct net_device *dev, struct bpf_prog *prog, } 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 |= NETIF_F_GRO; - netdev_features_change(dev); - } - peer->hw_features &= ~NETIF_F_GSO_SOFTWARE; peer->max_mtu = max_mtu; } @@ -1661,14 +1651,6 @@ static int veth_xdp_set(struct net_device *dev, struct bpf_prog *prog, if (dev->flags & IFF_UP) veth_disable_xdp(dev); - /* if user-space did not require GRO, since adding XDP - * enabled it, clear it now - */ - if (!veth_gro_requested(dev)) { - dev->features &= ~NETIF_F_GRO; - netdev_features_change(dev); - } - if (peer) { peer->hw_features |= NETIF_F_GSO_SOFTWARE; peer->max_mtu = ETH_MAX_MTU; -- 2.43.0