mbox series

[RFC,net-next,0/4] net: Hold netdev instance lock during ndo operations

Message ID 20250204230057.1270362-1-sdf@fomichev.me (mailing list archive)
Headers show
Series net: Hold netdev instance lock during ndo operations | expand

Message

Stanislav Fomichev Feb. 4, 2025, 11 p.m. UTC
As the gradual purging of rtnl continues, start grabbing netdev
instance lock in more places so we can get to the state where
most paths are working without rtnl. Start with requiring the
drivers that use shaper api (and later queue mgmt api) to work
with both rtnl and netdev instance lock. Eventually we might
attempt to drop rtnl. This mostly affects iavf, gve, bnxt and
netdev sim (as the drivers that implement shaper/queue mgmt)
so those drivers are converted in the process.

This is part one of the process, the next step is to do similar locking
for the rest of ndo handlers that are being called from sysfs/ethtool/netlink.

Cc: Saeed Mahameed <saeed@kernel.org>

Stanislav Fomichev (4):
  net: Hold netdev instance lock during ndo_open/ndo_stop
  net: Hold netdev instance lock during ndo_setup_tc
  net: Hold netdev instance lock for more NDOs
  net: Hold netdev instance lock during queue operations

 Documentation/networking/netdevices.rst       | 52 +++++++++++++-----
 drivers/net/bonding/bond_main.c               |  9 ++--
 drivers/net/ethernet/broadcom/bnxt/bnxt.c     | 54 +++++++++++++++----
 .../net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 11 ++--
 .../net/ethernet/broadcom/bnxt/bnxt_sriov.c   |  2 +
 drivers/net/ethernet/google/gve/gve_main.c    |  8 +--
 drivers/net/ethernet/google/gve/gve_utils.c   |  8 +--
 drivers/net/ethernet/intel/iavf/iavf_main.c   | 16 +++---
 drivers/net/netdevsim/netdev.c                | 36 ++++++++-----
 include/linux/netdevice.h                     | 27 ++++++++++
 net/8021q/vlan_dev.c                          |  4 +-
 net/core/dev.c                                | 34 ++++++++++++
 net/core/dev.h                                |  6 ++-
 net/core/dev_ioctl.c                          | 44 ++++++++++-----
 net/core/netdev_rx_queue.c                    |  5 ++
 net/dsa/user.c                                |  5 +-
 net/ieee802154/socket.c                       |  2 +
 net/netfilter/nf_flow_table_offload.c         |  2 +-
 net/netfilter/nf_tables_offload.c             |  2 +-
 net/phonet/pn_dev.c                           |  2 +
 net/sched/cls_api.c                           |  2 +-
 net/sched/sch_api.c                           | 13 ++---
 net/sched/sch_cbs.c                           |  9 +---
 net/sched/sch_etf.c                           |  9 +---
 net/sched/sch_ets.c                           | 10 +---
 net/sched/sch_fifo.c                          | 10 +---
 net/sched/sch_gred.c                          |  5 +-
 net/sched/sch_htb.c                           |  2 +-
 net/sched/sch_mq.c                            |  5 +-
 net/sched/sch_mqprio.c                        |  6 +--
 net/sched/sch_prio.c                          |  5 +-
 net/sched/sch_red.c                           |  8 +--
 net/sched/sch_taprio.c                        | 16 ++----
 net/sched/sch_tbf.c                           | 10 +---
 34 files changed, 266 insertions(+), 173 deletions(-)