From: Jiri Pirko <jiri@resnulli.us>
To: Jakub Kicinski <kuba@kernel.org>
Cc: netdev@vger.kernel.org, davem@davemloft.net, pabeni@redhat.com,
edumazet@google.com, andrew@lunn.ch, vivien.didelot@gmail.com,
f.fainelli@gmail.com, olteanv@gmail.com, tariqt@nvidia.com,
moshe@nvidia.com, saeedm@nvidia.com
Subject: Re: [patch net-next 0/7] devlink: sanitize per-port region creation/destruction
Date: Fri, 26 Aug 2022 10:21:25 +0200 [thread overview]
Message-ID: <YwiChaPfZKkAK/c4@nanopsycho> (raw)
In-Reply-To: <20220825150132.5ec89092@kernel.org>
Fri, Aug 26, 2022 at 12:01:32AM CEST, kuba@kernel.org wrote:
>On Thu, 25 Aug 2022 12:33:53 +0200 Jiri Pirko wrote:
>> Currently the only user of per-port devlink regions is DSA. All drivers
>> that use regions register them before devlink registration. For DSA,
>> this was not possible as the internals of struct devlink_port needed for
>> region creation are initialized during port registration.
>>
>> This introduced a mismatch in creation flow of devlink and devlink port
>> regions. As you can see, it causes the DSA driver to make the port
>> init/exit flow a bit cumbersome.
>>
>> Fix this by introducing port_init/fini() which could be optionally
>> called by drivers like DSA, to prepare struct devlink_port to be used
>> for region creation purposes before devlink port register is called.
>>
>> Force similar limitation as for devlink params and disallow to create
>> regions after devlink or devlink port are registered. That allows to
>> simplify the devlink region internal API to not to rely on
>> devlink->lock.
>
>The point of exposing the devlink lock was to avoid forcing drivers
>to order object registration in a specific way. I don't like.
Well for params, we are also forcing them in a specific way. The
regions, with the DSA exception which is not voluntary, don't need to be
created/destroyed during devlink/port being registered.
I try to bring some order to the a bit messy devlink world. The
intention is to make everyone's live happier :)
>
>Please provide some solid motivation here 'cause if it's you like vs
>I like...
>
>Also the patches don't apply.
next prev parent reply other threads:[~2022-08-26 8:21 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-25 10:33 [patch net-next 0/7] devlink: sanitize per-port region creation/destruction Jiri Pirko
2022-08-25 10:33 ` [patch net-next 1/7] netdevsim: don't re-create dummy region during devlink reload Jiri Pirko
2022-08-25 10:33 ` [patch net-next 2/7] net: devlink: introduce port registered assert helper and use it Jiri Pirko
2022-08-25 10:33 ` [patch net-next 3/7] net: devlink: introduce a flag to indicate devlink port being registered Jiri Pirko
2022-08-25 10:33 ` [patch net-next 4/7] net: devlink: add port_init/fini() helpers to allow pre-register/post-unregister functions Jiri Pirko
2022-08-25 10:33 ` [patch net-next 5/7] net: dsa: move port_setup/teardown to be called outside devlink port registered area Jiri Pirko
2022-08-25 10:33 ` [patch net-next 6/7] net: dsa: don't do devlink port setup early Jiri Pirko
2022-08-25 22:47 ` Vladimir Oltean
2022-08-26 8:37 ` Jiri Pirko
2022-08-25 10:34 ` [patch net-next 7/7] net: devlink: convert region create/destroy() to be forbidden on registered devlink/port Jiri Pirko
2022-08-25 22:01 ` [patch net-next 0/7] devlink: sanitize per-port region creation/destruction Jakub Kicinski
2022-08-26 8:21 ` Jiri Pirko [this message]
2022-08-27 0:22 ` Jakub Kicinski
2022-08-27 7:39 ` Jiri Pirko
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=YwiChaPfZKkAK/c4@nanopsycho \
--to=jiri@resnulli.us \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=f.fainelli@gmail.com \
--cc=kuba@kernel.org \
--cc=moshe@nvidia.com \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.com \
--cc=saeedm@nvidia.com \
--cc=tariqt@nvidia.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