diff options
author | Jiri Pirko <jiri@nvidia.com> | 2023-01-27 16:50:42 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2023-01-30 08:37:46 +0000 |
commit | fb8421a94c5613fee86e192bab0892ecb1d56e4c (patch) | |
tree | b28cedef2ff2c2836ebd79b7b2a67f92f854bb6e /net/devlink | |
parent | a131315a47bbb5e89a3330cac69fe6ab4836f762 (diff) |
devlink: remove devlink features
Devlink features were introduced to disallow devlink reload calls of
userspace before the devlink was fully initialized. The reason for this
workaround was the fact that devlink reload was originally called
without devlink instance lock held.
However, with recent changes that converted devlink reload to be
performed under devlink instance lock, this is redundant so remove
devlink features entirely.
Note that mlx5 used this to enable devlink reload conditionally only
when device didn't act as multi port slave. Move the multi port check
into mlx5_devlink_reload_down() callback alongside with the other
checks preventing the device from reload in certain states.
Signed-off-by: Jiri Pirko <jiri@nvidia.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/devlink')
-rw-r--r-- | net/devlink/core.c | 19 | ||||
-rw-r--r-- | net/devlink/devl_internal.h | 1 | ||||
-rw-r--r-- | net/devlink/leftover.c | 3 |
3 files changed, 0 insertions, 23 deletions
diff --git a/net/devlink/core.c b/net/devlink/core.c index 6c0e2fc57e45..aeffd1b8206d 100644 --- a/net/devlink/core.c +++ b/net/devlink/core.c @@ -126,23 +126,6 @@ next: } /** - * devlink_set_features - Set devlink supported features - * - * @devlink: devlink - * @features: devlink support features - * - * This interface allows us to set reload ops separatelly from - * the devlink_alloc. - */ -void devlink_set_features(struct devlink *devlink, u64 features) -{ - WARN_ON(features & DEVLINK_F_RELOAD && - !devlink_reload_supported(devlink->ops)); - devlink->features = features; -} -EXPORT_SYMBOL_GPL(devlink_set_features); - -/** * devl_register - Register devlink instance * @devlink: devlink */ @@ -303,7 +286,6 @@ static void __net_exit devlink_pernet_pre_exit(struct net *net) * all devlink instances from this namespace into init_net. */ devlinks_xa_for_each_registered_get(net, index, devlink) { - WARN_ON(!(devlink->features & DEVLINK_F_RELOAD)); devl_lock(devlink); err = 0; if (devl_is_registered(devlink)) @@ -313,7 +295,6 @@ static void __net_exit devlink_pernet_pre_exit(struct net *net) &actions_performed, NULL); devl_unlock(devlink); devlink_put(devlink); - if (err && err != -EOPNOTSUPP) pr_warn("Failed to reload devlink instance into init_net\n"); } diff --git a/net/devlink/devl_internal.h b/net/devlink/devl_internal.h index d0d889038138..ba161de4120e 100644 --- a/net/devlink/devl_internal.h +++ b/net/devlink/devl_internal.h @@ -38,7 +38,6 @@ struct devlink { struct list_head trap_policer_list; struct list_head linecard_list; const struct devlink_ops *ops; - u64 features; struct xarray snapshot_ids; struct devlink_dev_stats stats; struct device *dev; diff --git a/net/devlink/leftover.c b/net/devlink/leftover.c index 4f78ef5a46af..92210587d349 100644 --- a/net/devlink/leftover.c +++ b/net/devlink/leftover.c @@ -4387,9 +4387,6 @@ static int devlink_nl_cmd_reload(struct sk_buff *skb, struct genl_info *info) u32 actions_performed; int err; - if (!(devlink->features & DEVLINK_F_RELOAD)) - return -EOPNOTSUPP; - err = devlink_resources_validate(devlink, NULL, info); if (err) { NL_SET_ERR_MSG_MOD(info->extack, "resources size validation failed"); |