Received: by 2002:a05:6a10:8395:0:0:0:0 with SMTP id n21csp595643pxh; Tue, 9 Nov 2021 15:54:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJwxhm5jynwOnXgombF1c9MV42aVKx3HG6aqaE/wCgCsbFViKH+kCKCXQKQlcAEkFp/S/JuD X-Received: by 2002:a02:7105:: with SMTP id n5mr8927080jac.64.1636502046092; Tue, 09 Nov 2021 15:54:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636502046; cv=none; d=google.com; s=arc-20160816; b=ymAA7Jro1i/uQZOcQ04e7GBmjE3M3YP/NNyhrFQfVcix/To7PLPeIxQw+767S0TkKU 0XtPdN1eGHFSTkCpy0lIFAtB+7nKkmJurWX0tk8ECiXeqwWN4ZbbL/7rrU/8nNhuYzXi v60ZPOhk4QwB0PPEGapCNJgucvfH5gxRnhhklZua07rJXea+RnfDC/L9FUkT8GhcO8HI R/NzRCdrKN1UGlwptMLHNYON4kWQeK6A1g+T390PWwfSQFkw7KIidVVhanfQthDqa4q/ DRxaL6lbcaOSXCn5kxMX4/8kN9dYFlg5F6/wwf7UpqjNLNM8f+yF952R3nB47eRnSZMi YMnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=XTS4e/dyLi5Ei6yXMLx29lIRGRPUFIvuvjpErMeVVH8=; b=LarOSzfnjdZ/tpSorX4/2VQawah5w6YHjQJy0IiQM8gJ6dszu+S6EkPj1PjF27Omj7 vb+64nNG2lcIzgajCyLj+cf/OWD4kA8QKJuAT6pDcTPnBoFUDPTIgu6S1ijXopk6O6IG i1BfB+QSZvTsWQAKBKvJoT9IFksDu1UJHeUwoXXH1WYqtBcU6WjqDA5Uq3DtViioVisJ SJHkB2vmNuLyNX22VcFgKxzgX+VH6Y20xry9iJ6+0Tl1yOGv1aUEa9xePLIOixcym0p3 Zx0g/m3y5v2b4I4KJCmWfZSUysmDN47gT406EUawlcIDGYMomsWNP9sCi5jIknk9miY4 8EQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="B/Ls0f0F"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y5si44833229ill.62.2021.11.09.15.53.53; Tue, 09 Nov 2021 15:54:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="B/Ls0f0F"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236815AbhKIOP0 (ORCPT + 97 others); Tue, 9 Nov 2021 09:15:26 -0500 Received: from mail.kernel.org ([198.145.29.99]:50824 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236744AbhKIOPY (ORCPT ); Tue, 9 Nov 2021 09:15:24 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4072961077; Tue, 9 Nov 2021 14:12:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1636467157; bh=ibv5S3X3VOybyGY3Q4Atuq9j4OFPKFJkJ3B8gu8K7Kg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=B/Ls0f0Foznn6ADcKqiqjnJzca/VLfd7pfTjeKFGhf3jzXOl3NeH26uy9+PorCvqf EpaqHuUbmwLMwP1VfXNHx8EoIv12kyo3wDTPS/tYej3KhGSHOA5ehBkzo7RrmQQZI0 CbTMJlbBHclZLlPQDwnis9v8aqBXFhQJ5Ytfcubx63SDcuQqW0BjqsaqRdNk9k1h9Z h1YbS5YZXNY+iN2GdWt58KslyvapZwK5FlDZ28ZdPZubcx7ejMVLBoOTWbOHgMEPIv Kx8x3lJ9l/KJ+zMhqxOPmpROTeNDHMO+4IGY2/Ch12XVXAH6XcxSyItw3SoI+p4vaj bHjV1SsAeb41w== Date: Tue, 9 Nov 2021 16:12:33 +0200 From: Leon Romanovsky To: Jakub Kicinski Cc: Ido Schimmel , Jiri Pirko , "David S . Miller" , Jiri Pirko , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, edwin.peer@broadcom.com Subject: Re: [PATCH net-next] devlink: Require devlink lock during device reload Message-ID: References: <20211101161122.37fbb99d@kicinski-fedora-PC1C0HJN> <20211108080918.2214996c@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> <20211108101646.0a4e5ca4@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> <20211108104608.378c106e@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> <20211108153126.1f3a8fe8@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211108153126.1f3a8fe8@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 08, 2021 at 03:31:26PM -0800, Jakub Kicinski wrote: > On Mon, 8 Nov 2021 21:58:36 +0200 Leon Romanovsky wrote: > > > > > nfp will benefit from the simplified locking as well, and so will bnxt, > > > > > although I'm not sure the maintainers will opt for using devlink framework > > > > > due to the downstream requirements. > > > > > > > > Exactly why devlink should be fixed first. > > > > > > If by "fixed first" you mean it needs 5 locks to be added and to remove > > > any guarantees on sub-object lifetime then no thanks. > > > > How do you plan to fix pernet_ops_rwsem lock? By exposing devlink state > > to the drivers? By providing unlocked version of unregister_netdevice_notifier? > > > > This simple scenario has deadlocks: > > sudo ip netns add n1 > > sudo devlink dev reload pci/0000:00:09.0 netns n1 > > sudo ip netns del n1 > > Okay - I'm not sure why you're asking me this. This is not related to > devlink locking as far as I can tell. Neither are you fixing this > problem in your own RFC. I asked you because you clearly showed to me that things that makes sense for me, doesn't make sense for you and vice versa. I don't want to do work that will be thrown away. > > You'd need to tell me more about what the notifier is used for (I see > RoCE in the call trace). I don't understand why you need to re-register > a global (i.e. not per netns) notifier when devlink is switching name > spaces. RDMA subsystem supports two net namespace aware scenarios. We need global netdev_notifier for shared mode. This is legacy mode where we listen to all namespaces. We must support this mode otherwise we break whole RDMA world. See commit below: de641d74fb00 ("Revert "RDMA/mlx5: Fix devlink deadlock on net namespace deletion"") Thanks