Netdev List
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: almasrymina@google.com
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
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	[thread overview]
Message-ID: <179540996293.3135.6100605132431454773@kernel.org> (raw)
In-Reply-To: <20261120045918.1239746-4-almasrymina@google.com>

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

  reply	other threads:[~2026-11-23  4:59 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-20  4:59 [PATCH net-next v4 0/7] net: devmem: support leased RX and TX queues on netdev unregister Mina Almasry
2026-11-20  4:59 ` [PATCH net-next v4 1/7] net: devmem: pass net_device pointer to net_devmem_lock_dev() Mina Almasry
2026-11-20  4:59 ` [PATCH net-next v4 2/7] net: devmem: rename binding dev and vdev to map_dev and bind_dev Mina Almasry
2026-11-20  4:59 ` [PATCH net-next v4 3/7] net: guard memory provider RX queue open and close on unregister Mina Almasry
2026-11-23  4:59   ` netdev-bot+sashiko [this message]
2026-11-20  4:59 ` [PATCH net-next v4 4/7] net: devmem: fold net_devmem_lookup_dmabuf() into net_devmem_get_binding() Mina Almasry
2026-11-23  4:59   ` netdev-bot+sashiko
2026-11-20  4:59 ` [PATCH net-next v4 5/7] net: devmem: always populate bind_dev and detach both devices on unregister Mina Almasry
2026-11-23  4:59   ` netdev-bot+sashiko
2026-11-20  4:59 ` [PATCH net-next v4 6/7] net: devmem: resolve physical map_dev for leased RX bindings Mina Almasry
2026-11-23  4:59   ` netdev-bot+sashiko
2026-11-20  4:59 ` [PATCH net-next v4 7/7] selftests: net: add leased devmem RX and TX netdev unregister tests Mina Almasry
2026-11-20 17:04 ` [PATCH net-next v4 0/7] net: devmem: support leased RX and TX queues on netdev unregister Stanislav Fomichev
2026-11-22  9:16 ` Nikolay Aleksandrov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179540996293.3135.6100605132431454773@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=almasrymina@google.com \
    --cc=bestswngs@gmail.com \
    --cc=bobbyeshleman@meta.com \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=dtatulea@nvidia.com \
    --cc=dw@davidwei.uk \
    --cc=edumazet@kernel.org \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=razor@blackwall.org \
    --cc=sdf.kernel@gmail.com \
    --cc=shuah@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox