Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1317256pxk; Fri, 18 Sep 2020 09:15:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw5L/90HvoPD3WWC3Gnb1irh7m60EI0YZnzSdHtr1/fQLeYiwCF44hBL3UkllFr9RbIZz1A X-Received: by 2002:a17:906:a251:: with SMTP id bi17mr35897866ejb.526.1600445714501; Fri, 18 Sep 2020 09:15:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600445714; cv=none; d=google.com; s=arc-20160816; b=yQ6rVr5hsGq+XkIQx73WMq76nMKLwoi0O6gYZMzPJSey2pgMWPXlmAUhb1Ilrgw7+I 7ogpUXymL4AhcN5OtY+tKnOfOLA8NYilKI3NSgeJv9wpsTWXI20zX8ur6TrSVgEMdFgQ yGIkp2fP5UvDcSZan+HGFNAcsnraN3Q8VlnHjoKOYIUmCigE5KmNiDbQ8Qtaf+NO+JYc iJDdWY9eHgyn02CrOg0fLOIrDk1ar6PfiiLflnJCKhzTP4jqqMn4/jnKIkttWksSMJU6 X/LGleyOxebUNwM7cW+xCcfVG4x0+hRos9JD+HuxX6wlG+DVucVr9lOioEto/tXJSyIY YNUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=qgbhJtSzq1MK7uae2Rf3UgmGXCdHHKf64qze333m4Ko=; b=ynEUseG0NktWWqDPtIyfKEB/dpQddNnPcAWuwBq7Fyr3m5H8f7xlACORTFYeFQAJrO KCHVdB0XhqxTn+H2LMTPU2QMeicIBTUM4c16FseTV3hZOYmdtCirkvmaFGfXDbzc/3lC L4TPTwCrlvmmYMETkRiAO8johevnBAVEkNBRdS9+nRBUmvi4vmFDLXoW9L4Vs4MgYMBs ijuJL+v8pK+Y8LzjNQhbY7gZ33EZbLC/dbpjGKcPgRnylIP2RZpQ6FBHPqAFDyQ5xHUB R5xhnVfr+N86ukHftnbnrzkVyWfuCGuLCFw0qRtSSdboCakFY0kBTiHqx1QiyiPaReo8 wNMQ== 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 u18si2480088ejf.75.2020.09.18.09.14.51; Fri, 18 Sep 2020 09:15:14 -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 S1726335AbgIRQNw (ORCPT + 99 others); Fri, 18 Sep 2020 12:13:52 -0400 Received: from mail-il-dmz.mellanox.com ([193.47.165.129]:55233 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726307AbgIRQNv (ORCPT ); Fri, 18 Sep 2020 12:13:51 -0400 Received: from Internal Mail-Server by MTLPINE1 (envelope-from moshe@mellanox.com) with SMTP; 18 Sep 2020 19:07:08 +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 08IG78X1025125; Fri, 18 Sep 2020 19:07:08 +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 08IG78V9031146; Fri, 18 Sep 2020 19:07:08 +0300 Received: (from moshe@localhost) by dev-l-vrt-135.mtl.labs.mlnx (8.15.2/8.15.2/Submit) id 08IG752t031143; Fri, 18 Sep 2020 19:07:05 +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 v5 00/15] Add devlink reload action and limit level options Date: Fri, 18 Sep 2020 19:06:36 +0300 Message-Id: <1600445211-31078-1-git-send-email-moshe@mellanox.com> X-Mailer: git-send-email 1.8.4.3 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Introduce new options on devlink reload API to enable the user to select the reload action required and contrains limits on these actions that he may want to ensure. Complete support for reload actions in mlx5. The following reload actions are supported: driver_reinit: driver entities re-initialization, applying devlink-param and devlink-resource values. fw_activate: firmware activate. 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. Therefore, the devlink reload command returns the actions which were actually performed. By default reload actions are not limited and driver implementation may include reset or downtime as needed to perform the actions. However, if limit_level is selected, the driver should perform only if it can do it while keeping the limit level constrains. Reload action limit level added: no_reset: No reset allowed, no down time allowed, no link flap and no configuration is lost. Each driver which supports devlink reload command should expose the reload actions and limit levels supported. Add reload action stats to hold the history per reload action per limit level. For example, the number of times fw_activate has been done on this device since the driver module was added or if the firmware activation was done with or without reset. Patch 1-2 add the new API reload action and reload action limit level option to devlink reload. Patch 3 adds reload actions stats. Patch 4 exposes the reload actions stats on devlink dev get. Patches 5-10 add support on mlx5 for devlink reload action fw_activate and handle the firmware reset events. Patches 11-12 add devlink enable remote dev reset parameter and use it in mlx5. Patches 13-14 mlx5 add devlink reload action limit level no_reset support for fw_activate reload action. Patch 15 adds documentation file devlink-reload.rst Moshe Shemesh (15): devlink: Add reload action option to devlink reload command devlink: Add reload action limit level devlink: Add reload action stats devlink: Add reload actions stats 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 limit level no reset devlink: Add Documentation/networking/devlink/devlink-reload.rst .../networking/devlink/devlink-params.rst | 6 + .../networking/devlink/devlink-reload.rst | 79 +++ Documentation/networking/devlink/index.rst | 1 + drivers/net/ethernet/mellanox/mlx4/main.c | 16 +- .../net/ethernet/mellanox/mlx5/core/Makefile | 2 +- .../net/ethernet/mellanox/mlx5/core/devlink.c | 122 ++++- .../mellanox/mlx5/core/diag/fw_tracer.c | 31 ++ .../mellanox/mlx5/core/diag/fw_tracer.h | 1 + .../ethernet/mellanox/mlx5/core/fw_reset.c | 454 ++++++++++++++++++ .../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 | 27 +- drivers/net/netdevsim/dev.c | 17 +- include/linux/mlx5/device.h | 1 + include/linux/mlx5/driver.h | 4 + include/net/devlink.h | 21 +- include/uapi/linux/devlink.h | 41 ++ net/core/devlink.c | 339 ++++++++++++- 20 files changed, 1179 insertions(+), 52 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