Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp572161ybg; Tue, 28 Jul 2020 13:07:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw6F7fw++QsZwG4D4b9XEdgT5G7CoOugw//LI9cGwwLri7aFXT0Nhh9E5Nn3WfwnrwSxSFz X-Received: by 2002:a17:906:c056:: with SMTP id bm22mr27955401ejb.444.1595966843911; Tue, 28 Jul 2020 13:07:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595966843; cv=none; d=google.com; s=arc-20160816; b=RRS+7KGqwp/+tGi9F9a6rj2HRh1RFRQkISQ8j+qbPtFaA3Bj7AtIIsW55r5vAOW0eC a7h8L3KjfWHhLkMkgMR9woZMKetUMaftlf4+KJJk0clhqYegZBeRbkmkxcX5SVevORIA l1nekYKbZ7kWIg1W/JVx3rz0CI3xuTLW8iNVTdfnlA0MCMNPWDmFTw4DEDFZMKtsaKmX zMz0nRoFkKTKkj37hf2THBE0t9ON4NYfJRMDmtwO7ePdV4fMFUsRBmcBAmJTfpNDfwxX ClKghz5XHCuCmxRRzhQFB7nZVwXJoHNyyRWzTeP8Ajg5bE0hVl0YAKtQeH48gaVTdHVC UxSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=MmtASJZoV1C+/sTJlmWHj/uESRzRL41epahFK6fUstM=; b=NUpu5y4nPXnmjZXWLp35C7AFlvyCbwpFEvprY/5PDg6ZteBTe9tAzXN08PhGyWNM/h 3U2K0124z5SFkst8UGl+q8KDmEHX2B9JGWB44I7PW67mw5rWqGHwPouhEshIVtJhSJ2L xnVIFHEDg0L4o3M1VlxyYHLL55TZ/9d/70uPgLUWvwhGrS26xW/ZRz4+gTLEBdfFH783 VBYn16w6E58CObtFDCy9Tu/fzqFbAw9SptDJk5ubHffNUurdVJJ3OiV0OJqemEPaJkUA rz2Wv8jL5P/MM/gRgi1F1wxW7XooFLiIPQ9NHgIKP4G0eVlIjRtIx6ZEGU8SNxNJj6si 0Q1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=X2yu3iDa; 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 b23si4605529edy.72.2020.07.28.13.07.01; Tue, 28 Jul 2020 13:07:23 -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=default header.b=X2yu3iDa; 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 S1728253AbgG1UG5 (ORCPT + 99 others); Tue, 28 Jul 2020 16:06:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:43332 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728053AbgG1UG4 (ORCPT ); Tue, 28 Jul 2020 16:06:56 -0400 Received: from kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com (unknown [163.114.132.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A6A7820656; Tue, 28 Jul 2020 20:06:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595966816; bh=sYKqOmMNs+3IuJX+AIxjd9QENNEFZ6DotksaWOwUFJw=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=X2yu3iDa12nwXWYvQqNcQCax4XbNVXFFzr803PPOWcQECw2MNU1xec48umfhQEc79 r9UK7Ra6T1kkJGTufPFpnLnfoJkosrvgccL2z6taFM5+S9RvLVN0h5CI2RWkEbf8cN l+NFSvzdhCbp0SkpZg5epUKuY5D2kclSVl9tUmCU= Date: Tue, 28 Jul 2020 13:06:53 -0700 From: Jakub Kicinski To: Jacob Keller Cc: Jiri Pirko , Moshe Shemesh , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, "David S. Miller" , Jiri Pirko , Vasundhara Volam Subject: Re: [PATCH net-next RFC 01/13] devlink: Add reload level option to devlink reload command Message-ID: <20200728130653.7ce2f013@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> In-Reply-To: References: <1595847753-2234-1-git-send-email-moshe@mellanox.com> <1595847753-2234-2-git-send-email-moshe@mellanox.com> <20200727175802.04890dd3@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> <20200728135808.GC2207@nanopsycho> <464add44-3ab1-21b8-3dba-a88202350bb9@intel.com> <20200728114458.762b5396@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 28 Jul 2020 12:18:30 -0700 Jacob Keller wrote: > On 7/28/2020 11:44 AM, Jakub Kicinski wrote: > > From user perspective what's important is what the reset achieves (and > > perhaps how destructive it is). We can define the reset levels as: > > > > $ devlink dev reload pci/0000:82:00.0 net-ns-respawn > > $ devlink dev reload pci/0000:82:00.0 driver-param-init > > $ devlink dev reload pci/0000:82:00.0 fw-activate > > > > combining should be possible when user wants multiple things to happen: > > > > $ devlink dev reload pci/0000:82:00.0 fw-activate driver-param-init > > Where today "driver-param-init" is the default behavior. But didn't we > just say that mlxsw also does the equivalent of fw-activate? Actually the default should probably be the combination of driver-param-init and net-ns-respawn. My expectations would be that the driver must perform the lowest reset level possible that satisfies the requested functional change. IOW driver may do more, in fact it should be acceptable for the driver to always for a full HW reset (unless --live or other constraint is specified). > > We can also add the "reset level" specifier - for the cases where > > device is misbehaving: > > > > $ devlink dev reload pci/0000:82:00.0 level [driver|fw|hardware] > > I guess I don't quite see how level fits in? This is orthogonal to the > other settings? Yup, it is, it's already orthogonal to what reload does today, hence the need for the "driver default" hack. > > But I don't think that we can go from the current reload command > > cleanly to just a level reset. The driver-specific default is a bad > > smell which indicates we're changing semantics from what user wants > > to what the reset depth is. Our semantics with the patch as it stands > > are in fact: > > - if you want to load new params or change netns, don't pass the level > > - the "driver default" workaround dictates the right reset level for > > param init; > > - if you want to activate new firmware - select the reset level you'd > > like from the reset level options. > > > > I think I agree, having the "what gets reloaded" as a separate vector > makes sense and avoids confusion. For example for ice hardware, > "fw-activate" really does mean "Do an EMP reset" rather than just a > "device reset" which could be interpreted differently. ice can do > function level reset, or core device reset also. Neither of those two > resets activates firmware. > > Additionally the current function load process in ice doesn't support > driver-init at all. That's something I'd like to see happen but is quite > a significant refactor for how the driver loads. We need to refactor > everything out so that devlink is created early on and factor out > load/unload into handlers that can be called by the devlink reload. As I > have primarily been focused on flash update I sort of left that for the > future because it was a huge task to solve. Cool! That was what I was concerned about, but I didn't know any existing driver already has the problem. "FW reset" is not nearly a clear enough operation. We'd end up with drivers differing and users having to refer to vendor documentation to find out which "reset level" maps to what. I think the components in ethtool-reset try to address the same problem, and they have the notion of per-port, and per-device. In the modern world we lack the per-host notion, but that's still strictly clearer than the limited API proposed here.