Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1609849ybl; Sun, 19 Jan 2020 07:05:54 -0800 (PST) X-Google-Smtp-Source: APXvYqw3lo+PgBGXlgAuFCE/gUWBwng+PB57MDdHOB7lqmX2Am8WCDd+Cmqqo5DwYpUD13skzINR X-Received: by 2002:aca:be57:: with SMTP id o84mr10221487oif.138.1579446354762; Sun, 19 Jan 2020 07:05:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579446354; cv=none; d=google.com; s=arc-20160816; b=XAW1QjoI00Ytal7TzAtGMV6AIBEac8xxcUz8iha9Z/cXSO2mFUJ7XYWRtsOO64RExl yYRFARy+rFqSY5L62eGnK+EvC5wQ3UUEwqtkDIqoDiIxd/10bhIXBnjgg3hPuNCsJ5qD 8W39MC1Sp2z0XW4Msw/b4dG+PQgV+ezFMCT6dfKm+p3ZTB68kbsqvvTWWGI+puatNFRm 1x4XWTotoyrttEISGD+m184LdcWKbQlXMNvajMKjDveLiRuf/d6KUmTxQ8JSC4fbRZ2M 7fHwK/QSg61DUZPYAZfPeynvJw8oEx3Njv9qA9rYweY7dVsSrQeQ8F8NLAEE/mMGT9eh gt3A== 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=7ZX01BztoG6eKrc/KQyLrGtoHl/0M8lJIc0+bMhDuoQ=; b=U9DRsbqJ/eP8Ye3ZEhRLJMyZw/DWrqdNxKHHYRy9jdSBVSxbcNM/Nb1OIhyrd6etrC WEpLbCGJt+WH8p95FnQy5hh6z7Op+t89mgp++44/q0Wra/kjfBAeEy/8SbuauMqJU8eo CNlqt5pnetIUaPWAkzNeptmrrIRUz5yARZZMbXM7t+5xtRjUWKmnEHcIzIRnSKVTB8FM d2zyhVeMIPFa7ujTcMfZqNj1lrsd8iC2GZW5CKPHRgJTx8J8IzvRu1+Crn6hLCz6lFBy GXCd+9LiLtlCJyX2vbZoxEihDaeOyjzeHOQ+1r3GRw6dRFknk7BE8wcDbv+95NSKmZ2q C40Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id n18si19631817otf.285.2020.01.19.07.05.43; Sun, 19 Jan 2020 07:05:54 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1726778AbgASPEx (ORCPT + 99 others); Sun, 19 Jan 2020 10:04:53 -0500 Received: from mail-il-dmz.mellanox.com ([193.47.165.129]:37671 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727195AbgASPEv (ORCPT ); Sun, 19 Jan 2020 10:04:51 -0500 Received: from Internal Mail-Server by MTLPINE1 (envelope-from moshe@mellanox.com) with ESMTPS (AES256-SHA encrypted); 19 Jan 2020 17:04:48 +0200 Received: from dev-l-vrt-136.mtl.labs.mlnx (dev-l-vrt-136.mtl.labs.mlnx [10.134.136.1]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 00JF4mPF007486; Sun, 19 Jan 2020 17:04:48 +0200 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 00JF4m5D026590; Sun, 19 Jan 2020 17:04:48 +0200 Received: (from moshe@localhost) by dev-l-vrt-136.mtl.labs.mlnx (8.14.7/8.14.7/Submit) id 00JF4iXd026587; Sun, 19 Jan 2020 17:04:44 +0200 From: Moshe Shemesh To: "David S. Miller" Cc: Jiri Pirko , Vikas Gupta , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Moshe Shemesh Subject: [PATCH net-next] devlink: Add health recover notifications on devlink flows Date: Sun, 19 Jan 2020 17:04:28 +0200 Message-Id: <1579446268-26540-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 Devlink health recover notifications were added only on driver direct updates of health_state through devlink_health_reporter_state_update(). Add notifications on updates of health_state by devlink flows of report and recover. Fixes: 97ff3bd37fac ("devlink: add devink notification when reporter update health state") Signed-off-by: Moshe Shemesh Acked-by: Jiri Pirko --- net/core/devlink.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/net/core/devlink.c b/net/core/devlink.c index b41b2e3..99f2057 100644 --- a/net/core/devlink.c +++ b/net/core/devlink.c @@ -4851,6 +4851,9 @@ struct devlink_health_reporter * } EXPORT_SYMBOL_GPL(devlink_health_reporter_recovery_done); +static void devlink_recover_notify(struct devlink_health_reporter *reporter, + enum devlink_command cmd); + static int devlink_health_reporter_recover(struct devlink_health_reporter *reporter, void *priv_ctx, struct netlink_ext_ack *extack) @@ -4869,6 +4872,7 @@ struct devlink_health_reporter * devlink_health_reporter_recovery_done(reporter); reporter->health_state = DEVLINK_HEALTH_REPORTER_STATE_HEALTHY; + devlink_recover_notify(reporter, DEVLINK_CMD_HEALTH_REPORTER_RECOVER); return 0; } @@ -4935,6 +4939,7 @@ int devlink_health_report(struct devlink_health_reporter *reporter, reporter->error_count++; prev_health_state = reporter->health_state; reporter->health_state = DEVLINK_HEALTH_REPORTER_STATE_ERROR; + devlink_recover_notify(reporter, DEVLINK_CMD_HEALTH_REPORTER_RECOVER); /* abort if the previous error wasn't recovered */ if (reporter->auto_recover && -- 1.8.3.1