From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 98F77C4320A for ; Wed, 4 Aug 2021 15:56:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 72BCC60ED6 for ; Wed, 4 Aug 2021 15:56:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239587AbhHDP4c (ORCPT ); Wed, 4 Aug 2021 11:56:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:57348 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239505AbhHDP4b (ORCPT ); Wed, 4 Aug 2021 11:56:31 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5E78260ED6; Wed, 4 Aug 2021 15:56:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1628092578; bh=RPaomrfZsu0NlLq7o4610pOBPFZ977N+t3sUJsClm/o=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=cgW3dGl+lOQ49qtgd0AyTzNXEKEqNbr3rw9VFTFxA2mnrCIzn+O9zKT+z1QZf44Fx xq/EienfNdqOpqyOmfkm0rs/WFYIvooEArRQL9c9zwpKd0JcXj56Aq+81l96a2QOt6 sBS6XU/JnsJk/XSJeUFaImMpxhKWCECSOclwyFLE3Uf5bqn1LlOV0foKvxEj3r6Sqn eJS/Fs0msIarzkdQj6PKhOFVmlgUcYDKflTdXElfNHHF9kcQ7X7cmQD+pXdtWKW9uu tlNmeMYmF220fhlYGluHsKANBls0L0qRseNKUGrbxSWMmGGwevnEnKv/YOKMMly5nb QqIlo+F/dRQUg== Date: Wed, 4 Aug 2021 08:56:17 -0700 From: Jakub Kicinski To: Leon Romanovsky Cc: Cong Wang , David Miller , Linux Kernel Network Developers , "Cong Wang ." , Peilin Ye , Jiri Pirko Subject: Re: [PATCH net-next] Revert "netdevsim: Add multi-queue support" Message-ID: <20210804085617.58855e62@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> In-Reply-To: References: <20210803123921.2374485-1-kuba@kernel.org> <20210803141839.79e99e23@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> <20210803145124.71a8aab4@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> <20210804045247.057c5e9c@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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. :)