๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.netdev
1 messages
1 total messages Started by netdev-bot+sashiko Mon, 23 Nov 2026 04:59
Re: [PATCH net-next v4 3/7] net: guard memory provider RX queue open and close on unregister
#20718
Author: netdev-bot+sashiko
Date: Mon, 23 Nov 2026 04:59
75 lines
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
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads