All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Leon Romanovsky <leon@kernel.org>
Cc: Ido Schimmel <idosch@idosch.org>,
	"David S . Miller" <davem@davemloft.net>,
	Ido Schimmel <idosch@mellanox.com>,
	Jiri Pirko <jiri@mellanox.com>,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	syzbot+93d5accfaefceedf43c1@syzkaller.appspotmail.com,
	Edwin Peer <edwin.peer@broadcom.com>
Subject: Re: [PATCH net-next] netdevsim: Register and unregister devlink traps on probe/remove device
Date: Wed, 27 Oct 2021 07:17:23 -0700	[thread overview]
Message-ID: <20211027071723.12bd0b29@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> (raw)
In-Reply-To: <YXjqHc9eCpYy03Ym@unreal>

On Wed, 27 Oct 2021 08:56:45 +0300 Leon Romanovsky wrote:
> On Tue, Oct 26, 2021 at 12:56:02PM -0700, Jakub Kicinski wrote:
> > On Tue, 26 Oct 2021 22:30:23 +0300 Leon Romanovsky wrote:  
> > > No problem, I'll send a revert now, but what is your take on the direction?  
> > 
> > I haven't put in the time to understand the detail so I was hoping not
> > to pass judgment on the direction. My likely unfounded feeling is that
> > reshuffling ordering is not going to fix what is fundamentally a
> > locking issue. Driver has internal locks it needs to hold both inside
> > devlink callbacks and when registering devlink objects. We would solve
> > a lot of the problems if those were one single lock instead of two. 
> > At least that's my recollection from the times I was actually writing
> > driver code...  
> 
> Exactly, and this is what reshuffling of registrations does. It allows us
> to actually reduce number of locks to bare minimum, so at least creation
> and deletion of devlink objects will be locks free.

That's not what I meant. I meant devlink should call in to take
driver's lock or more likely driver should use the devlink instance
mutex instead of creating its own. Most of the devlink helpers (with
minor exceptions like alloc) should just assert that devlink instance
lock is already held by the driver when called.

> Latest changes already solved devlink reload issues for mlx5 eth side
> and it is deadlock and lockdep free now. We still have deadlocks with
> our IB part, where we obligated to hold pernet lock during registering
> to net notifiers, but it is different discussion.
> 
> > > IMHO, the mlxsw layering should be fixed. All this recursive devlink re-entry
> > > looks horrible and adds unneeded complexity.  
> > 
> > If you're asking about mlxsw or bnxt in particular I wouldn't say what
> > they do is wrong until we can point out bugs.  
> 
> I'm talking about mlxsw and pointed to the reentry to devlink over and over.

To me "pointing to re-entry" read like breaking the new model you have
in mind, not actual bug/race/deadlock etc. If that's not the case the
explanation flew over my head :)

  reply	other threads:[~2021-10-27 14:18 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-24  8:42 [PATCH net-next] netdevsim: Register and unregister devlink traps on probe/remove device Leon Romanovsky
2021-10-24  9:05 ` Ido Schimmel
2021-10-24  9:54   ` Leon Romanovsky
2021-10-24 10:48     ` Ido Schimmel
2021-10-25  5:34       ` Leon Romanovsky
2021-10-25  8:08         ` Ido Schimmel
2021-10-25 10:56           ` Leon Romanovsky
2021-10-26  6:51             ` Ido Schimmel
2021-10-26  7:18               ` Leon Romanovsky
2021-10-26 14:09                 ` Ido Schimmel
2021-10-26 16:14                   ` Leon Romanovsky
2021-10-26 19:02                     ` Jakub Kicinski
2021-10-26 19:30                       ` Leon Romanovsky
2021-10-26 19:56                         ` Jakub Kicinski
2021-10-27  5:56                           ` Leon Romanovsky
2021-10-27 14:17                             ` Jakub Kicinski [this message]
2021-10-27 15:17                               ` Leon Romanovsky
2021-10-27 19:15                                 ` Leon Romanovsky
2021-10-27 19:28                                   ` Jakub Kicinski
2021-10-25 18:24           ` Jakub Kicinski
2021-10-25 19:12             ` Leon Romanovsky
2021-10-25 23:19   ` Edwin Peer
2021-10-26  5:56     ` Leon Romanovsky
2021-10-26 17:34       ` Edwin Peer
2021-10-26 19:22         ` Leon Romanovsky
2021-10-26 20:03           ` Edwin Peer
2021-10-27  6:43             ` Leon Romanovsky
2021-10-27  8:46               ` Edwin Peer
2021-10-27  9:43                 ` Leon Romanovsky

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=20211027071723.12bd0b29@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com \
    --to=kuba@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edwin.peer@broadcom.com \
    --cc=idosch@idosch.org \
    --cc=idosch@mellanox.com \
    --cc=jiri@mellanox.com \
    --cc=leon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=syzbot+93d5accfaefceedf43c1@syzkaller.appspotmail.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.