[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9d3d4e49cec85473619eb5166f01168a6ae3fd85.camel@nvidia.com>
Date: Wed, 11 Feb 2026 16:28:14 +0000
From: Cosmin Ratiu <cratiu@...dia.com>
To: Tariq Toukan <tariqt@...dia.com>, "kuba@...nel.org" <kuba@...nel.org>
CC: "corbet@....net" <corbet@....net>, "andrew+netdev@...n.ch"
<andrew+netdev@...n.ch>, "donald.hunter@...il.com" <donald.hunter@...il.com>,
"davem@...emloft.net" <davem@...emloft.net>, "leon@...nel.org"
<leon@...nel.org>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>, "edumazet@...gle.com" <edumazet@...gle.com>,
"linux-rdma@...r.kernel.org" <linux-rdma@...r.kernel.org>, "jiri@...nulli.us"
<jiri@...nulli.us>, "pabeni@...hat.com" <pabeni@...hat.com>, Jiri Pirko
<jiri@...dia.com>, "linux-doc@...r.kernel.org" <linux-doc@...r.kernel.org>,
Carolina Jubran <cjubran@...dia.com>, "horms@...nel.org" <horms@...nel.org>,
Mark Bloch <mbloch@...dia.com>, "rdunlap@...radead.org"
<rdunlap@...radead.org>, Saeed Mahameed <saeedm@...dia.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>, Gal Pressman
<gal@...dia.com>, Moshe Shemesh <moshe@...dia.com>, "krzk@...nel.org"
<krzk@...nel.org>
Subject: Re: [PATCH net-next V7 07/14] devlink: Add parent dev to devlink API
On Mon, 2026-02-02 at 20:00 -0800, Jakub Kicinski wrote:
> > + info->user_ptr[1] = parent_devlink;
>
> Let's convert devlink to use proper overlay struct over info->cb ?
> The user_ptr array only has two entries so devlink stuffs all the
> extra pointers into the second slot. But the cb is much larger - 48B
> so we can easily give each of these values a dedicated pointer.
I assume you are referring to info->ctx, added by Paolo as part of the
netshaper series. If that's the case, sure, I'll convert devlink to
that as part of the next version of this series.
>
> > + /* Drop the parent devlink lock but don't release
> > the reference.
> > + * This will keep it alive until the end of the
> > request.
> > + */
>
> To be clear -- devlink instances do not behave like netdev instances.
> netdev instances prevent unregistration of the netdev.
> devlink refs are normal refs, they just keep the memory around.
> If memory serves me..
If no reference is held, a concurrent user op could release the parent
devlink instance altogether, and free its memory, that's the reason for
keeping a ref alive for the duration of this request.
Cosmin.
Powered by blists - more mailing lists