netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 00/11] net: Hold netdev instance lock during ndo operations
@ 2025-02-10 19:20 Stanislav Fomichev
  2025-02-10 19:20 ` [PATCH net-next 01/11] net: hold netdev instance lock during ndo_open/ndo_stop Stanislav Fomichev
                   ` (10 more replies)
  0 siblings, 11 replies; 22+ messages in thread
From: Stanislav Fomichev @ 2025-02-10 19:20 UTC (permalink / raw)
  To: netdev; +Cc: davem, edumazet, kuba, pabeni, Saeed Mahameed

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.

call_netdevice_notifiers locking is very inconsistent and might need
a separate follow up. Some notified events are covered by the
instance lock, some are not, which might complicate the driver
expectations.

Changes since RFC:
- other control paths are protected
- bntx has been converted to mostly depend on netdev instance lock

Cc: Saeed Mahameed <saeed@kernel.org>

Jakub Kicinski (1):
  net: ethtool: try to protect all callback with netdev instance lock

Stanislav Fomichev (10):
  net: hold netdev instance lock during ndo_open/ndo_stop
  net: hold netdev instance lock during ndo_setup_tc
  net: hold netdev instance lock during queue operations
  net: hold netdev instance lock during rtnetlink operations
  net: hold netdev instance lock during ioctl operations
  net: hold netdev instance lock during sysfs operations
  net: hold netdev instance lock during ndo_bpf
  net: dummy: add dummy shaper API
  docs: net: document new locking reality
  eth: bnxt: remove most dependencies on RTNL

 Documentation/networking/netdevices.rst       |  57 +++-
 drivers/net/bonding/bond_main.c               |  16 +-
 drivers/net/dummy.c                           |  37 ++
 drivers/net/ethernet/broadcom/bnxt/bnxt.c     | 138 ++++----
 .../net/ethernet/broadcom/bnxt/bnxt_devlink.c |   9 +
 .../net/ethernet/broadcom/bnxt/bnxt_sriov.c   |   6 +
 drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c |  16 +-
 drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c |  18 +-
 drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c |   3 +-
 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/ethtool.c               |   2 -
 drivers/net/netdevsim/netdev.c                |  36 +-
 include/linux/netdevice.h                     |  63 +++-
 kernel/bpf/offload.c                          |   7 +-
 net/8021q/vlan_dev.c                          |   4 +-
 net/core/Makefile                             |   2 +-
 net/core/dev.c                                | 255 +++++---------
 net/core/dev.h                                |  19 +-
 net/core/dev_api.c                            | 315 ++++++++++++++++++
 net/core/dev_ioctl.c                          |  67 ++--
 net/core/net-sysfs.c                          |   2 +
 net/core/netdev_rx_queue.c                    |   5 +
 net/core/rtnetlink.c                          |  47 ++-
 net/dsa/conduit.c                             |  16 +-
 net/dsa/user.c                                |   5 +-
 net/ethtool/cabletest.c                       |  20 +-
 net/ethtool/features.c                        |   6 +-
 net/ethtool/ioctl.c                           |   6 +
 net/ethtool/module.c                          |   8 +-
 net/ethtool/netlink.c                         |  12 +
 net/ethtool/phy.c                             |  20 +-
 net/ethtool/rss.c                             |   2 +
 net/ethtool/tsinfo.c                          |   9 +-
 net/netfilter/nf_flow_table_offload.c         |   2 +-
 net/netfilter/nf_tables_offload.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                        |  22 +-
 net/sched/sch_tbf.c                           |  10 +-
 net/xdp/xsk.c                                 |   3 +
 net/xdp/xsk_buff_pool.c                       |   2 +
 53 files changed, 912 insertions(+), 473 deletions(-)
 create mode 100644 net/core/dev_api.c

-- 
2.48.1


^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2025-02-12  3:57 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-10 19:20 [PATCH net-next 00/11] net: Hold netdev instance lock during ndo operations Stanislav Fomichev
2025-02-10 19:20 ` [PATCH net-next 01/11] net: hold netdev instance lock during ndo_open/ndo_stop Stanislav Fomichev
2025-02-12  2:06   ` Jakub Kicinski
2025-02-10 19:20 ` [PATCH net-next 02/11] net: hold netdev instance lock during ndo_setup_tc Stanislav Fomichev
2025-02-12  2:20   ` Jakub Kicinski
2025-02-12  3:48     ` Stanislav Fomichev
2025-02-12  3:57       ` Jakub Kicinski
2025-02-10 19:20 ` [PATCH net-next 03/11] net: hold netdev instance lock during queue operations Stanislav Fomichev
2025-02-12  2:21   ` Jakub Kicinski
2025-02-10 19:20 ` [PATCH net-next 04/11] net: hold netdev instance lock during rtnetlink operations Stanislav Fomichev
2025-02-11 15:06   ` kernel test robot
2025-02-11 16:32     ` Stanislav Fomichev
2025-02-12  2:33   ` Jakub Kicinski
2025-02-10 19:20 ` [PATCH net-next 05/11] net: hold netdev instance lock during ioctl operations Stanislav Fomichev
2025-02-10 19:20 ` [PATCH net-next 06/11] net: hold netdev instance lock during sysfs operations Stanislav Fomichev
2025-02-10 19:20 ` [PATCH net-next 07/11] net: hold netdev instance lock during ndo_bpf Stanislav Fomichev
2025-02-10 19:20 ` [PATCH net-next 08/11] net: ethtool: try to protect all callback with netdev instance lock Stanislav Fomichev
2025-02-10 19:20 ` [PATCH net-next 09/11] net: dummy: add dummy shaper API Stanislav Fomichev
2025-02-11 10:41   ` kernel test robot
2025-02-11 15:29   ` kernel test robot
2025-02-10 19:20 ` [PATCH net-next 10/11] docs: net: document new locking reality Stanislav Fomichev
2025-02-10 19:20 ` [PATCH net-next 11/11] eth: bnxt: remove most dependencies on RTNL Stanislav Fomichev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).