[PATCH net-next v1 0/4] net: remove rtnl_lock from the callers of queue APIs

Stanislav Fomichev
2025-03-07T15:57:27Z

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)
- protect global net_devmem_dmabuf_bindings with a new (global) lock
- move netdev lock management to the callers of netdev_rx_queue_restart
and drop rtnl_lock

Cc: Mina Almasry <almasrymina@google.com>

Stanislav Fomichev (4):
net: create netdev_nl_sock to wrap bindings list
net: protect net_devmem_dmabuf_bindings by new
net_devmem_bindings_mutex
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 | 32 ++++++++---------
net/core/netdev-genl-gen.c | 4 +--
net/core/netdev-genl-gen.h | 6 ++--
net/core/netdev-genl.c | 42 ++++++++++-------------
net/core/netdev_rx_queue.c | 15 +++-----
9 files changed, 63 insertions(+), 60 deletions(-)
create mode 100644 include/net/netdev_netlink.h

--
2.48.1