Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2167548pxa; Mon, 17 Aug 2020 02:43:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz+HzjNhEnuAxeH4fbdmbv9Xz9ahaDBHRR1Iq+yvUm9Bl5ITxP0rpipNqLozRslVYNB9kRE X-Received: by 2002:a17:906:4157:: with SMTP id l23mr14027561ejk.491.1597657422379; Mon, 17 Aug 2020 02:43:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597657422; cv=none; d=google.com; s=arc-20160816; b=tPu51BpGi3/L70ErEWg/rI+z7jSLitlyntxpRa958AvHPc92tSbZe29sDyQasyHT2N wC0nEdmh8F5w9D/RFI9Sh2QmT2ljB2jK6wLgwmbZzKD/oSL+aSzroDTvrl5+SiFnLjeT zakM4YYK8DkD7KMEdoTpcQJafjY15stwfJZOMBBugd8FAI7qGQDPPxjlatACgz5wGFSC W/GgRlhvq6Vx2WCmynNk5SOZZ8FTNPBserQABMdmX8vYd7V1AkBH2SsoHLObn8GEh8pH 8y8WKYqKk2RyIx5/IvcpnsyG3XIsDxz7FKseZKlRlPRCUukcgDYdWLz1q9LBzmiZEU6I pM3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=pXiUYZQK45sMSvVp3TQ0QegkpJBXo4tpp/iYVQYxYzA=; b=bOLyrIIzj0ooa7cx8knP4v7T0wTYQ2a42PuDQNgQQRbXLNR3a9CoadYvIljsg06+kP p8cARL7Z+n4wlvH5z3iNcDC3urU3H2Q/ximtQhhAbO1UnMFdvj13/2orfeIDxE6ELXVD tf5A4gE/yp0rbIuurVTpUYnDzkKoMura/KczZpUp5ceZ9Ggm6R0PEFDRkwKVlDtcMguP 1ay5QHnd/604jm2cxmzo3OUwi6EbPCLuvYOgAzSjlX43M5N6tB1gZf9sIeE25gEUfBRC mUl2CqY4CcBCt6+13IutFv0z4W2wdLJBjUGW05N8DJQHaM0wZ6jzEf6o6mDLiYNcswgJ N9ZA== 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 z13si10457534eja.704.2020.08.17.02.43.19; Mon, 17 Aug 2020 02:43:42 -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 S1726728AbgHQJjm (ORCPT + 99 others); Mon, 17 Aug 2020 05:39:42 -0400 Received: from mail-il-dmz.mellanox.com ([193.47.165.129]:55829 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728395AbgHQJiS (ORCPT ); Mon, 17 Aug 2020 05:38:18 -0400 Received: from Internal Mail-Server by MTLPINE1 (envelope-from moshe@mellanox.com) with SMTP; 17 Aug 2020 12:38:11 +0300 Received: from dev-l-vrt-135.mtl.labs.mlnx (dev-l-vrt-135.mtl.labs.mlnx [10.234.135.1]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 07H9cBsk011397; Mon, 17 Aug 2020 12:38:11 +0300 Received: from dev-l-vrt-135.mtl.labs.mlnx (localhost [127.0.0.1]) by dev-l-vrt-135.mtl.labs.mlnx (8.15.2/8.15.2/Debian-10) with ESMTP id 07H9cBcc003224; Mon, 17 Aug 2020 12:38:11 +0300 Received: (from moshe@localhost) by dev-l-vrt-135.mtl.labs.mlnx (8.15.2/8.15.2/Submit) id 07H9c8eu003223; Mon, 17 Aug 2020 12:38:08 +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 RFC v2 00/13] Add devlink reload action option Date: Mon, 17 Aug 2020 12:37:39 +0300 Message-Id: <1597657072-3130-1-git-send-email-moshe@mellanox.com> X-Mailer: git-send-email 1.8.4.3 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Introduce new option on devlink reload API to enable the user to select the reload action required. Complete support for all actions in mlx5. The following reload actions are supported: fw_live_patch: firmware live patching. driver_reinit: driver entities re-initialization, applying devlink-params and devlink-resources values. fw_activate: firmware activate. Each driver which support this command should expose the reload actions supported. The uAPI is backward compatible, if the reload action option is omitted from the reload command, the driver reinit action will be used. Note that when required to do firmware activation some drivers may need to reload the driver. On the other hand some drivers may need to reset the firmware to reinitialize the driver entities. Patch 1 adds the new API reload action option to devlink. Patch 2 exposes the supported reload actions on devlink dev get. Patches 3-8 add support on mlx5 for devlink reload action fw_activate and handle the firmware reset events. Patches 9-10 add devlink enable remote dev reset parameter and use it in mlx5. Patches 11-12 mlx5 add devlink reload live patch support and event handling. Patch 13 adds documentation file devlink-reload.rst Command examples: # Run reload command with fw activate reload action: $ devlink dev reload pci/0000:82:00.0 action fw_activate # Run reload command with driver reload action: $ devlink dev reload pci/0000:82:00.0 action driver_reinit # Run reload command with fw live patch reload action: $ devlink dev reload pci/0000:82:00.0 action fw_live_patch v1 -> v2: - Instead of reload levels driver,fw_reset,fw_live_patch have reload actions driver_reinit,fw_activate,fw_live_patch - Remove driver default level, the action driver_reinit is the default action for all drivers Moshe Shemesh (13): devlink: Add reload action option to devlink reload command devlink: Add supported reload actions to dev get net/mlx5: Add functions to set/query MFRL register net/mlx5: Set cap for pci sync for fw update event net/mlx5: Handle sync reset request event net/mlx5: Handle sync reset now event net/mlx5: Handle sync reset abort event net/mlx5: Add support for devlink reload action fw activate devlink: Add enable_remote_dev_reset generic parameter net/mlx5: Add devlink param enable_remote_dev_reset support net/mlx5: Add support for fw live patch event net/mlx5: Add support for devlink reload action live patch devlink: Add Documentation/networking/devlink/devlink-reload.rst .../networking/devlink/devlink-params.rst | 6 + .../networking/devlink/devlink-reload.rst | 54 +++ Documentation/networking/devlink/index.rst | 1 + drivers/net/ethernet/mellanox/mlx4/main.c | 4 +- .../net/ethernet/mellanox/mlx5/core/Makefile | 2 +- .../net/ethernet/mellanox/mlx5/core/devlink.c | 104 +++- .../mellanox/mlx5/core/diag/fw_tracer.c | 31 ++ .../mellanox/mlx5/core/diag/fw_tracer.h | 1 + .../ethernet/mellanox/mlx5/core/fw_reset.c | 448 ++++++++++++++++++ .../ethernet/mellanox/mlx5/core/fw_reset.h | 19 + .../net/ethernet/mellanox/mlx5/core/health.c | 35 +- .../net/ethernet/mellanox/mlx5/core/main.c | 13 + .../ethernet/mellanox/mlx5/core/mlx5_core.h | 2 + drivers/net/ethernet/mellanox/mlxsw/core.c | 6 +- drivers/net/netdevsim/dev.c | 5 +- include/linux/mlx5/device.h | 1 + include/linux/mlx5/driver.h | 4 + include/net/devlink.h | 9 +- include/uapi/linux/devlink.h | 20 + net/core/devlink.c | 84 +++- 20 files changed, 812 insertions(+), 37 deletions(-) create mode 100644 Documentation/networking/devlink/devlink-reload.rst create mode 100644 drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c create mode 100644 drivers/net/ethernet/mellanox/mlx5/core/fw_reset.h -- 2.17.1