Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1989621ybt; Thu, 2 Jul 2020 20:28:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwO2vBxcSNP8ov78GF6yeucyZkCv8zIhiBX2nZT65XavJ9DnHMBX3tU0kmjyTCjvQxXhhlE X-Received: by 2002:a17:906:3a04:: with SMTP id z4mr24387841eje.441.1593746930884; Thu, 02 Jul 2020 20:28:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593746930; cv=none; d=google.com; s=arc-20160816; b=CqYGFEvtToweo1IZBDaQrAQEVMkgnyjHfCywiJNnhOUGlT+uJIvu+X2zMAfm0rHdP7 va5A6ZUjh47+vywW9uEdTpOvLQ6PSiD4s0nTPZQptR+Y1xNva2tUtetPwQph60Gwu532 MRqGUAX6a4HTdd8nbNE5Yyy7LWRxBal3fqnACZPqofG5/eztArvBVMCInhULBOLoDMbU bOf6A9Bk5pt86B+pAi6ANx4Q/Lo6E8MH7Y45lpKwibyIBXutoLeVUVOMqXEumlxB2mJa vvO/PRhAoYjUh0bEEj+h8h+gQpQsw2hgCDyNGa6r8ZBgmI6X9tMxSiFqisj9yNj9m+8O zj7g== 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=pUKEwzDc0HSf3N5R6C0jJ+BGsYdJyeu/a3d+MGsa8QM=; b=s00suuhDn0RLKfsHna1EeEMQYNH1I999wYZqtUwyixGydJ8t9NAGPb6nctKRiubYKZ eNLavBNt92+xHP35HmaFOJQzO109mc2DCAAhG07ymm9P/rUB82nSVz+pGheEGRIefCd8 alxfBcEdCRQn1vY1Y7aNz1zXr6hHmUmWrqTKFAItMYA+50Fg+Bdmh5sWyC+7hMmaEtJI 68I6KE7C+PThpirVUKHe9UPFDbnNJa93HdxUHvQqBSnVlFYUUmaGCwrereMTtrMPTm+o rcQAYiS6wHK1dlb75tL1YX4aK/G0R3l/zLAdUxlm+fcoa+BP6hXcmXYsVgPLUK88i7w1 cKOg== 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 i8si6952578edv.172.2020.07.02.20.28.26; Thu, 02 Jul 2020 20:28:50 -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 S1726082AbgGCD2R (ORCPT + 99 others); Thu, 2 Jul 2020 23:28:17 -0400 Received: from mail-il-dmz.mellanox.com ([193.47.165.129]:33582 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725937AbgGCD2R (ORCPT ); Thu, 2 Jul 2020 23:28:17 -0400 Received: from Internal Mail-Server by MTLPINE1 (envelope-from moshe@mellanox.com) with SMTP; 3 Jul 2020 06:28:14 +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 0633SEnp006777; Fri, 3 Jul 2020 06:28:14 +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 0633SEk3006654; Fri, 3 Jul 2020 06:28:14 +0300 Received: (from moshe@localhost) by dev-l-vrt-136.mtl.labs.mlnx (8.14.7/8.14.7/Submit) id 0633SEDZ006653; Fri, 3 Jul 2020 06:28:14 +0300 From: Moshe Shemesh To: "David S. Miller" Cc: Jiri Pirko , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Moshe Shemesh Subject: [PATCH net-next v2 0/7] Add devlink-health support for devlink ports Date: Fri, 3 Jul 2020 06:27:31 +0300 Message-Id: <1593746858-6548-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 Implement support for devlink health reporters on per-port basis. First part in the series prepares common functions parts for health reporter implementation. Second introduces required API to devlink-health and mlx5e ones demonstrate its usage and effectively implement the feature for mlx5 driver. The per-port reporter functionality is achieved by adding a list of devlink_health_reporters to devlink_port struct in a manner similar to existing device infrastructure. This is the only major difference and it makes possible to fully reuse device reporters operations. The effect will be seen in conjunction with iproute2 additions and will affect all devlink health commands. User can distinguish between device and port reporters by looking at a devlink handle. Port reporters have a port index at the end of the address and such addresses can be provided as a parameter in every place where devlink-health accepted it. These can be obtained from devlink port show command. For example: $ devlink health show pci/0000:00:0a.0: reporter fw state healthy error 0 recover 0 auto_dump true pci/0000:00:0a.0/1: reporter tx state healthy error 0 recover 0 grace_period 500 auto_recover true auto_dump true $ devlink health set pci/0000:00:0a.0/1 reporter tx grace_period 1000 \ auto_recover false auto_dump false $ devlink health show pci/0000:00:0a.0/1 reporter tx pci/0000:00:0a.0/1: reporter tx state healthy error 0 recover 0 grace_period 1000 auto_recover flase auto_dump false Changes v1 -> v2: Fixed functions comment to match parameters list. Vladyslav Tarasiuk (7): devlink: Refactor devlink health reporter constructor devlink: Rework devlink health reporter destructor devlink: Create generic devlink health reporter search function devlink: Implement devlink health reporters on per-port basis devlink: Add devlink health port reporters API net/mlx5e: Move devlink port register and unregister calls net/mlx5e: Move devlink-health rx and tx reporters to devlink port .../ethernet/mellanox/mlx5/core/en/reporter_rx.c | 9 +- .../ethernet/mellanox/mlx5/core/en/reporter_tx.c | 13 +- drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 15 +- include/net/devlink.h | 11 + net/core/devlink.c | 244 ++++++++++++++++----- 5 files changed, 216 insertions(+), 76 deletions(-) -- 1.8.3.1