From: Leon Romanovsky <leon@kernel.org>
To: Jakub Kicinski <kuba@kernel.org>
Cc: "David S . Miller" <davem@davemloft.net>,
Andrew Lunn <andrew@lunn.ch>,
Florian Fainelli <f.fainelli@gmail.com>,
Ido Schimmel <idosch@nvidia.com>, Jiri Pirko <jiri@nvidia.com>,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
Vivien Didelot <vivien.didelot@gmail.com>,
Vladimir Oltean <olteanv@gmail.com>
Subject: Re: [PATCH net-next v1] devlink: Simplify devlink resources unregister call
Date: Tue, 30 Nov 2021 10:00:28 +0200 [thread overview]
Message-ID: <YaXaHCW3/WQiiTeS@unreal> (raw)
In-Reply-To: <20211129201400.488c8ef9@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
On Mon, Nov 29, 2021 at 08:14:00PM -0800, Jakub Kicinski wrote:
> On Sun, 28 Nov 2021 14:42:44 +0200 Leon Romanovsky wrote:
> > The devlink_resources_unregister() used second parameter as an
> > entry point for the recursive removal of devlink resources. None
> > of external to devlink users needed to use this field, so lat's
>
> None of the callers outside of devlink core...
> s/lat/let/
>
> > remove it.
>
> > diff --git a/include/net/devlink.h b/include/net/devlink.h
> > index e3c88fabd700..043fcec8b0aa 100644
> > --- a/include/net/devlink.h
> > +++ b/include/net/devlink.h
> > @@ -361,33 +361,6 @@ devlink_resource_size_params_init(struct devlink_resource_size_params *size_para
> >
> > typedef u64 devlink_resource_occ_get_t(void *priv);
> >
> > -/**
> > - * struct devlink_resource - devlink resource
> > - * @name: name of the resource
> > - * @id: id, per devlink instance
> > - * @size: size of the resource
> > - * @size_new: updated size of the resource, reload is needed
> > - * @size_valid: valid in case the total size of the resource is valid
> > - * including its children
> > - * @parent: parent resource
> > - * @size_params: size parameters
> > - * @list: parent list
> > - * @resource_list: list of child resources
> > - */
> > -struct devlink_resource {
> > - const char *name;
> > - u64 id;
> > - u64 size;
> > - u64 size_new;
> > - bool size_valid;
> > - struct devlink_resource *parent;
> > - struct devlink_resource_size_params size_params;
> > - struct list_head list;
> > - struct list_head resource_list;
> > - devlink_resource_occ_get_t *occ_get;
> > - void *occ_get_priv;
> > -};
>
> > diff --git a/net/core/devlink.c b/net/core/devlink.c
> > index fd21022145a3..db3b52110cf2 100644
> > --- a/net/core/devlink.c
> > +++ b/net/core/devlink.c
> > @@ -69,6 +69,35 @@ struct devlink {
> > char priv[] __aligned(NETDEV_ALIGN);
> > };
> >
> > +/**
> > + * struct devlink_resource - devlink resource
> > + * @name: name of the resource
> > + * @id: id, per devlink instance
> > + * @size: size of the resource
> > + * @size_new: updated size of the resource, reload is needed
> > + * @size_valid: valid in case the total size of the resource is valid
> > + * including its children
> > + * @parent: parent resource
> > + * @size_params: size parameters
> > + * @list: parent list
> > + * @resource_list: list of child resources
> > + * @occ_get: occupancy getter callback
> > + * @occ_get_priv: occupancy getter callback priv
> > + */
> > +struct devlink_resource {
> > + const char *name;
> > + u64 id;
> > + u64 size;
> > + u64 size_new;
> > + bool size_valid;
> > + struct devlink_resource *parent;
> > + struct devlink_resource_size_params size_params;
> > + struct list_head list;
> > + struct list_head resource_list;
> > + devlink_resource_occ_get_t *occ_get;
> > + void *occ_get_priv;
> > +};
>
> Hiding struct devlink_resource is not mentioned in the commit message
> and entirely unrelated to removal of the unused argument.
devlink_resources_unregister() was the API function that is declared in
the devlink.h that used "struct devlink_resource". Once we removed extra
parameter from that function, the "struct devlink_resource" left as not
used at all. So this "hiding" is related and part of this simplification
patch.
I will add it to the commit message.
Thanks
next prev parent reply other threads:[~2021-11-30 8:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-28 12:42 [PATCH net-next v1] devlink: Simplify devlink resources unregister call Leon Romanovsky
2021-11-30 4:14 ` Jakub Kicinski
2021-11-30 8:00 ` Leon Romanovsky [this message]
2021-11-30 15:13 ` Jakub Kicinski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YaXaHCW3/WQiiTeS@unreal \
--to=leon@kernel.org \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=idosch@nvidia.com \
--cc=jiri@nvidia.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=vivien.didelot@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox