Skip to content

net: use netdev->lock to protect NAPI

Jakub Kicinski netdev 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest11 patches 21 repliesIn review 5 of 11 applied
  2. v111 patches 22 repliesSuperseded

Changes in v2 from the cover letter

- reorder patches 2 and 3
- add missing READ_ONCE()
- fix up the kdoc to please Sphinx / htmldocs
- use napi_disabled_locked() in via-velocity
- update the comment on dev_isalive()
v1: https://lore.kernel.org/[email protected]

Patches in v2 5 of 11 applied

#Subject and filesSizeRepliesApplied
1/11net: add netdev_lock() / netdev_unlock() helpersdrivers/net/ethernet/intel/iavf/iavf_main.c drivers/net/netdevsim/ethtool.c include/linux/netdevice.h +1 more+63 -445 replies
2/11net: make netdev_lock() protect netdev->reg_stateinclude/linux/netdevice.h net/core/dev.c+7 -12 repliesApplied
3/11net: add helpers for lookup and walking netdevs under netdev_lock()net/core/dev.c net/core/dev.h+126 -01 reply
4/11net: add netdev->up protected by netdev_lock()include/linux/netdevice.h net/core/dev.c net/core/dev.h+27 -31 reply
5/11net: protect netdev->napi_list with netdev_lock()drivers/net/ethernet/intel/iavf/iavf_main.c include/linux/netdevice.h net/core/dev.c+60 -153 replies
6/11net: protect NAPI enablement with netdev_lock()drivers/net/ethernet/amd/pcnet32.c drivers/net/ethernet/intel/iavf/iavf_main.c drivers/net/ethernet/marvell/mvneta.c +3 more+56 -224 replies
7/11net: make netdev netlink ops hold netdev_lock()net/core/dev.c net/core/dev.h net/core/netdev-genl.c+27 -231 reply
8/11net: protect threaded status of NAPI with netdev_lock()include/linux/netdevice.h net/core/dev.c net/core/net-sysfs.c+45 -41 replyApplied
9/11net: protect napi->irq with netdev_lock()include/linux/netdevice.h net/core/dev.c+10 -21 replyApplied
10/11net: protect NAPI config fields with netdev_lock()include/linux/netdevice.h net/core/net-sysfs.c+7 -51 replyApplied
11/11netdev-genl: remove rtnl_lock protection from NAPI opsnet/core/netdev-genl.c+0 -101 replyApplied

Reviews trailers per patch

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

PatchJoe DamatoEric DumazetFrancois RomieuKuniyuki IwashimaPrzemek Kitszel
1/11R-b R-b R-b R-b
2/11R-b R-b R-b
3/11R-b R-b
4/11R-b R-b R-b
5/11R-b R-b R-b
6/11R-b A-b R-b
7/11R-b R-b
8/11R-b R-b
9/11R-b R-b R-b
10/11R-b R-b R-b
11/11R-b R-b R-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 5 reviewers.

Read the v2 thread

Cover letter [PATCH net-next v2 00/11] net: use netdev->lock to protect NAPI

We recently added a lock member to struct net_device, with a vague plan to start using it to protect netdev-local state, removing the need to take rtnl_lock for new configuration APIs.

Lay some groundwork and use this lock for protecting NAPI APIs.

v2:
- reorder patches 2 and 3
- add missing READ_ONCE()
- fix up the kdoc to please Sphinx / htmldocs
- use napi_disabled_locked() in via-velocity
- update the comment on dev_isalive()
v1: https://lore.kernel.org/[email protected]

Jakub Kicinski (11):
net: add netdev_lock() / netdev_unlock() helpers
net: make netdev_lock() protect netdev->reg_state
net: add helpers for lookup and walking netdevs under netdev_lock()
net: add netdev->up protected by netdev_lock()
net: protect netdev->napi_list with netdev_lock()
net: protect NAPI enablement with netdev_lock()
net: make netdev netlink ops hold netdev_lock()
net: protect threaded status of NAPI with netdev_lock()
net: protect napi->irq with netdev_lock()
net: protect NAPI config fields with netdev_lock()
netdev-genl: remove rtnl_lock protection from NAPI ops

 include/linux/netdevice.h                   | 118 +++++++++++--
 net/core/dev.h                              |  29 +++-
 drivers/net/ethernet/amd/pcnet32.c          |  11 +-
 drivers/net/ethernet/intel/iavf/iavf_main.c |  84 ++++-----
 drivers/net/ethernet/marvell/mvneta.c       |   5 +-
 drivers/net/ethernet/via/via-velocity.c     |   6 +-
 drivers/net/netdevsim/ethtool.c             |   4 +-
 net/core/dev.c                              | 183 ++++++++++++++++++--
 net/core/net-sysfs.c                        |  39 ++++-
 net/core/netdev-genl.c                      |  56 +++---
 net/shaper/shaper.c                         |   6 +-
 11 files changed, 420 insertions(+), 121 deletions(-)
Signature · 1 line
2.48.0