Skip to content

devlink: remove the wait-for-references on unregister

Jakub Kicinski netdev 1 version Applied

Status from this message: This series was applied to netdev/net-next.git (master)

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest9 patches 34 repliesApplied 9/9

Patches in v1 All 9 applied

#Subject and filesSizeRepliesApplied
1/9devlink: bump the instance index directly when iteratingnet/devlink/core.c net/devlink/devl_internal.h+13 -351 replyApplied
2/9devlink: update the code in netns move to latest helpersnet/devlink/core.c+4 -30 repliesApplied
3/9devlink: protect devlink->dev by the instance locknet/devlink/devl_internal.h net/devlink/leftover.c net/devlink/netlink.c+11 -81 replyApplied
4/9devlink: always check if the devlink instance is registerednet/devlink/core.c net/devlink/devl_internal.h net/devlink/leftover.c +1 more+60 -124 repliesApplied
5/9devlink: remove the registration guarantee of referencesinclude/net/devlink.h net/devlink/core.c net/devlink/devl_internal.h+30 -381 replyApplied
6/9devlink: don't require setting features before registrationnet/devlink/core.c+0 -21 replyApplied
7/9devlink: allow registering parameters after the instancenet/devlink/leftover.c+11 -1122 repliesApplied
8/9netdevsim: rename a labeldrivers/net/netdevsim/dev.c+2 -21 replyApplied
9/9netdevsim: move devlink registration under the instance lockdrivers/net/netdevsim/dev.c+8 -31 replyApplied

Reviews trailers per patch

All 9 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchJiri PirkoJacob Keller
SeriesR-b
1/9R-b
2/9R-b
3/9R-b
4/9R-b
5/9R-b R-b
6/9R-b
7/9R-b
8/9R-b R-b
9/9R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH net-next 0/9] devlink: remove the wait-for-references on unregister

Move the registration and unregistration of the devlink instances under their instance locks. Don't perform the netdev-style wait for all references when unregistering the instance.

Instead the devlink instance refcount will only ensure that the memory of the instance is not freed. All places which acquire access to devlink instances via a reference must check that the instance is still registered under the instance lock.

This fixes the problem of the netdev code accessing devlink instances before they are registered.

RFC: https://lore.kernel.org/all/[email protected]/
- rewrite the cover letter
- rewrite the commit message for patch 1
- un-export and rename devl_is_alive
- squash the netdevsim patches

Jakub Kicinski (9):
devlink: bump the instance index directly when iterating
devlink: update the code in netns move to latest helpers
devlink: protect devlink->dev by the instance lock
devlink: always check if the devlink instance is registered
devlink: remove the registration guarantee of references
devlink: don't require setting features before registration
devlink: allow registering parameters after the instance
netdevsim: rename a label
netdevsim: move devlink registration under the instance lock

 drivers/net/netdevsim/dev.c |  15 +++--
 include/net/devlink.h       |   2 +
 net/devlink/core.c          | 121 ++++++++++++++++--------------------
 net/devlink/devl_internal.h |  28 ++++-----
 net/devlink/leftover.c      |  64 ++++++++++++-------
 net/devlink/netlink.c       |  19 ++++--
 6 files changed, 137 insertions(+), 112 deletions(-)
Signature · 1 line
2.38.1