From: Jiri Pirko <jiri@resnulli.us>
To: Jakub Kicinski <kuba@kernel.org>
Cc: Shay Drory <shayd@nvidia.com>,
netdev@vger.kernel.org, pabeni@redhat.com, davem@davemloft.net,
edumazet@google.com, Jiri Pirko <jiri@nvidia.com>
Subject: Re: [PATCH net v2] devlink: Delay health recover notification until devlink registered
Date: Fri, 11 Aug 2023 10:05:03 +0200 [thread overview]
Message-ID: <ZNXrr7MspgDp8QfA@nanopsycho> (raw)
In-Reply-To: <20230810103300.186b42c8@kernel.org>
Thu, Aug 10, 2023 at 07:33:00PM CEST, kuba@kernel.org wrote:
>On Wed, 9 Aug 2023 23:35:21 +0300 Shay Drory wrote:
>> From one side, devl_register() is done last in device initialization
>> phase, in order to expose devlink to the user only when device is
>> ready. From second side, it is valid to create health reporters
>> during device initialization, in order to recover and/or notify the
>> user.
>> As a result, a health recover can be invoked before devl_register().
>> However, invoking health recover before devl_register() triggers a
>> WARN_ON.
>
>My comment on v1 wasn't clear enough, I guess.
>
>What I was trying to get across is that because drivers can take
>devl_lock(), devl_register() does not have to be last.
>
>AFAIU your driver does:
>
> devlink_port_health_reporter_create()
> ...
> devlink_register()
>
>why not change it to do:
>
> devl_lock()
> devl_register()
> devl_port_health_reporter_create()
> ...
> devl_unlock() # until unlock user space can't access the instance
This patch is not about user accessing it, this is about
notification that would be tried to send before the instance is
registered. So the lock scheme you suggest is not necessary. What helps
is to move devl_port_health_reporter_create() call after register.
We have the same issue with mlxsw where this notification may be called
before register from mlxsw_core_health_event_work()
Limiting the creation of health reporter only when instance is
registered does not seem like a good solution to me.
As with any other object, we postpone the notifications only after
register is done, that sounds fine, doesn't it?
>
>?
>
next prev parent reply other threads:[~2023-08-11 8:05 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-09 20:35 [PATCH net v2] devlink: Delay health recover notification until devlink registered Shay Drory
2023-08-10 17:33 ` Jakub Kicinski
2023-08-11 8:05 ` Jiri Pirko [this message]
2023-08-11 21:42 ` Jakub Kicinski
2023-08-11 22:14 ` Jakub Kicinski
2023-08-13 10:12 ` Shay Drory
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=ZNXrr7MspgDp8QfA@nanopsycho \
--to=jiri@resnulli.us \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=jiri@nvidia.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shayd@nvidia.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