lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210804085617.58855e62@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
Date:   Wed, 4 Aug 2021 08:56:17 -0700
From:   Jakub Kicinski <kuba@...nel.org>
To:     Leon Romanovsky <leon@...nel.org>
Cc:     Cong Wang <xiyou.wangcong@...il.com>,
        David Miller <davem@...emloft.net>,
        Linux Kernel Network Developers <netdev@...r.kernel.org>,
        "Cong Wang ." <cong.wang@...edance.com>,
        Peilin Ye <peilin.ye@...edance.com>,
        Jiri Pirko <jiri@...nulli.us>
Subject: Re: [PATCH net-next] Revert "netdevsim: Add multi-queue support"

On Wed, 4 Aug 2021 15:49:53 +0300 Leon Romanovsky wrote:
> It is something preliminary, I have POC code which works but it is far
> from the actual patches yet.
> 
> The problem is that "devlink reload" in its current form causes us
> (mlx5) a lot of grief. We see deadlocks due to combinations of internal
> flows with external ones, without going too much in details loops of
> module removal together with health recovery and devlink reload doesn't
> work properly :).
> 
> The same problem exists in all drivers that implement "devlink reload",
> mlx5 just most complicated one and looks like most tested either.
> 
> My idea (for now) is pretty simple:
> 1. Move devlink ops callbacks from devlink_alloc phase to devlink_register().
> 2. Ensure that devlink_register() is the last command in the probe sequence.

IDK.. does that work with port registration vs netdev registration?
IIRC ports should be registered first.

In general devlink is between bus devices and netdevs so I think
devlink should be initialized first, right?

Is merging the two flows (probe vs reload) possible? What I mean is can
we make the drivers use reload_up() during probe? IOW if driver has
.reload_up() make devlink core call that on register with whatever
locks it holds to prevent double-reload?

Either way please make sure to dump all the knowledge you gain about
the locking to some doc. Seems like that's a major sore spot for
devlink.

> 3. Delete devlink_reload_enable/disable. It is not needed if proper ops used.
> 4. Add reference counting to struct devlink to make sure that we
> properly account netlink users, so we will be able to drop big devlink_lock.
> 5. Convert linked list of devlink instances to be xarray. It gives us an
> option to work relatively lockless.
> ....
> 
> Every step solves some bug, even first one solves current bug where
> devlink reload statistics presented despite devlink_reload_disable().
> 
> Of course, we can try to patch devlink with specific fix for specific
> bug, but better to make it error prone from the beginning.
> 
> So I'm trying to get a sense what can and what can't be done in the netdev.
> And netdevsim combination of devlink and sysfs knobs adds challenges. :)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ