From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 554374F392E; Tue, 13 Oct 2026 11:59:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791892764; cv=none; b=TnXxTKZ6oRxJKGRgLY6GguDjztvOVyfuzPwTbHcskV6qWHAQbNMDlnGjy2+tSLSobiTKYe7l3O3dkCgvlToz3Y2R4SsDq/0abPmynm5B4lfgxSElpymYYBYfR39v5VLz9QfREbfLj/VgAz439UidgQZkTFCq4pjYkdyifFpN5po= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791892764; c=relaxed/simple; bh=v8k1yXbufOLxy5hunVk7R4qpvbzXOTHKi1BIN5yURv4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=EeWxAs25uGPSpdBkHETFLnqrJPpWmOZyfh1/cgzxNweVMBKig2eK1NnOQvuy26movH0mdXr6dLTHRazmYK8Pyd0vU+L5wt7bBze/Aj1v3niFvW6+BuB6F10GGQDUxuepQNiaR3WdTwWdyNSIzoicI7CywN3q3W2HDrZT2IEe2Pc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=I4uO73Jh; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="I4uO73Jh" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B52C01F000FF; Tue, 13 Oct 2026 11:59:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1791892763; bh=8jMZL6b7O3wOjLvKWadxVMjhgpaEPJwq7dKRoT8gbNs=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=I4uO73JhhNYeLz8kUC0kpjffwrhKaRUJRESGhtvgno2+CVxq3YaNYBWPDYehsdpSC /vczZySKiFtwgGVHCsa1r1/CvLengZwKIltkjHcHxjH1lFM0xIJxTF9Jq56hEaduSi JSm5mcBVBVBP6pag2wFEGZkP2jl0E5plsCRwN9q8= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Tianyi Gao , =?UTF-8?q?Toke=20H=C3=B8iland-J=C3=B8rgensen?= , Jesper Dangaard Brouer , Lorenzo Bianconi , Jakub Kicinski , Sasha Levin Subject: [PATCH 7.2 266/281] veth: fix peer NETDEV_XDP_ACT_NDO_XMIT after GRO is toggled while down Date: Tue, 13 Oct 2026 13:39:42 +0200 Message-ID: <20261013112901.597387532@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261013112855.045212108@linuxfoundation.org> References: <20261013112855.045212108@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 7.2-stable review patch. If anyone has any objections, please let me know. ------------------ From: Tianyi Gao [ Upstream commit 3f090039995f609a8e236f37980dee5712dded61 ] A veth device advertises NETDEV_XDP_ACT_NDO_XMIT only if its peer has an XDP program attached or GRO enabled, that is, only if the peer will have NAPI to receive the frames. veth_set_features() updates the peer's flag when GRO is toggled, but returns early if the device is down, and veth_open() only refreshes the flags of the device being opened. Toggling GRO while the device is down therefore leaves the peer's flag stale after the device comes up. If GRO was enabled while down, the device comes up with NAPI but the peer does not advertise NDO_XMIT, and devmap rejects redirects to the peer with -EOPNOTSUPP. If GRO was disabled while down, the device comes up without NAPI but the peer still advertises NDO_XMIT, so redirects are accepted and then dropped in veth_xdp_xmit() with -ENXIO. Commit 7a6102aa6df0 ("veth: Update XDP feature set when bringing up device") made veth_open() refresh the device's own flags. Refresh the peer's flags there too. The peer's flag depends on this device's XDP program and GRO setting, not on whether the peer is up, so it is correct to set it even if the peer is down. Fixes: 8267fc71abb2 ("veth: take into account peer device for NETDEV_XDP_ACT_NDO_XMIT xdp_features flag") Signed-off-by: Tianyi Gao Reviewed-by: Toke Høiland-Jørgensen Acked-by: Jesper Dangaard Brouer Acked-by: Lorenzo Bianconi Link: https://patch.msgid.link/20261006173241.65945-2-tianyi@cloudflare.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/veth.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/veth.c b/drivers/net/veth.c index 2780b2dd073d1..4f145c5f686ef 100644 --- a/drivers/net/veth.c +++ b/drivers/net/veth.c @@ -1414,6 +1414,7 @@ static int veth_open(struct net_device *dev) } veth_set_xdp_features(dev); + veth_set_xdp_features(peer); return 0; } -- 2.53.0