Re: [PATCH net-next 0/9] devlink: remove the wait-for-references on unregister
From: Jacob Keller <jacob.e.keller@intel.com>
Date: 2023-01-06 17:08:15
On 1/5/2023 10:33 PM, Jakub Kicinski wrote:
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/20221217011953.152487-1-kuba@kernel.org/ (local) - 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(-)
The whole series looks good to me. It looks like Jiri also has some planned followups that will clean some of this up even more, which is great. Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>