From: Mark Bloch <mbloch@nvidia.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Jonathan Corbet <corbet@lwn.net>,
Shuah Khan <skhan@linuxfoundation.org>,
Jiri Pirko <jiri@resnulli.us>, Simon Horman <horms@kernel.org>,
Sunil Goutham <sgoutham@marvell.com>,
Linu Cherian <lcherian@marvell.com>,
Geetha sowjanya <gakula@marvell.com>,
hariprasad <hkelam@marvell.com>,
Subbaraya Sundeep <sbhatta@marvell.com>,
Bharat Bhushan <bbhushan2@marvell.com>,
Saeed Mahameed <saeedm@nvidia.com>,
Leon Romanovsky <leon@kernel.org>,
Tariq Toukan <tariqt@nvidia.com>,
Ethan Nelson-Moore <enelsonmoore@gmail.com>,
linux-doc@vger.kernel.org, netdev@vger.kernel.org,
linux-rdma@vger.kernel.org
Subject: Re: [PATCH net-next V3 2/7] netdevsim: Register devlink after device init
Date: Thu, 11 Jun 2026 09:02:03 +0300 [thread overview]
Message-ID: <eb525345-da07-414c-9d05-7e00e3eb472f@nvidia.com> (raw)
In-Reply-To: <20260610165053.7c91f331@kernel.org>
On 11/06/2026 2:50, Jakub Kicinski wrote:
> On Fri, 5 Jun 2026 21:10:25 +0300 Mark Bloch wrote:
>> devl_register() makes the devlink instance visible to userspace. A later
>> patch also makes registration the point where devlink core may call
>> eswitch_mode_set() to apply a boot-time default eswitch mode.
>>
>> Move netdevsim registration after all objects (resources, params, regions,
>> traps, debugfs etc) are initialized, and after the initial eswitch mode is
>> set to legacy.
>>
>> Move devl_unregister() to the beginning of nsim_drv_remove(), before those
>> devlink objects are torn down. This keeps devlink register/unregister as
>> the notification barrier and makes the later object teardown paths run
>> after devlink is no longer registered, so they do not emit their own
>> netlink DEL notifications.
>
> This is going backwards. At some point someone from nVidia thought that
> we can order our way out of locking, so mlx5 is likely ordered this way,
> but this must not be required, or in any way normalized.
> We (syzbot) quickly discovered that it doesn't cover all corner cases.
> devl_lock() is exposed specifically to allow the driver to finish
> whatever init it needs without letting user space invoke callbacks, yet.
> Almost (?) all driver callbacks hold devl_lock(), so maybe the devlink
> instance is "visible" to user space but that should not matter.
Let me clarify.
No locking is changed here, and I don't want to make register/unregister
ordering a substitute for devl_lock().
The only requirement I have for this series is that devl_register() is called
only once the driver is ready for devlink core to call eswitch_mode_set().
That follows from the earlier direction to have the core apply the default
mode from devl_register() instead of adding an explicit driver call.
So if the objection is to the commit message wording, I can fix that and drop
the "notification barrier" language.
For unregister, I can probably leave the old ordering as-is. I moved it only
to mirror the register path, which felt cleaner, but it is not required for
the default-mode change and as the lock is held I see no issue with doing
that.
Mark
next prev parent reply other threads:[~2026-06-11 6:02 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-05 18:10 [PATCH net-next V3 0/7] devlink: Add boot-time eswitch mode defaults Mark Bloch
2026-06-05 18:10 ` [PATCH net-next V3 1/7] devlink: Skip health recover notifications before register Mark Bloch
2026-06-05 18:10 ` [PATCH net-next V3 2/7] netdevsim: Register devlink after device init Mark Bloch
2026-06-10 23:50 ` Jakub Kicinski
2026-06-11 6:02 ` Mark Bloch [this message]
2026-06-05 18:10 ` [PATCH net-next V3 3/7] net/mlx5: Clear FW reset-in-progress bit before reload Mark Bloch
2026-06-05 18:10 ` [PATCH net-next V3 4/7] net/mlx5: Register devlink after device init Mark Bloch
2026-06-05 18:10 ` [PATCH net-next V3 5/7] octeontx2-af: Register devlink after SR-IOV init Mark Bloch
2026-06-05 18:10 ` [PATCH net-next V3 6/7] octeontx2-pf: Register devlink after SR-IOV state init Mark Bloch
2026-06-05 18:10 ` [PATCH net-next V3 7/7] devlink: Add eswitch mode boot defaults Mark Bloch
2026-06-05 19:37 ` [PATCH net-next V3 0/7] devlink: Add boot-time eswitch mode defaults Borislav Petkov
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=eb525345-da07-414c-9d05-7e00e3eb472f@nvidia.com \
--to=mbloch@nvidia.com \
--cc=andrew+netdev@lunn.ch \
--cc=bbhushan2@marvell.com \
--cc=corbet@lwn.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=enelsonmoore@gmail.com \
--cc=gakula@marvell.com \
--cc=hkelam@marvell.com \
--cc=horms@kernel.org \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=lcherian@marvell.com \
--cc=leon@kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=saeedm@nvidia.com \
--cc=sbhatta@marvell.com \
--cc=sgoutham@marvell.com \
--cc=skhan@linuxfoundation.org \
--cc=tariqt@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