From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.181 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796278358; b=Uhmk9rwP+Hp01/QvRf86Sq8yJ7qPsNouQyBxA0OxiH1p/ek5bddb4pnbjF5L0RujyVlj iauaxRoRyzRtNhWcgMGzLJ+NjvOqFJ2OD4xDWJ2/+8SwnpiuCc9taukPCnfwFRnJTnYIM LwmcMEHqH0MGYSOPDQsUMSJ6vLL14ejFYSdhco5KpmPeUgETplAZIBJ8JdFi+b/QV1CMt /UUabP+iYGpMhevr1n2FFGIDLmYHWMJJIzyB9rRUBAqpNtC8cuNHS6x0oPTXbQydroQ6e kPDy197uMYG4v/40MPZDLgJ3987+EjBqDS0AtK+zP5jWgRIOBfeZbpsnz+x+WR23WzQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796278358; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Gm-Gg:X-Received:Received:From:To:Cc:Subject: Date:Message-ID:X-Mailer:MIME-Version:Content-Transfer-Encoding; bh=7hCRqzf3fGP8cLiCJZ7kRLaYVxFYpfchl8JfZIQBsXE=; b=Tyg+MgtounCMZz4zO/xy1kjxlCPMegQKl6Em6th0TJbdFAFk0AklhPmKxu3sERJJZz2z PS5VzUd2e7YUwncw+NNdj+xxCu786eKZhpmo14M26RpIHCBWS3gy3KP4ACJO4EFlCB8V1 QHQat2PUdA8BqyF97DTYQ9qrom1B/mFQoOZLFml2K8StedOX1AHz5juZpuJ6YSbM4l0Ym Es4mOsU8vt6OKyav+NZDLMfd7cWaxdYKG2DcLcGNU90kAUggLt4dc50SObfx9ODT6z73t PqZ8mXSOK82fzF3LZPGFtG+dFox1jcGhfVSbnXg9g1YTZQMZys69Tx2DZznBNReZlUg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=aBV6R7CR; arc=none smtp.remote-ip=74.125.82.181 Received: from mail-dy1-f181.google.com (mail-dy1-f181.google.com [74.125.82.181]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0294A606A32F for ; Thu, 3 Dec 2026 06:12:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 0294A606A32F Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=aBV6R7CR Received: by mail-dy1-f181.google.com with SMTP id 5a478bee46e88-38747f42472so64782eec.0 for ; Wed, 02 Dec 2026 22:12:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796278357; x=1796883157; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=7hCRqzf3fGP8cLiCJZ7kRLaYVxFYpfchl8JfZIQBsXE=; b=aBV6R7CRqdV0mQ5nxPv5/VT0Tds5LgiCUrZa5Taimf1pQGEnvzo9ZPVPAIH0TO7bQG jy45WHl6NnCU9hqIIk7/3WJkSA16AyaK49Ws6cZVHdLsarkwFzzKzxgYkli17IvLIqRS 7sfJGp6DDm0yqJybDkB7pGs5f9oKpy0LCnsveKxI3jkLPChApda9QyHe//zdiwHrYV9F oahYukkUFLT/7MuR3UDOLXdyYHeDe98pEctKvQV2RJkN8HyQXk8OpWRNfTkworrn1but oSwAQaUtpxH+/GGTSJIRVY2mYQGGOuRUyfuPmX1PeWh8vLjsuOh4dacixP9zNzN/R5UC TfPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796278357; x=1796883157; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=7hCRqzf3fGP8cLiCJZ7kRLaYVxFYpfchl8JfZIQBsXE=; b=Y3cZYLoVtESsWHsedmz2rQflt6MhgvjoNWQsCO/hVSE1+0tlyt3DDBskL6vvCFz3LK 256YsUfJuoNmdNPwV84MGacYs6jqmJlHj2DYXsJA8mluM78sDLZCnBaGCVHFSsyT4PN9 9d1jOumpQkwkAacdsBZAmLPNKpncAZ2wTThpUA75QNe4GlgHZ3ZNkFdS1i0j+u58ipKl 06uY27mXoh8eBHYqWWZSHt+LFvwxuu4BSmMbTwJy4gOn9Zb2uqNrzLdC7pXmrqEfKHSt dD4ZvO3ytzKm/9EOTOMLc4/kBCjTvDGsaKSmHXQFepEA6wbiSf/x328Q1SlfWjd+bwdp v96w== X-Gm-Message-State: APuU4Z/guTj08dVrVrR/c+G8fEc6jlTzcJaIbo2q38uEK4cH9qqHY/eT YDPousZn9jHH9gTrYYlP+7d/zliVoIZsVXshdiumVhMuMyFghsUms1uHYVc4Gjw6 X-Gm-Gg: AZFdTZfGZRyiHjByfThSo0FDICyfuCxdzWjLGjMsvLGKIbZu7rMy/eYrhIpCuktheUT 4slTD0tsJjshqClRqDn1/H/p47iwWS1/gK3LAaaU5X2yIuAEAqcaVuQGgZD98tmIw014dRhHYlS mR+41SvPpApqsgEnpNiauAMVf+RvDUkxxZ9RajC5NZ0AqeKpHVJxyS8V4xUbk7zL06p1gV4i98y o3nq6/v4LfiBM5oahfIzQ/zufjQLgT2RYbCuFTeijWCJv8Va/r1Z4iyAd6Wv37THB1TmJy6NZJs k5zkiBRwpXs6SWa7liEhZK0u4iWGF8TeMYJYTqqkT1yAQQiDV/n68zJDpSKJYx0r/261lDwJXmO lMM3hI3nqm3dQ2sN/xevnXqRXSTGu1ME4CCzLtEKXACnQAYvRUxT9VxobOoaklEMX0GAwfmutrH k5mVpZPurL960mRWskZkbBWeRHR/0B194Zmk7LUCeEwAqxkiPHbXqT6rJgkNSmlVEQVlFHzSKDm vm1zu4WAf3upZ2Q/9UpwyU4+ruvg0au8wx1O81FjqEj5dhCOyH1Cozg0LUWpRrpZ7WyaTKlFjf5 if1lQX0iLueEsLJ0w+ayrVj3Qj25Cxt1Zrh8Ndvo812E X-Received: by 2002:a05:693c:42d1:b0:386:b0ea:327d with SMTP id 5a478bee46e88-386b0ea3549mr29595388eec.5.1796278356952; Wed, 02 Dec 2026 22:12:36 -0800 (PST) Received: from localhost.localdomain ([2406:7400:51:44ac:c2b6:f9ff:fe77:10a0]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-38730405b61sm12074437eec.24.2026.12.02.22.12.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Dec 2026 22:12:36 -0800 (PST) From: Amaan Cheval To: netdev@vger.kernel.org Cc: joshwash@google.com, hramamurthy@google.com, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, ast@kernel.org, daniel@iogearbox.net, hawk@kernel.org, john.fastabend@gmail.com, sdf@fomichev.me, bpf@vger.kernel.org, willemb@google.com, jeroendb@google.com, pkaligineedi@google.com, nktgrg@google.com, jordanrhee@google.com, przemyslaw.kitszel@intel.com, debarghyak@google.com, treapking@google.com, Amaan Cheval Subject: [PATCH net 0/2] gve: fix XDP program and XSK pool removal after a config change Date: Thu, 3 Dec 2026 11:42:13 +0530 Message-ID: <20261203061215.487858-1-amaan.cheval@gmail.com> X-Mailer: git-send-email 2.49.0 X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit gve checks that the device configuration supports XDP on every ndo_bpf call, including the ones that remove a program or disable an AF_XDP zero-copy pool. Once the MTU has been raised past the XDP limit, removal is refused, which the core does not expect: netlink removal fails, and a bpf_link release leaves the program running in the driver. Patch 1 runs the check only when a program is installed or a pool is enabled. The bug was reproduced and the fix tested on gVNIC in GQI-QPL mode (GCE n2-standard-4) on net and, as a backport, on Debian 13's 6.12.117, and in DQO-RDA mode (c3-standard-4) on net; reproduce.sh is at https://github.com/AmaanC/sticky-xdp The results on net were taken with both patches applied; patch 2 does not touch the removal paths. The 6.12.117 backport had patch 1 alone. Patch 2 fixes a separate problem on the line patch 1 moves: the pool path passes an extack that is not valid for XDP_SETUP_XSK_POOL. It is latent with CONFIG_INIT_STACK_ALL_ZERO and was reproduced on a kernel built with CONFIG_INIT_STACK_ALL_PATTERN. Other drivers avoid the first problem by running their checks only when a program is installed (mlx5, ice, veth), and by refusing an MTU change that an attached program cannot handle (those three, and i40e, ixgbe, igc). gve already refuses HW-GRO, header split and RX buffer size changes, and queue count changes that XDP cannot use, while a program is attached, but not an MTU change, and those guards do not cover a zero-copy pool that was enabled without a program: raising the queue counts then makes the pool disable fail in the same way. This series makes gve run its check only on install and pool enable, so that removal no longer depends on the configuration passing the XDP check. Not changed by this series: gve still lets the MTU be raised past the XDP limit while a program is attached, and the GQI receive path runs the program only on frames that fit one buffer, so larger frames would reach the stack without it. That is a separate problem. A removal can also still fail if gve cannot rebuild its queues in gve_adjust_config(), reached from gve_set_xdp(); that takes an allocation or device failure, not a configuration change, and is not addressed here. Also not changed, both found by reading the code during review of this series and not reproduced: - gve_xsk_pool_disable() unmaps the pool before it stops the queue, so a receive poll that is still running can use a pool whose device pointer has been cleared. That needs a separate fix. - xp_assign_dev() and xp_disable_drv_zc() pass drivers an on-stack struct netdev_bpf that is not zeroed, and idpf_xsk_pool_setup() also reads extack from it. Zeroing it in the core would cover every driver; patch 2 fixes gve on its own and does not depend on that. Both were found with the help of an AI coding assistant, used interactively to read the driver and the XDP core, write the reproducers and run the tests; details are in each patch. Amaan Cheval (2): gve: do not verify the XDP configuration on program or pool removal gve: do not pass extack to the XDP check on XSK pool setup drivers/net/ethernet/google/gve/gve_main.c | 23 ++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) base-commit: ef3e21c61baa74e39a49b75318bd4541562ec43f -- 2.47.3