Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3114969pxb; Mon, 1 Nov 2021 08:08:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyURyC1fF6MLHS7QuQoXdXh9Omt+2eOl9278AK37o7LOdv1SUX0nXOeKVYp0uxiNUgi/CYk X-Received: by 2002:a50:da48:: with SMTP id a8mr41593889edk.155.1635779307483; Mon, 01 Nov 2021 08:08:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635779307; cv=none; d=google.com; s=arc-20160816; b=EHHoVnVd+8BbktnfVktjP8MJDO2LXyItVLwxcDx+pwRPUxHlAYwI3Zn/MQiZVaOPLm iWNaMirLMqjZvztUJ9WhwAwpUXn8IPcrDYkNri135j9dU0l5HGtPL2QfY14Ssg2H4qDc NFsRd1f+dRz67hOWzn4qrP5J5ljI18bMt3WdFb9od8zO4tRg4GzO2oz4J+Pzpibjzdx3 Jky0fv5ncsW8ZWtm4+YdGjodpR+5x8yTGQEJ397Hu0F+/++zuyGYOOSM3LAzfEXBzhou HxwQnsitSKtr7HVCZrfeYKVJi/knYnNJGTU46vA5zTwqDcmpSabpgtVvKuK5nkiSMZT9 HMVw== 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=hNW4Ixcay0dGNrznHOns1UxaQHFHjWDg3N8pJvJFqno=; b=jNp3vCrasnW3+nD45uKeCtMs2VZlFRDoFEkBfaKKLQAgBw4wPRp4zaZoSFjFOFBWJl zNiqKOGk1UIqXmHeddD4dYwfoQJjmH1UJ/2MDlXxpHHbB8jA65RMWljWSP7wlmwxuUNA 50SU6kotx4deB/DtyP3qMbTeVL6qfXPJNMjUiTBvtvYWLrHN+9RammjwY3/CbhzzazMo Z8Cv3haciljRE5ldxi7acb9Eg9gOvAQVJ2KuweUq8KT02XpVDNFJh63oI8uADxj7+04G 8W5fWkm/TlbAA/V2wf/9gLPodTLfFzp4Yl7bUoa4OKXO28CU/FqjpNMJ25VY5301Ndl8 vz8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@resnulli-us.20210112.gappssmtp.com header.s=20210112 header.b=ex+CUgRm; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s12si18872078ejc.488.2021.11.01.08.08.02; Mon, 01 Nov 2021 08:08:27 -0700 (PDT) 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=@resnulli-us.20210112.gappssmtp.com header.s=20210112 header.b=ex+CUgRm; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232353AbhKAPFp (ORCPT + 99 others); Mon, 1 Nov 2021 11:05:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36138 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230517AbhKAPFp (ORCPT ); Mon, 1 Nov 2021 11:05:45 -0400 Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8DAF3C061764 for ; Mon, 1 Nov 2021 08:03:09 -0700 (PDT) Received: by mail-wm1-x32b.google.com with SMTP id y196so4319665wmc.3 for ; Mon, 01 Nov 2021 08:03:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=resnulli-us.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=hNW4Ixcay0dGNrznHOns1UxaQHFHjWDg3N8pJvJFqno=; b=ex+CUgRmjpNeOH4KEiWT6LNCRsWIt0aXB+6dlwTfwFZk/rgbHEhuVmCM/tK4aoMHxH x07MDAs2Ip4qvpWRFKdQUVo8gbaKMW6XUNBieSMnW3BubKw+T7nJbPd24S7RAQ6iN0el rCmiJLitn8XdsnKlB6dDo8jrON6oEczqsaxGsS5Rzva8G2Yi/+dzOyHHyb2hYm76b5pa xEAGr2bXxfKNiMM7WpA7fHaUpuuvmFWbVKfMhtyZDYCzbSMG1CEyMJIovRNt3qxnbWb8 DYEwA6t0//Q8PjR2TbGqt59+3k1yoBBGLOdKcLXMfrpUCxC6VlgoesXoBEjjI/4kelsc vbdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=hNW4Ixcay0dGNrznHOns1UxaQHFHjWDg3N8pJvJFqno=; b=ZY2rSMEG0qDCiR4sQKLQIOM2JFqKtKhj+j6/TUKhNWyKZ6LCLSxpMjfy043ia2m/9p VgaTJGwPHCFAB04SlpATElexLeTRZAL6V1ez0yzfd3rLFBIO+Fsxd/EIjzvOwSFH/iUe tfn52u40MnUolKWH4j08VIzMxykWLBOVSsdA4PgqdvPq+O4AckLZaq53qHMkXFIXjHx3 V2UKvxOos2MxRpadOovJ3+Ra8eRrUaVWD0SEWwX9iYh3qPnUnRkV6n4iw5mLWtsJFrSY 16QUuJ2rgpkYFQgqkmNc3YS+iHncCJ+dBIw7Wmc5S3i+p7X/rjCko8vb6+rc9a0ux0dg E9Hg== X-Gm-Message-State: AOAM531bnuneKtd/JreRtKAz/c8qlWHdBuc5knRKy+7KTBW/bB4xDDgH /CqMebZKaSs26xfFd+E3ekl7Ig== X-Received: by 2002:a1c:e912:: with SMTP id q18mr32860015wmc.121.1635778987465; Mon, 01 Nov 2021 08:03:07 -0700 (PDT) Received: from localhost (host-213-179-129-39.customer.m-online.net. [213.179.129.39]) by smtp.gmail.com with ESMTPSA id q4sm9330749wrs.56.2021.11.01.08.03.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Nov 2021 08:03:06 -0700 (PDT) Date: Mon, 1 Nov 2021 16:03:05 +0100 From: Jiri Pirko To: Leon Romanovsky Cc: "David S . Miller" , Jakub Kicinski , Leon Romanovsky , Jiri Pirko , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, idosch@idosch.org, edwin.peer@broadcom.com Subject: Re: [PATCH net-next] devlink: Require devlink lock during device reload Message-ID: References: <9716f9a13e217a0a163b745b6e92e02d40973d2c.1635701665.git.leonro@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9716f9a13e217a0a163b745b6e92e02d40973d2c.1635701665.git.leonro@nvidia.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Sun, Oct 31, 2021 at 06:35:56PM CET, leon@kernel.org wrote: >From: Leon Romanovsky > >Devlink reload was implemented as a special command which does _SET_ >operation, but doesn't take devlink->lock, while recursive devlink >calls that were part of .reload_up()/.reload_down() sequence took it. > >This fragile flow was possible due to holding a big devlink lock >(devlink_mutex), which effectively stopped all devlink activities, >even unrelated to reloaded devlink. > >So let's make sure that devlink reload behaves as other commands and >use special nested locking primitives with a depth of 1. Such change >opens us to a venue of removing devlink_mutex completely, while keeping >devlink locking complexity in devlink.c. > >Signed-off-by: Leon Romanovsky Looks fine to me. Reviewed-by: Jiri Pirko