Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp175333pxu; Tue, 6 Oct 2020 23:18:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzrDGlfX9dOtiRu1sZcCB2ffIaPk+cKSPfbEcZl3llLCAgWged6gTUyyZcnG051KCznGisV X-Received: by 2002:a50:f613:: with SMTP id c19mr1874753edn.81.1602051526453; Tue, 06 Oct 2020 23:18:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602051526; cv=none; d=google.com; s=arc-20160816; b=VCpE3lji8YdTTQWXBmNj1kpuCNjGp3KJZxJJUmjEZNO3YNDtLGBXqliFtzkkav3Yh2 oF6yA1TR+vR6J5IoVSQQVTjPJfg8HC3Bd0B97g5PdMOiyA9XhCTbhwuQwnSl8zXg7izl S0Kd38RDUehjafqohpG/vVkx+2x3EIuzRJKRAM5gooe6jT/4zeoppxAYOx14vpe+Me/1 laOdJc8T4Aa9tbyMC7NytKdqkIOTvG9W2NupdLp3F24n11IMlQ2bC6Nk+z+JVaHSjKNT Mk/JrujI+lyV55LdOzoukLnsFlTgoDwbFwajy+0EPKMVzF7cyOxfqHOWyXkUO+CzVQQe 2wSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=y7MfbWmcAi7cXQm+yQCWPA7NEd6QA55E/7xXWUjliTQ=; b=alva0FpqmpTIcDyYc3/iZxdon6sL5ZPmmlikfVD89tkBzSh7EXmsinxjBdid1K4Y/o Hr53dJOnoO3tZ6APMIXlOrDvrZyoQwA862MNKCdjiUT5POZUNCr+L8cLM5/w5tVmJblh 2AWYNHBT5l1F6eUHzd0Cjcta+bDpHXM7THiKizCmuKn644bVr2uVFdSF5LGZ+Y/sq15L f3YFy9SCxJldDBjNn9krq1/vjHDYOoHSGEsrXIoXzBa0igSIcattumALPKg8H7ISeWVK DOxq7AmpIay2sqwRA5gtR85lAwbFrGx8Hiac9xGgAX7TidlUr09rbk4m31IcLBbN0gUn glBA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=mellanox.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d17si832654edj.42.2020.10.06.23.18.23; Tue, 06 Oct 2020 23:18:46 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=mellanox.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727445AbgJGGOX (ORCPT + 99 others); Wed, 7 Oct 2020 02:14:23 -0400 Received: from mail-il-dmz.mellanox.com ([193.47.165.129]:37589 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727175AbgJGGON (ORCPT ); Wed, 7 Oct 2020 02:14:13 -0400 Received: from Internal Mail-Server by MTLPINE1 (envelope-from moshe@mellanox.com) with SMTP; 7 Oct 2020 09:14:08 +0300 Received: from dev-l-vrt-136.mtl.labs.mlnx (dev-l-vrt-136.mtl.labs.mlnx [10.234.136.1]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 09761IoS018916; Wed, 7 Oct 2020 09:01:18 +0300 Received: from dev-l-vrt-136.mtl.labs.mlnx (localhost [127.0.0.1]) by dev-l-vrt-136.mtl.labs.mlnx (8.14.7/8.14.7) with ESMTP id 09761IHG021796; Wed, 7 Oct 2020 09:01:18 +0300 Received: (from moshe@localhost) by dev-l-vrt-136.mtl.labs.mlnx (8.14.7/8.14.7/Submit) id 09761IWU021795; Wed, 7 Oct 2020 09:01:18 +0300 From: Moshe Shemesh To: "David S. Miller" , Jakub Kicinski , Jiri Pirko Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Moshe Shemesh Subject: [PATCH net-next v2 16/16] devlink: Add Documentation/networking/devlink/devlink-reload.rst Date: Wed, 7 Oct 2020 09:00:57 +0300 Message-Id: <1602050457-21700-17-git-send-email-moshe@mellanox.com> X-Mailer: git-send-email 1.8.4.3 In-Reply-To: <1602050457-21700-1-git-send-email-moshe@mellanox.com> References: <1602050457-21700-1-git-send-email-moshe@mellanox.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add devlink reload rst documentation file. Update index file to include it. Signed-off-by: Moshe Shemesh --- v1 -> v2: - Split first paragraph of devlink reload description to 2 sentences RFCv5 -> v1: - Rename reload_action_limit_level to reload_limit RFCv4 -> RFCv5: - Rephrase namespace change section - Rephrase note on actions performed RFCv3 -> RFCv4: - Remove reload action fw_activate_no_reset - Add reload actions limit levels and document the no_reset limit level constraints RFCv2 -> RFCv3: - Devlink reload returns the actions done - Replace fw_live_patch action by fw_activate_no_reset - Explain fw_activate meaning RFCv1 -> RFCv2: - 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 | 81 +++++++++++++++++++ Documentation/networking/devlink/index.rst | 1 + 2 files changed, 82 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..89a1b67e3af1 --- /dev/null +++ b/Documentation/networking/devlink/devlink-reload.rst @@ -0,0 +1,81 @@ +.. SPDX-License-Identifier: GPL-2.0 + +============== +Devlink Reload +============== + +``devlink-reload`` provides mechanism to reinit driver entities, applying +``devlink-params`` and ``devlink-resources`` new values. It also provides +mechanism to activate firmware. + +Reload Actions +============== + +User may select a reload action. +By default ``driver_reinit`` action is selected. + +.. list-table:: Possible reload actions + :widths: 5 90 + + * - Name + - Description + * - ``driver-reinit`` + - Devlink 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. Activates new firmware if such image is stored and + pending activation. If no limitation specified this action may involve + firmware reset. If no new image pending this action will reload current + firmware image. + +Note that even though user asks for a specific action, the driver +implementation might require to perform another action alongside with +it. For example, some driver do not support driver reinitialization +being performed without fw activation. Therefore, the devlink reload +command returns the list of actions which were actrually performed. + +Reload Limits +============= + +By default reload actions are not limited and driver implementation may +include reset or downtime as needed to perform the actions. + +However, some drivers support action limits, which limit the action +implementation to specific constraints. + +.. list-table:: Possible reload limits + :widths: 5 90 + + * - Name + - Description + * - ``no_reset`` + - No reset allowed, no down time allowed, no link flap and no + configuration is lost. + +Change Namespace +================ + +The netns option allows user to be able to move devlink instances into +namespaces during devlink reload operation. +By default all devlink instances are created in init_net and stay there. + +example usage +------------- + +.. code:: shell + + $ devlink dev reload help + $ devlink dev reload DEV [ netns { PID | NAME | ID } ] [ action { driver_reinit | fw_activate } ] [ limit no_reset ] + + # Run reload command for devlink driver entities re-initialization: + $ devlink dev reload pci/0000:82:00.0 action driver_reinit + reload_actions_performed: + driver_reinit + + # Run reload command to activate firmware: + # Note that mlx5 driver reloads the driver while activating firmware + $ devlink dev reload pci/0000:82:00.0 action fw_activate + reload_actions_performed: + driver_reinit 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.18.2