Re: [RFC net-next 06/10] devlink: don't require setting features before registration

Jiri Pirko
2023-01-02T15:26:20Z

Sat, Dec 17, 2022 at 02:19:49AM CET, kuba@kernel.org wrote:
>Requiring devlink_set_features() to be run before devlink is
>registered is overzealous. devlink_set_features() itself is
>a leftover from old workarounds which were trying to prevent
>initiating reload before probe was complete.

Wouldn't it be better to remove this entirely? I don't think it is
needed anymore.

>
>Signed-off-by: Jakub Kicinski <kuba@kernel.org>
>---
> net/devlink/core.c | 2 --
> 1 file changed, 2 deletions(-)
>
>diff --git a/net/devlink/core.c b/net/devlink/core.c
>index 413b92534ad6..f30fc167c8ad 100644
>--- a/net/devlink/core.c
>+++ b/net/devlink/core.c
>@@ -131,8 +131,6 @@ struct devlink *devlinks_xa_find_get(struct net *net, unsigned long *indexp)
> */
> void devlink_set_features(struct devlink *devlink, u64 features)
> {
>- ASSERT_DEVLINK_NOT_REGISTERED(devlink);
>-
> WARN_ON(features & DEVLINK_F_RELOAD &&
> !devlink_reload_supported(devlink->ops));
> devlink->features = features;
>--
>2.38.1
>