Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp620401pxb; Mon, 25 Oct 2021 15:09:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxkEcIhvWJ5S+L2F4NCrYPauDB9Lb3aunPAzjkpnbLhrsEuoe3s3czYd74naV8EcrfO8/j1 X-Received: by 2002:aa7:c3da:: with SMTP id l26mr28279829edr.117.1635199743229; Mon, 25 Oct 2021 15:09:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635199743; cv=none; d=google.com; s=arc-20160816; b=dZRnQK76jurOLZuN9BrZCdXnIoVvXHT4mE9S4Yx3DmLUrD7dPjCo65sYsWUT6qp+fS 89bHKBXxsfYfptVeEOfMlrYTNaWylmpR0WOMSHo3LV7IwI6IgOfeS3w7QLD65OLI/Fhi k7+r6543Fh81oLjfEbqs3MRkvQ8/9vAdmeV6RNL6lv29kYhz1/7FPzTZQRZMXTpIT67Q W77PjKMB0jQ2GhIW63mzpktPiN2RQn4dbZ54Wv38Et0mp50hYo+yaTOIZ35WiE7b1vq3 aVM2jjXoMc0E0Myoq9IxyGnmzt5nZrFVfjBc+cCWwE+urddgNPPhQ+MsVseB1mKOQfhG gpqA== 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=lUq5vx/+Zc52NdZxL1B9sS80LkSTV6GGlK1KYKaN3YU=; b=MWciOkJnJazWz36rxNs1sMR/5tb1RJ+j4tqEGLNgM2yGCJvMkKSnJ4j7EmWDufq+g/ uwExx7scWzHe5K9iV/BNIGaN7Eah0efvcYwG8TATGQkHmonlhExi/7m2bHkNtb8qK+nR EIoRUIiSHns81L4eOlrhx0cqV6YeE1rvNQi2yi7O1dh2HfCwfEDb6ekKhXxeb6YFT1Hj yu36cvkWZkmnu02r0Dzs0W+JbPpG8K3eGoosY2tjieXr5I56CH8f8qEt1n8/pxTED+eW rPP2i5TpVqWzdMkkSsMMIOm1/WnrlMQHKQeR+qOE6j28nFr1gfNAd82OnhrNNfTxpFzi z+VA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=l3HbWPlJ; 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 j26si12311064eds.343.2021.10.25.15.08.40; Mon, 25 Oct 2021 15:09:03 -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=@kernel.org header.s=k20201202 header.b=l3HbWPlJ; 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 S233696AbhJYTPK (ORCPT + 99 others); Mon, 25 Oct 2021 15:15:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:33638 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233083AbhJYTPJ (ORCPT ); Mon, 25 Oct 2021 15:15:09 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id DD66660EFE; Mon, 25 Oct 2021 19:12:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1635189166; bh=qcgqj6EL72dxtL9tgsfyof8wxelEwQ7EL8RNoufi/F4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=l3HbWPlJT8niZS63SsAawpBaDIkansLkf+kAYCGbQJaq70sXBITLP1EaPFrzT7Svw 7vCNszZr7jZcaC5jA8LwROGx8WCg+Yxpk/mU61ZEfv6vVcpu1Bsz3+4OkA5QtBIDXq eFPhyuYGqE1L6ZMbaOjYHJqek9HdmA5ryDjd3vRs9Yvq9QfjulFusqAOouhg+QSggF p2HVwEknLmpkuT2qfFKktXbJS2MJFAVu6Dh3QJxgAo8rnFesRN0KrYKmXWxABTVtq+ zOkoFU8mKBVk+vGUwrMQdrTorkIfalNwMIM6lNa285seFJRtLiJF1t7+ng9PznH6Ep 3UhNzzuJH6+uw== Date: Mon, 25 Oct 2021 22:12:42 +0300 From: Leon Romanovsky To: Jakub Kicinski Cc: Ido Schimmel , "David S . Miller" , Ido Schimmel , Jiri Pirko , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, syzbot+93d5accfaefceedf43c1@syzkaller.appspotmail.com Subject: Re: [PATCH net-next] netdevsim: Register and unregister devlink traps on probe/remove device Message-ID: References: <725e121f05362da4328dda08d5814211a0725dac.1635064599.git.leonro@nvidia.com> <20211025112453.089519e4@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211025112453.089519e4@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 25, 2021 at 11:24:53AM -0700, Jakub Kicinski wrote: > On Mon, 25 Oct 2021 11:08:00 +0300 Ido Schimmel wrote: > > No, it's not correct. After your patch, trap properties like action are > > not set back to the default. Regardless of what you think is the "right > > design", you cannot introduce such regressions. > > > > Calling devlink_*_unregister() in reload_down() and devlink_*_register() > > in reload_up() is not new. It is done for multiple objects (e.g., ports, > > regions, shared buffer, etc). After your patch, netdevsim is still doing > > it. > > If we want to push forward in the direction that Leon advocates we'd > have to unregister the devlink instance before reload_down(), right? Not really, we ensure that during "devlink reload", users can't send any get/set commands. So you don't need to unregister anything, because driver is safe to change any internal values it wants. The devlink instance is locked for exclusive access. The protection is done now by devlink_mutex, but will be slightly different in the near future. > > Otherwise it seems fundamentally incompatible with the idea of reload > for reconfig. And we'd be trading one partially correct model for > another partially correct model :/ I see devlink reload as command to reconfigure device and not devlink itself. This is the difference between my direction vs. mlxsw way. Thanks