Article View: linux.kernel.netdev
Article #20718Re: [PATCH net-next v4 3/7] net: guard memory provider RX queue open and close on unregister
From: netdev-bot+sashiko
Date: Mon, 23 Nov 2026 04:59
Date: Mon, 23 Nov 2026 04:59
75 lines
10871 bytes
10871 bytes
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] The commit message has no Fixes: tag, even though the patch
changes behaviour in existing lease-redirect code.
--
net: guard memory provider RX queue open and close on unregister
This patch adds a netif_lease_valid() helper that checks netif_is_alive()
under netdev_lock(). netif_mp_open_rxq() now uses it to reject opening a
memory provider on a leased physical device that is unregistering.
netif_mp_close_rxq() and netif_rxq_cleanup_unlease() now use it to clear
mp_params instead of reconfiguring a dying physical queue.
> These issues were discovered during AI code review (Sashiko) of the
> earlier non-leased devmem unregister series and confirmed by code
> inspection (not observed in production or reproduced on real hardware).
> Tested with the nl_netdev.py selftest on netdevsim added in this series.
>
> Suggested-by: Stanislav Fomichev <sdf@fomichev.me>
> Signed-off-by: Mina Almasry <almasrymina@google.com>
[Severity: Low]
Should this commit carry a Fixes: tag?
The patch changes how existing lease redirection code behaves in
net/core/netdev_rx_queue.c. Both states it closes can be reached on
current kernels.
In netif_mp_open_rxq(), a memory provider can be installed on a physical
device that is already NETREG_UNREGISTERING, when the call comes through
a leasee that is still registered.
In netif_rxq_cleanup_unlease() and netif_mp_close_rxq(),
netdev_rx_queue_reconfig() can be called on a dying physical device. For
example:
unregister_netdevice_many_notify()
dev_memory_provider_uninstall()
call_netdevice_notifiers(NETDEV_UNREGISTER)
netkit_notifier()
netkit_check_lease_unregister()
unregister_netdevice_many() /* on the leasee */
...
netif_rxq_cleanup_unlease()
__netif_mp_close_rxq() /* reconfigures phys queue */
Here is where this code came from:
5602ad61ebee ("net: Proxy netif_mp_{open,close}_rxq for leased queues")
added the lease-redirected open/close paths and
netif_rxq_cleanup_unlease()
581d28606cdd ("net: remove the netif_get_rx_queue_lease_locked() helpers")
added the direct netdev_lock(dev) on the physical device
37314c9dbe95 ("net: Stop leased rxq before uninstalling its memory provider")
gave netif_rxq_cleanup_unlease() its current form, with the
mp_params snapshot
Would something like this be appropriate?
Fixes: 5602ad61ebee ("net: Proxy netif_mp_{open,close}_rxq for leased queues")
Without a Fixes: tag, stable and backport tooling may skip this for
kernels that already ship queue leasing.
--
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261120045918.1239746-1-almasrymina%40google.com
Technical Details
Message-ID:
<179540996293.3135.6100605132431454773@kernel.org>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-369036-linux-kernel-netdev=dewy.ruReferences:
<20261120045918.1239746-4-almasrymina@google.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-369036-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v4 3/7] net: guard memory provider RX queue open and close on unregister Date: Mon, 23 Nov 2026 04:59:22 +0000 Organization: Usenet Network Message-ID: <179540996293.3135.6100605132431454773@kernel.org> References: <20261120045918.1239746-4-almasrymina@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="3793385"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:ackYlDRqITzi/Imhu34T/oz66T0= sha256:mALhvceFHiZXd9dGesM4mnYq6lj4Q4CVq7KvHl7jiHQ= sha1:9RUUd6oQRw+H3FazAA+6IiBmFgg= sha256:Fy4LMkiOQcjz6E4EZlAASc+TbcPxue1ARYOwEpwWRo0= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 6EE64125D90; Mon, 23 Nov 2026 07:59:44 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.4 X-Spam-Status: No, score=-3.4 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rhu3JEEmditR; Mon, 23 Nov 2026 07:59:40 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-369036-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 35D18125D89; Mon, 23 Nov 2026 07:59:31 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 185A02CC03; Mon, 23 Nov 2026 04:59:27 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1795409965; b=483NQ4RxoOew+0tTUXm555EY6OgyEibL8pGTC34T52oLz0d2jaXqPPLbtDRc0/NYTAaf F28It7H+si3268VGnXBcF0nKx/GrcqfYYQSlOCgspOun/nmj2I1YVdcQp37gECk6upsFB VU7+TrJDf69FKQeDtPalInPis4sUN+M50srk9kpQ3EzBkeLnruGu+gEzKgaDeA0LOMXAR kaHCRK9JW17wypWE0Nk3VGHqw35JdoN/gjNaSaSQGSVa6jugzFyh55rYwnRLnz8pfqWcd PnEjE9HNehs6M29/7c/FGrsVQ6RVZ8UPuKUlG8vIvRUV8pu5B7mPXpGsONN4EhP12uw== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795409965; h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc: Date:Message-ID:In-Reply-To:References:X-sashiko-severity: Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version; bh=KeB2HYL85s/Mu7yCSeBrdMNizv+fbYqDFnOtgJjrFg0=; b=cWYO1HYfNWU1idwtOw+GKafHEE5hdubYtYu7RHZY6TUu9bJRvF8fiFjTThpWYOEatnQH PvGqZpxNb1xwF5f74eEcS52JwbyhHhNUtN85VBqrYluu59nnkI0LV9TUtE1+09LnzYK8s Vaa1BEh9FXLVkizXCj55IzodUjbL4cfjNoDY3HKFSVWjidOM8eNy/4DcIkbB4mjp7HXRF DLgz2zkIXj0obq+Hz0+rW88ykWPKFttln/LesrJuslNmEBq4zkm36u7z6wRZcVVQUgShw htcYWpiHlWfKhrxFKQBxRuHuzwNyMdLQfZVcRH270C8jwC3XyLzxwVLkJx359LrJRmA== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=keLiDn7f; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 99F6B606A330; Mon, 23 Nov 2026 04:59:25 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=keLiDn7f X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795409964; b=Ve1pHfGAECFARTfP55+Ht92n8oWwm69zqjlIinBEGqPB1XGJzrz9lpQ10TbvOBL9/4gx q6vQFCKIYRSy+FZsgXFlSO1Oys4Hg7jTVSaDGyU2cMQdosfPTmejbu08OWcFFlObdeed2 Ic/Y54LHvT0xzXMChNaBjMVT1RlUJvpJhB6Kt8AmkxIWDa6g5pLdtMI9yC7s939sHg+I+ uqWlXjhtYIhG3JVim11NEOP9WFCswtXuIaHKjBmE7xqXuj5RQckjWA37S70OymrYUZvwX tAsh61JBwb93u341oO59vbCqyLc6lER1hVJLOKTH6n64Gp75j+MKUvGuHQn9llAEucw== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795409964; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=KeB2HYL85s/Mu7yCSeBrdMNizv+fbYqDFnOtgJjrFg0=; b=5cBUVdpuwm/1jm8lgQRqD8RHN6qhnrZ6z87W4YNqVGeRdsTE6yV3xNpHH3qcdpmq7XUA kTjQwz3EHHJtW3j7jdBXGi51bkZQ0x9tJTtaa7S0hbkpxgQ6QCLHv/gnPOc4yjg31N0sH msGvk/1XNr7ztfdJWYHQA6bkXvPDoZm7jKXnIJR7IK1IJ/5XwdP6ZB8xfpr1xyOgV88h8 PkOiBxhn46F/lO2TqBKVJCgPU33JdataKoTtdydHCknma6CWwJHu3+jikGDjjqQ0oWsjT dNYHkrdW2nH9L/lebA52L6qRnwpWlpgcicBXQ1Zt0m65+XCF0WDcDjn+aidhtC94KXg== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=keLiDn7f; arc=none smtp.remote-ip=100.103.45.18 X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B5265606A31A; Mon, 23 Nov 2026 04:59:24 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 644321F000CF; Mon, 23 Nov 2026 04:59:23 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795409964; bh=KeB2HYL85s/Mu7yCSeBrdMNizv+fbYqDFnOtgJjrFg0=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=keLiDn7f0BCwH6BK0OwuPO4BTcdZESYCANM3/8si6lYOmemEhY3o11NljGgYNDfA8 v4ACW5fgLV1zmcZYWKic1zkrMoomPfNFY6vB1zFYy7Q6Xoj0ro3IuxD3vLoOE4J6YE gEx/0mz2XE/ndlHmUZ4XssW/TSCAtnDdkWT2UJYmFIQe7QtMfYVQ0d3y5ne1mV37kD NlBkPyerXfNZ1LG4Aedn7sN3/R8bim4qiuWEQ9Q/j+8GNGRpr1+txOEUH6S4jwVYNG ata6yzlnqqhB6wd2yJSSLddab4Z7n7awYUwsh50cZvzzZREX4OkwruigmwQYbIlgot J3AtIR7tPN+fg== X-Cc: netdev@vger.kernel.org, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, horms@kernel.org, shuah@kernel.org, linux-kselftest@vger.kernel.org, bestswngs@gmail.com, daniel@iogearbox.net, razor@blackwall.org, dw@davidwei.uk, sdf.kernel@gmail.com, bobbyeshleman@meta.com, dtatulea@nvidia.com X-In-Reply-To: <20261120045918.1239746-4-almasrymina@google.com> X-sashiko-severity: Low X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list