Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp3355131pxa; Tue, 18 Aug 2020 13:08:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy0hoOWRv9Sl110D1dHnee7fdnzeuxheoJLdgL6PjuugdEk/UZtJPsuewgoH0dmQChq4H7n X-Received: by 2002:a17:906:dbd8:: with SMTP id yc24mr946547ejb.176.1597781280267; Tue, 18 Aug 2020 13:08:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597781280; cv=none; d=google.com; s=arc-20160816; b=jE5Q63+mSEopcxOireggkakGA9V0MW+R90cXm+w0FRO21b9hTSn+VyycMWoUhDMMN9 Cv0gTa62Is7wuxTvQPH3VlclwveR1ERXuYoTqzP0PAMA7nhA6HF10nte0yqFLq3siebw 4dBS4lJQwpVuizemF2Nco0Q+sHdSzeQiZHwe28Qjy7MH5IGxoWeahxYtTw6OmekE+env 7b99MZTFvMF8+aGEfuUhf6a3moDTDm2gj9mZvJqvnJtxFwTrxXrdkwYfqasT6/2GNVoR x1OBiBRiCZOcn0jrF6/YMCfJktmtqMlxcKPHFy7XmTB3eAW8w31BxSiKkAz32nNeDVeC /JKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=87WgvtCpgCVwtxhzzwkf4l93Jvr5+jYvHLULFM6BC8s=; b=NIk+BRIqZSuADyUTTvv0oPJb24F+icisAmgcIy9F5DzwqyA2xcJhjv5q4oJ16ialVt L4107GD7QaJAVif/ZBonkwiVHK2Z5jVczCQX6M3cVlEfKqo/tqDXwq9htySOlW0UJNML nBO8vCSmbiWFVvui2fB+7/YOYX4uZN95TFuBhgtoMIhpsuzGDGgvNQdsTvK05d8RU/yB B/nD4xUim4q0P11JiXGNWbaTZirA6DpCBrNRXpO2l8hkMVxNCCts5pDS8tAl2beZe8Qj YVT10f1g1an3NiAiXHk7CRTT2+D3IVNIq7ORe+VDVNskx5LBEeipk7Y4sPhinAhIBTyk BB9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b="SC/oaeYg"; 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=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f1si14309194edx.135.2020.08.18.13.07.35; Tue, 18 Aug 2020 13:08:00 -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=@nvidia.com header.s=n1 header.b="SC/oaeYg"; 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=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726751AbgHRUEX (ORCPT + 99 others); Tue, 18 Aug 2020 16:04:23 -0400 Received: from hqnvemgate26.nvidia.com ([216.228.121.65]:11908 "EHLO hqnvemgate26.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726676AbgHRUEW (ORCPT ); Tue, 18 Aug 2020 16:04:22 -0400 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate26.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Tue, 18 Aug 2020 13:04:05 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Tue, 18 Aug 2020 13:04:19 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Tue, 18 Aug 2020 13:04:19 -0700 Received: from [10.21.180.121] (10.124.1.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Tue, 18 Aug 2020 20:04:11 +0000 Subject: Re: [PATCH net-next RFC v2 13/13] devlink: Add Documentation/networking/devlink/devlink-reload.rst To: Jiri Pirko CC: Moshe Shemesh , "David S. Miller" , Jakub Kicinski , Jiri Pirko , , References: <1597657072-3130-1-git-send-email-moshe@mellanox.com> <1597657072-3130-14-git-send-email-moshe@mellanox.com> <20200817163933.GB2627@nanopsycho> <20200818110740.GC2627@nanopsycho> From: Moshe Shemesh Message-ID: <1599b919-4e74-0352-bf47-cc0d39c5d3a6@nvidia.com> Date: Tue, 18 Aug 2020 23:04:07 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <20200818110740.GC2627@nanopsycho> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL111.nvidia.com (172.20.187.18) To HQMAIL107.nvidia.com (172.20.187.13) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1597781045; bh=87WgvtCpgCVwtxhzzwkf4l93Jvr5+jYvHLULFM6BC8s=; h=X-PGP-Universal:Subject:To:CC:References:From:Message-ID:Date: User-Agent:MIME-Version:In-Reply-To:Content-Type: Content-Transfer-Encoding:Content-Language:X-Originating-IP: X-ClientProxiedBy; b=SC/oaeYg1SgoFcn1VdycMFdI7So/ljV5lj6i0ylHW1cvAiDnMJQTaYEjreDz3mdGB U/fClCt/fduNfNXnaOmWdcaerdQ0+aiGUGpF9tJF6QeHtLJeWBGK8Gnv0mPwpwBCL6 +gbnN2CWwhNSSTHnzJVTDyN4+kPx30ZM74CY/dE4SBN4qjpiirMdnS5b/5KT1xOwLZ hf8iYvCQk+2md2ywDfGcWvNf4W7NY8fouLgp5b+XJtYrpXCGNYuhTZ6m1Z9o/IdE1s h5xS+K8ITgPlV5nFq9foZQ7ZvVaIqUVd+an7hVmwEq5NYPIzYdzHZFY1SFBB6Yj9lm 3mRzayZnVJcJw== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/18/2020 2:07 PM, Jiri Pirko wrote: > Tue, Aug 18, 2020 at 11:14:16AM CEST, moshe@nvidia.com wrote: >> On 8/17/2020 7:39 PM, Jiri Pirko wrote: >>> Mon, Aug 17, 2020 at 11:37:52AM CEST, moshe@mellanox.com wrote: >>>> Add devlink reload rst documentation file. >>>> Update index file to include it. >>>> >>>> Signed-off-by: Moshe Shemesh >>>> --- >>>> - Instead of reload levels driver,fw_reset,fw_live_patch have reload >>>> actions driver_reinit,fw_activate,fw_live_patch >>>> --- >>>> .../networking/devlink/devlink-reload.rst | 54 +++++++++++++++++++ >>>> Documentation/networking/devlink/index.rst | 1 + >>>> 2 files changed, 55 insertions(+) >>>> create mode 100644 Documentation/networking/devlink/devlink-reload.rst >>>> >>>> diff --git a/Documentation/networking/devlink/devlink-reload.rst b/Documentation/networking/devlink/devlink-reload.rst >>>> new file mode 100644 >>>> index 000000000000..9846ea727f3b >>>> --- /dev/null >>>> +++ b/Documentation/networking/devlink/devlink-reload.rst >>>> @@ -0,0 +1,54 @@ >>>> +.. SPDX-License-Identifier: GPL-2.0 >>>> + >>>> +============== >>>> +Devlink Reload >>>> +============== >>>> + >>>> +``devlink-reload`` provides mechanism to either reload driver entities, >>>> +applying ``devlink-params`` and ``devlink-resources`` new values or firmware >>>> +activation depends on reload action selected. >>>> + >>>> +Reload actions >>>> +============= >>>> + >>>> +User may select a reload action. >>>> +By default ``driver_reinit`` action is done. >>>> + >>>> +.. list-table:: Possible reload actions >>>> + :widths: 5 90 >>>> + >>>> + * - Name >>>> + - Description >>>> + * - ``driver-reinit`` >>>> + - Driver entities re-initialization, including applying >>>> + new values to devlink entities which are used during driver >>>> + load such as ``devlink-params`` in configuration mode >>>> + ``driverinit`` or ``devlink-resources`` >>>> + * - ``fw_activate`` >>>> + - Firmware activate. Can be used for firmware reload or firmware >>>> + upgrade if new firmware is stored and driver supports such >>>> + firmware upgrade. >>> Does this do the same as "driver-reinit" + fw activation? If yes, it >>> should be written here. If no, it should be written here as well. >>> >> No, The only thing required here is the action of firmware activation. If a >> driver needs to do reload to make that happen and do reinit that's ok, but >> not required. > What does the "FW activation" mean? I believe that this needs explicit > documentation here. > I will add it explicitly. FW activation means FW upgrade if new image is pending activation. If no FW image pending, it reloads the current FW. >>>> + * - ``fw_live_patch`` >>>> + - Firmware live patch, applies firmware changes without reset. >>>> + >>>> +Change namespace >>>> +================ >>>> + >>>> +All devlink instances are created in init_net and stay there for a >>>> +lifetime. Allow user to be able to move devlink instances into >>>> +namespaces during devlink reload operation. That ensures proper >>>> +re-instantiation of driver objects, including netdevices. >>>> + >>>> +example usage >>>> +------------- >>>> + >>>> +.. code:: shell >>>> + >>>> + $ devlink dev reload help >>>> + $ devlink dev reload DEV [ netns { PID | NAME | ID } ] [ action { fw_live_patch | driver_reinit | fw_activate } ] >>>> + >>>> + # Run reload command for devlink driver entities re-initialization: >>>> + $ devlink dev reload pci/0000:82:00.0 action driver_reinit >>>> + >>>> + # Run reload command to activate firmware: >>>> + $ devlink dev reload pci/0000:82:00.0 action fw_activate >>>> diff --git a/Documentation/networking/devlink/index.rst b/Documentation/networking/devlink/index.rst >>>> index 7684ae5c4a4a..d82874760ae2 100644 >>>> --- a/Documentation/networking/devlink/index.rst >>>> +++ b/Documentation/networking/devlink/index.rst >>>> @@ -20,6 +20,7 @@ general. >>>> devlink-params >>>> devlink-region >>>> devlink-resource >>>> + devlink-reload >>>> devlink-trap >>>> >>>> Driver-specific documentation >>>> -- >>>> 2.17.1 >>>>