From: Przemek Kitszel <przemyslaw.kitszel@intel.com>
To: Jiri Pirko <jiri@resnulli.us>
Cc: <netdev@vger.kernel.org>, Jakub Kicinski <kuba@kernel.org>,
Tony Nguyen <anthony.l.nguyen@intel.com>,
<intel-wired-lan@lists.osuosl.org>,
"Aleksandr Loktionov" <aleksandr.loktionov@intel.com>,
<edumazet@google.com>, <horms@kernel.org>, <pabeni@redhat.com>,
<davem@davemloft.net>, "Michal Schmidt" <mschmidt@redhat.com>
Subject: Re: [PATCH net-next 2/2] devlink: unregister shared devlink resources on destroy
Date: Thu, 26 Mar 2026 06:44:49 +0100 [thread overview]
Message-ID: <b78d4c11-e20b-4a84-b8da-2638df46c46c@intel.com> (raw)
In-Reply-To: <aa7hsleso6z6zaubb6phx4lexqnthgdvkns5cpg75gk6w3pi3o@7skrmgryitsj>
On 3/26/26 06:20, Jiri Pirko wrote:
> Wed, Mar 25, 2026 at 07:26:53AM +0100, przemyslaw.kitszel@intel.com wrote:
>> Since shared devlink acts as a normal devlink instance, capable of all
>> usual devlink operations, it must unregister its resources.
>>
>> I plan to make use of devlink resources on a shared instance for ice
>> driver by separate series, coming soon.
>>
>> Signed-off-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
>> ---
>> net/devlink/sh_dev.c | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/net/devlink/sh_dev.c b/net/devlink/sh_dev.c
>> index b85e5cb1edbe..5de138bf3630 100644
>> --- a/net/devlink/sh_dev.c
>> +++ b/net/devlink/sh_dev.c
>> @@ -71,6 +71,7 @@ static void devlink_shd_destroy(struct devlink_shd *shd)
>>
>> list_del(&shd->list);
>> devl_lock(devlink);
>> + devl_resources_unregister(devlink);
>
> Hmm. It is driver's responsibility to call this on appropriate place,
> symmetric to resource register. Why to have this in code for sh?
>
> The idea I had was to have callbacks to driver to do things like this
> and more eventually. Would it work for you?
for driver stuff that could be useful (say, someone wants to have
an additional data structure to iterate and free), OTOH, each
entity that is sharing should "unplug" from shared devlink, so
those structures should be emptied anyway
for my stuff in ice I managed to do without destructor
coming back to devlink stuff - all things (resources, health)
would need same cleaning in all drives, so putting that in
devlink_shd_destroy() will simply take the burden off devs
(at the expense of less symmetric code for normal/shared
devlinks)
in short: I'm ok with any of
a. callback for all cleanup
b. callback for driver-specific cleanup
c. no callback and no driver-specific cleanup (until someone needs
that very much)
thanks!
>
>
>> devl_unregister(devlink);
>> devl_unlock(devlink);
>> kfree(shd->id);
>> --
>> 2.51.1
>>
prev parent reply other threads:[~2026-03-26 5:45 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-25 6:26 [PATCH net-next 0/2] devlink: shared devlink improvements Przemek Kitszel
2026-03-25 6:26 ` [PATCH net-next 1/2] devlink: unify devlink_shd_get_priv() into devlink_priv() Przemek Kitszel
2026-03-25 7:46 ` Loktionov, Aleksandr
2026-03-25 23:36 ` [Intel-wired-lan] " Jacob Keller
2026-03-26 5:47 ` Przemek Kitszel
2026-03-26 5:21 ` Jiri Pirko
2026-03-26 21:38 ` Jakub Kicinski
2026-03-25 6:26 ` [PATCH net-next 2/2] devlink: unregister shared devlink resources on destroy Przemek Kitszel
2026-03-25 7:39 ` Loktionov, Aleksandr
2026-03-26 5:20 ` Jiri Pirko
2026-03-26 5:44 ` Przemek Kitszel [this message]
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=b78d4c11-e20b-4a84-b8da-2638df46c46c@intel.com \
--to=przemyslaw.kitszel@intel.com \
--cc=aleksandr.loktionov@intel.com \
--cc=anthony.l.nguyen@intel.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=mschmidt@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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