Subject: Re: [RFT net-next 0/6] devlink: expose instance locking and simplify port splitting

From: Ido Schimmel <[email-masked]>
Date: Thu, 10 Mar 2022 23:13:02 +0200

On Thu, Mar 10, 2022 at 10:57:17AM +0200, Ido Schimmel wrote:
> On Wed, Mar 09, 2022 at 04:16:26PM -0800, Jakub Kicinski wrote:
> > This series puts the devlink ports fully under the devlink instance
> > lock's protection. As discussed in the past it implements my preferred
> > solution of exposing the instance lock to the drivers. This way drivers
> > which want to support port splitting can lock the devlink instance
> > themselves on the probe path, and we can take that lock in the core
> > on the split/unsplit paths.
> > 
> > nfp and mlxsw are converted, with slightly deeper changes done in
> > nfp since I'm more familiar with that driver.
> > 
> > Now that the devlink port is protected we can pass a pointer to
> > the drivers, instead of passing a port index and forcing the drivers
> > to do their own lookups. Both nfp and mlxsw can container_of() to
> > their own structures.
> > 
> > I'd appreciate some testing, I don't have access to this HW.
> 
> Thanks for working on this. I ran a few tests that exercise these code
> paths with a debug config and did not see any immediate problems. I will
> go over the patches later today

Went over the patches and they look good to me. Thanks again. Will run a
full regression with them on Sunday.

I read [1] and [2] again to refresh my memory about this conversion. Can
you provide a rough outline of how you plan to go about it? Asking so
that I will know what to expect and how it all fits together. I expect
that eventually 'DEVLINK_NL_FLAG_NO_LOCK' will be removed from
'DEVLINK_CMD_RELOAD' and then the devl_lock()/devl_unlock() that you
left in drivers will be moved to earlier in the probe path so that we
don't deadlock on reload.

[1] https://lore.kernel.org/lkml/YYgJ1bnECwUWvNqD@shredder/
[2] https://lore.kernel.org/netdev/[email-masked]/