Article View: linux.kernel.netdev
Article #13002Re: [PATCH net-next v2 3/6] net: guard memory provider RX queue open and close on unregister
From: netdev-bot+sashiko
Date: Mon, 09 Nov 2026 06:00
Date: Mon, 09 Nov 2026 06:00
72 lines
11092 bytes
11092 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 fixes two bugs that came in with the leased-queue
proxy in commit 5602ad61ebee ("net: Proxy netif_mp_{open,close}_rxqโฆ
--
net: guard memory provider RX queue open and close on unregister
This commit adds a reg_state check to __netif_mp_open_rxq() in
net/core/netdev_rx_queue.c. The check stops a memory provider from being
installed on a physical netdev that is being unregistered when the device
is reached through a leased rxq. It also changes __netif_mp_close_rxq() to
clear rxq->mp_params and return early whenever the device is past
NETREG_REGISTERED, not only when mp_ops is already NULL.
> When a memory provider RX queue is leased to a virtual netdev,
> netif_mp_open_rxq() and netif_mp_close_rxq() redirect through
> rxq->lease and lock the physical backing netdev directly rather than via
> netdev_get_by_index_lock(). This raises two issues during netdev
> unregistration:
[ ... ]
> phys_rxq->mp_params remains populated until the virtual leasee's
> netif_rxq_cleanup_unlease() or socket teardown runs. At that point
> the physical netdev has already gone through dev_shutdown() and must
> not call netdev_rx_queue_reconfig(). When dev->reg_state >
> NETREG_REGISTERED, clear rxq->mp_params and return 0.
>
> Signed-off-by: Mina Almasry <almasrymina@google.com>
[Severity: Low]
Should this have a Fixes: tag?
The rxq->lease redirect in netif_mp_open_rxq() was added by the commit
below. So was netif_rxq_cleanup_unlease(), which calls
__netif_mp_close_rxq() on the physical device:
Fixes: 5602ad61ebee ("net: Proxy netif_mp_{open,close}_rxq for leased queues")
Before that commit, every caller reached __netif_mp_open_rxq() and
__netif_mp_close_rxq() through netdev_get_by_index_lock(). That helper
already rejects devices that are being unregistered.
Could the commit message also say what goes wrong without the fix?
On the open side, unregister_netdevice_many_notify() sets the physical
device to NETREG_UNREGISTERING. It then runs dev_shutdown() and
dev_memory_provider_uninstall() on it before NETDEV_UNREGISTER cascades
into the virtual device's teardown. In that window, a bind-rx on the
virtual device, which is still registered, could install a memory
provider on the physical rxq after the uninstall has already run.
On the close side, devmem's uninstall leaves phys_rxq->mp_params
populated. The old early return only fired when mp_ops was NULL, so it
did not trigger here. As a result,
netif_rxq_cleanup_unlease()->__netif_mp_close_rxq() went on to call
netdev_rx_queue_reconfig() on the shut-down device.
Please state the visible result, for example a queue restart on a
dismantled device, a WARN, or a provider left installed after shutdown.
That would let stable maintainers judge which trees need this and how
urgent it is.
--
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261108055809.2122934-1-almasrymina%40google.com
Technical Details
Message-ID:
<179420401516.994134.15789672166817166565@kernel.org>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-359042-linux-kernel-netdev=dewy.ruReferences:
<20261108055809.2122934-4-almasrymina@google.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-359042-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v2 3/6] net: guard memory provider RX queue open and close on unregister Date: Mon, 09 Nov 2026 06:00:15 +0000 Organization: Usenet Network Message-ID: <179420401516.994134.15789672166817166565@kernel.org> References: <20261108055809.2122934-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="284612"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:Rth+1Cbuzl+8LcSj27mWbvkQsFA= sha256:Ovbxb7xFRRL8f1Axx0x5HF2Bpa8STaY+WoWtmUTP7Ao= sha1:7cTN+5o6oq8aj0L2myNf+LRjzAc= sha256:aOEoyFat269FPhFCGTu3S/Gs1hmKZMgM/v2UtZiYARo= 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 AA1771136E7; Mon, 9 Nov 2026 09:01:45 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.401 X-Spam-Status: No, score=-3.401 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] 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 sqhk_9bXyhPz; Mon, 9 Nov 2026 09:01:41 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-359042-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 sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4]) by mail.dewy.ru (Postfix) with ESMTPS id BCD971136D9; Mon, 9 Nov 2026 09:01:32 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sin.lore.kernel.org (Postfix) with ESMTP id 1CBBC2B985; Mon, 9 Nov 2026 06:00:28 +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=1794204023; b=t4YJaTfMn3bzEmHFP+a3weyQKz8Rcmu9co5VW6eLIKy8tiXCMvnTE/Mw5PJeXHn7F7Of F/KIEI9toyfSr+/5JSKiI9r/dFR3vqj0noI4T9JxNfROyFzgQMJ7ZX/BTwWSE92MldIZX 0OGdPxW7i01GwIltlnTtmttLs2CCGgvQEYMwah6HsGI6HhW3eZ2xU82REoi0neYvnb+cO 76+SIizoW86GajUxB+2Lx7TpEB7AUDhSfxVKT8tHr8GED0MfhzyVnwFjk0hP2/FVcIR4o GbbskHpviebwVJn7mucnzRltruoV6gKyFvhTpRJ3H/1WOwj0ibd+mlJc0bPKJGPPiGQ== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794204023; 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=GrxJfi88WkqhPVzF/M0DQUHCgV9lItraqCHzofs7pXs=; b=pNw/fpFayp7BSoTwoRBnI08zvv69GhWfV2VrgByLU/cYH+ZmMhm+leBHZ5isrMfeZS/X kYs2CUd+io961+OuQ6TIC24aFDsBnFBPRSR1+dfsioG48OKLE3AkpNA/qaa50qavSUCbd lnWNK7ePcjI/QLwyOjk04YA615WYHuUCYqpYgAQYHxaG4cQAMstDUk2+bLgq5PQ1MjmQ0 3Dsez3NaxRXsJoVeGroK9+atet32Y4MnBoGiY5acWpmXNYkIEuURfWE/2pxt+eoq3xsPf jOZXyTNZd9WZHy1g1e48CWTPenaNwof6JnPjFltlUoj8vtawkLMRJs7NWpajmCgnl8A== 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=GBJL4Ska; 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 20EDB606A338; Mon, 9 Nov 2026 06:00:23 +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=GBJL4Ska 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=1794204017; b=02xR0/DhnWy8GB+g/8YIJ3xr4zhUDyNJW0HkP0oazo3VncpjGAZVuXciy4w1I8nAxl2+ PyAWP8hVi8GJ8zsvrlgFG5y5d8OSbnemld7IGjlLU6fXtZnF2SEyFNM0nVcMTzUZmSl0/ yCq+tPn62NTwNqKCipUoyk0ucNQGz3Be12BjCFcUb185EIDdbJKl8iSSm6wPAfqFcWoiR hK44dqMCTqTxI6alvHLfMGH3P0s5P9c5n0OMfk3f4GHJYqre1z4j3mY6l305WEmAyeKik 2AuXPqeBGgCTHtA8erxH0uKaszaavw/89OpV5ZvKQCkcoJj0bLX4BRCTMA+uSt+9ewA== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794204017; 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=GrxJfi88WkqhPVzF/M0DQUHCgV9lItraqCHzofs7pXs=; b=5jRD8ChKaYko5oqO0S9+1Ts7OpwrV6vMkQ6ioxqtdABFGJ3ujEKwueRr09VzaTWqxhSs MeOOZWskZcW3WOByy9ZDCyasIei08Xs0rDUQYJowQkuGq+SOUiVKyQ7tI/D0zKBNhBoch xSpLceWObXFEaxZizyk/FDPfgwnmyHeGSw6VR3XmDf9y+ks/PmRl1TTrbgjfjnnUNFB0f AmtztWxsmLhxb6eweiumxITVcr8LN2+GWPUiRgcBe6obgIyf+tCazNUDidUCIAB/Aq27z J+K/R3jtrkUGLt6R70+qACZEBfmySGrfpHInvEu0+iGnhdpypvvIpBszYukhYrblh9g== 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=GBJL4Ska; 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 F2289606A32A; Mon, 9 Nov 2026 06:00:16 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 997211F0089F; Mon, 9 Nov 2026 06:00:15 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1794204016; bh=GrxJfi88WkqhPVzF/M0DQUHCgV9lItraqCHzofs7pXs=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=GBJL4Skaf9FMfW7kd2F2li4/fVbDjQviGF9354FIySX4IiXx/JDCMKO7aZfIt+ii0 7RLlt+I7UMt0n/TVKL+UwNno+DMzjjvAgoxtfUBfbtkUMuqzaYJXQz7E6F56qyf3On ZhvW3LhVn4QlXXj7J8i98sT+1sCu3UoRqL6WOd59W4mDWZbyaaL5tyWPJzSbIC9ZLp /frkGKS4CeTAMkJ0PRelFwR0Zeqygu+GRfHQmcf5l0AIzTblMdpcH2O/QzzggL9nvA cQQdpjIKzLb+cIFiJIW/6OQ7R6KMfXhU4Dd7ShP3NI0ZrDLhBdCzlTzMhZCl811Wm/ akMa2VmolCMCw== 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, linux-kernel@vger.kernel.org, daniel@iogearbox.net, razor@blackwall.org, dw@davidwei.uk, sdf.kernel@gmail.com, bobbyeshleman@meta.com, dtatulea@nvidia.com X-In-Reply-To: <20261108055809.2122934-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