Skip to content

net: depend on instance lock for queue related netlink ops

Jakub Kicinski bpf netdev 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest8 patches 17 repliesIn review 5 of 8 applied
  2. v18 patches 11 repliesSuperseded

Changes in v2 from the cover letter

- fix a bug in patch 2
- reword the doc a tiny bit (patch 7)
v1: https://lore.kernel.org/[email protected]

Patches in v2 5 of 8 applied

#Subject and filesSizeRepliesApplied
1/8net: avoid potential race between netdev_get_by_index_lock() and netns switchinclude/linux/netdevice.h net/core/dev.c net/core/dev.h+24 -90 replies
2/8net: designate XSK pool pointers in queues as "ops protected"include/linux/netdevice.h include/net/netdev_rx_queue.h net/xdp/xsk_buff_pool.c+9 -40 repliesApplied
3/8netdev: add "ops compat locking" helpersinclude/net/netdev_lock.h net/core/dev.c net/core/dev.h+82 -00 replies
4/8netdev: don't hold rtnl_lock over nl queue info get when possiblenet/core/netdev-genl.c+7 -110 repliesApplied
5/8xdp: double protect netdev->xdp_flags with netdev->lockDocumentation/networking/netdevices.rst drivers/net/ethernet/google/gve/gve_main.c include/linux/netdevice.h +3 more+16 -42 replies
6/8netdev: depend on netdev->lock for xdp featuresnet/core/netdev-genl.c+12 -146 repliesApplied
7/8docs: netdev: break down the instance locking info per ops structDocumentation/networking/netdevices.rst+42 -126 repliesApplied
8/8netdev: depend on netdev->lock for qstats in ops locked driversDocumentation/networking/netdevices.rst include/net/netdev_queues.h net/core/netdev-genl.c+26 -133 repliesApplied

Reviews trailers per patch

All 8 patches have a Reviewed-by or Acked-by.

PatchJoe DamatoStanislav FomichevHarshitha RamamurthyMartin KaFai Lau
1/8R-b A-b
2/8A-b
3/8R-b A-b
4/8R-b A-b
5/8R-b A-b A-b A-b
6/8R-b A-b
7/8R-b A-b
8/8R-b A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v2 thread

Cover letter [PATCH net-next v2 0/8] net: depend on instance lock for queue related netlink ops

netdev-genl used to be protected by rtnl_lock. In previous release we already switched the queue management ops (for Rx zero-copy) to the instance lock. This series converts other ops to depend on the instance lock when possible.

Unfortunately queue related state is hard to lock (unlike NAPI) as the process of switching the number of queues usually involves a large reconfiguration of the driver. The reconfig process has historically been under rtnl_lock, but for drivers which opt into ops locking it is also under the instance lock. Leverage that and conditionally take rtnl_lock or instance lock depending on the device capabilities.

v2:
- fix a bug in patch 2
- reword the doc a tiny bit (patch 7)
v1: https://lore.kernel.org/[email protected]

Jakub Kicinski (8):
net: avoid potential race between netdev_get_by_index_lock() and netns
switch
net: designate XSK pool pointers in queues as "ops protected"
netdev: add "ops compat locking" helpers
netdev: don't hold rtnl_lock over nl queue info get when possible
xdp: double protect netdev->xdp_flags with netdev->lock
netdev: depend on netdev->lock for xdp features
docs: netdev: break down the instance locking info per ops struct
netdev: depend on netdev->lock for qstats in ops locked drivers

 Documentation/networking/netdevices.rst    | 61 +++++++++++++----
 include/linux/netdevice.h                  |  7 +-
 include/net/netdev_lock.h                  | 16 +++++
 include/net/netdev_queues.h                |  4 +-
 include/net/netdev_rx_queue.h              |  6 +-
 include/net/xdp.h                          |  1 +
 net/core/dev.h                             | 17 ++++-
 drivers/net/ethernet/google/gve/gve_main.c |  2 +-
 net/core/dev.c                             | 76 ++++++++++++++++++++--
 net/core/lock_debug.c                      |  2 +-
 net/core/netdev-genl.c                     | 73 ++++++++++-----------
 net/core/xdp.c                             | 12 +++-
 net/xdp/xsk_buff_pool.c                    |  6 +-
 13 files changed, 217 insertions(+), 66 deletions(-)
Signature · 1 line
2.49.0