mbox series

[net-next,v2,0/3] net: remove rtnl_lock from the callers of queue APIs

Message ID 20250311144026.4154277-1-sdf@fomichev.me (mailing list archive)
Headers show
Series net: remove rtnl_lock from the callers of queue APIs | expand

Message

Stanislav Fomichev March 11, 2025, 2:40 p.m. UTC
All drivers that use queue management APIs already depend on the netdev
lock. Ultimately, we want to have most of the paths that work with
specific netdev to be rtnl_lock-free (ethtool mostly in particular).
Queue API currently has a much smaller API surface, so start with
rtnl_lock from it:

- add mutex to each dmabuf binding (to replace rtnl_lock)
- move netdev lock management to the callers of netdev_rx_queue_restart
  and drop rtnl_lock

v2:
- drop "net: protect net_devmem_dmabuf_bindings by new
  net_devmem_bindings_mutex" (Jakub)
- add missing mutex_unlock (Jakub)
- undo rtnl_lock removal from netdev_nl_queue_get_doit and
  netdev_nl_queue_get_dumpit, needs more care to grab
  either or but no both rtnl_lock/ops_lock (Jakub)

Cc: Mina Almasry <almasrymina@google.com>

Stanislav Fomichev (3):
  net: create netdev_nl_sock to wrap bindings list
  net: add granular lock for the netdev netlink socket
  net: drop rtnl_lock for queue_mgmt operations

 Documentation/netlink/specs/netdev.yaml   |  4 +--
 drivers/net/ethernet/broadcom/bnxt/bnxt.c |  4 +--
 drivers/net/netdevsim/netdev.c            |  4 +--
 include/net/netdev_netlink.h              | 12 +++++++
 net/core/devmem.c                         |  4 +--
 net/core/netdev-genl-gen.c                |  4 +--
 net/core/netdev-genl-gen.h                |  6 ++--
 net/core/netdev-genl.c                    | 38 +++++++++++++----------
 net/core/netdev_rx_queue.c                | 16 ++++------
 9 files changed, 52 insertions(+), 40 deletions(-)
 create mode 100644 include/net/netdev_netlink.h

Comments

patchwork-bot+netdevbpf@kernel.org March 12, 2025, 8:50 p.m. UTC | #1
Hello:

This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Tue, 11 Mar 2025 07:40:23 -0700 you wrote:
> All drivers that use queue management APIs already depend on the netdev
> lock. Ultimately, we want to have most of the paths that work with
> specific netdev to be rtnl_lock-free (ethtool mostly in particular).
> Queue API currently has a much smaller API surface, so start with
> rtnl_lock from it:
> 
> - add mutex to each dmabuf binding (to replace rtnl_lock)
> - move netdev lock management to the callers of netdev_rx_queue_restart
>   and drop rtnl_lock
> 
> [...]

Here is the summary with links:
  - [net-next,v2,1/3] net: create netdev_nl_sock to wrap bindings list
    https://git.kernel.org/netdev/net-next/c/b6b67141d6f1
  - [net-next,v2,2/3] net: add granular lock for the netdev netlink socket
    https://git.kernel.org/netdev/net-next/c/10eef096be25
  - [net-next,v2,3/3] net: drop rtnl_lock for queue_mgmt operations
    https://git.kernel.org/netdev/net-next/c/1d22d3060b9b

You are awesome, thank you!