Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp6963639ybe; Wed, 18 Sep 2019 11:55:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqzr7iOImnWJiqa12CdAHXilf1LXCUQiKwlbVXV1TBK7Z5Ch4awCqy5h/YU8N+C7Z+xbtOOe X-Received: by 2002:a50:eac5:: with SMTP id u5mr11790178edp.207.1568832951567; Wed, 18 Sep 2019 11:55:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568832951; cv=none; d=google.com; s=arc-20160816; b=ZwMYDGcoseNXyV1QOEyJP+xPMnngF5vnRsN2fP8CeWVkXviArtoG7ThrLb8oHwU2NZ zZog5LvVC5dVb0ERIN6Y8lGsdhO78rp4meedTIoolc0WmFaUHl0JUrIjg6wJ+elk+Ds6 V9gXltdQTNL4oTv01gVyie5bXa04fUXiOKLKztSyVPpbUqUv5KOG8X2JnCDx4lJwwkeK eUaNtzYK+kmy2csqIfg1V4aW2Vum0MrbPHc/qApQUesMgkImjydatcxrCZtjWK/OQk+U Q9C1TrXem0na5Oxg47GUzBAR1/mN1jT7bvM01zk63M1MhYaZOxZk0nHg9cpUfCjP4L84 /7IA== 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 :dkim-signature; bh=Okiu/elfIgaQjLf/NcyUs2b0iC336LxObVGspA2lzqA=; b=wdURk/xQPawYuLYwv4VGGb/8J+NF030OZ8pyIPuEDZVNab3RHUpWBVSqGRsI43zkK+ uDCK0TRmUZE2BBypKf6KUetHGhg3IEq7yDAvEV+6zHVjvqlMtm4CZoT8tZas+Vl63yjq Twq7iOhNcttva2UY6IAZhVuatYB5V66gSxWyrGZutEU6MmKww0WQXLD0siSj5sWaX6XF LyUrf2sHYyPJED0ZziTIlEuzBfjbWoQowT6oQWMMoNIq1aiXaCYXRQIceZ4TsauMSUPu lDYz0aPJ8QSdmS6uOP4Ln6xcbhcQyJ6X4FDG962bGurRi3xX7T6w+5y3FaTIbS+GSSco fheg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=edyaNwt+; 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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a19si3168630ejj.73.2019.09.18.11.55.27; Wed, 18 Sep 2019 11:55:51 -0700 (PDT) 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; dkim=pass header.i=@broadcom.com header.s=google header.b=edyaNwt+; 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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388882AbfIRSwZ (ORCPT + 99 others); Wed, 18 Sep 2019 14:52:25 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:44195 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387624AbfIRSwY (ORCPT ); Wed, 18 Sep 2019 14:52:24 -0400 Received: by mail-pg1-f196.google.com with SMTP id i18so350087pgl.11 for ; Wed, 18 Sep 2019 11:52:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id; bh=Okiu/elfIgaQjLf/NcyUs2b0iC336LxObVGspA2lzqA=; b=edyaNwt+eE1B1lgdsf/YGnTJT7plTJ12j36UTrWUO/FNne2Cz4e3Jsmk0R1p+1RuKI wxis/VxbSyAsbRssjpJ8QEihlf90LcB+Eol37VpQzbP4CzHi7fjm0o4HFYGnT/NS3sth M5x4sS9d9PtxDr7DSNWf6FftE21sx5C2KZ3I0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Okiu/elfIgaQjLf/NcyUs2b0iC336LxObVGspA2lzqA=; b=iOj+A9ZpfRSnJsVFLfRXbua7RHVPw2sQocH5PmxkcjiOwWulZvGfy91IyGOnP2XH2p 1Bwnumw9hUtwuNztm+MUny/drZk6PFWzXK/euJkaYig2fp2LXfgdkQvuYzRO+YX9QKk+ mCARIwQ73e36ooU1eKw/aS2bCaKoszQNcyNNc7wbCOguzzAV4bs6uY6BOLLlzuSTTYW6 pHntN6MNBqueBAP3xhxae02MfnvR4SA1A5fRioLt7j+DegnsZE1T5DnJHVdtL/1ZC5F+ yR/hsS8T3z93AwqMC8v5mMOjnps0SARFgnR/2FJiMsvryn0czPYccv1Gns9Bz1QUVuy9 Jnkg== X-Gm-Message-State: APjAAAWCIwXGpm22v6F7IEDASx3PH+tLoUd97JPJXzOfiD46P9W+mJB7 weti7Syn8ReTVs2d+OfpR15d6A== X-Received: by 2002:aa7:9835:: with SMTP id q21mr5970232pfl.122.1568832742624; Wed, 18 Sep 2019 11:52:22 -0700 (PDT) Received: from shitalt.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id o42sm3745010pjo.32.2019.09.18.11.52.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 18 Sep 2019 11:52:22 -0700 (PDT) From: Sheetal Tigadoli To: Jiri Pirko , "David S. Miller" , Ray Jui , Vikram Prakash Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, BCM Kernel Feedback , Vikas Gupta , Sheetal Tigadoli Subject: [PATCH] devlink: add devlink notification for recovery Date: Thu, 19 Sep 2019 00:22:21 +0530 Message-Id: <1568832741-20850-1-git-send-email-sheetal.tigadoli@broadcom.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vikas Gupta Add a devlink notification for reporter recovery Signed-off-by: Vikas Gupta Signed-off-by: Sheetal Tigadoli --- net/core/devlink.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/net/core/devlink.c b/net/core/devlink.c index e48680e..42909fb 100644 --- a/net/core/devlink.c +++ b/net/core/devlink.c @@ -4730,6 +4730,28 @@ struct devlink_health_reporter * } EXPORT_SYMBOL_GPL(devlink_health_reporter_state_update); +static void __devlink_recover_notify(struct devlink *devlink, + enum devlink_command cmd) +{ + struct sk_buff *msg; + int err; + + WARN_ON(cmd != DEVLINK_CMD_HEALTH_REPORTER_RECOVER); + + msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); + if (!msg) + return; + + err = devlink_nl_fill(msg, devlink, cmd, 0, 0, 0); + if (err) { + nlmsg_free(msg); + return; + } + + genlmsg_multicast_netns(&devlink_nl_family, devlink_net(devlink), + msg, 0, DEVLINK_MCGRP_CONFIG, GFP_KERNEL); +} + static int devlink_health_reporter_recover(struct devlink_health_reporter *reporter, void *priv_ctx) @@ -4747,6 +4769,9 @@ struct devlink_health_reporter * reporter->health_state = DEVLINK_HEALTH_REPORTER_STATE_HEALTHY; reporter->last_recovery_ts = jiffies; + __devlink_recover_notify(reporter->devlink, + DEVLINK_CMD_HEALTH_REPORTER_RECOVER); + return 0; } -- 1.9.1