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
--
2.48.1