All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Shay Drory <shayd@nvidia.com>
Cc: <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: Thu, 10 Aug 2023 10:33:00 -0700	[thread overview]
Message-ID: <20230810103300.186b42c8@kernel.org> (raw)
In-Reply-To: <20230809203521.1414444-1-shayd@nvidia.com>

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

?

  reply	other threads:[~2023-08-10 17:33 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 [this message]
2023-08-11  8:05   ` Jiri Pirko
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=20230810103300.186b42c8@kernel.org \
    --to=kuba@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=jiri@nvidia.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.