Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp763179ybe; Thu, 19 Sep 2019 03:27:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqz7r+lPxVbSqeovw5jTe1cgu13GIJ2BLqBgkzI/nB5tX4qqQybELYdIvfzkUn1PzHgVPolU X-Received: by 2002:a05:6402:290:: with SMTP id l16mr12706249edv.178.1568888867404; Thu, 19 Sep 2019 03:27:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568888867; cv=none; d=google.com; s=arc-20160816; b=z1KHMhBE6LFd0GnwC72KvMguIBdFO3zdGIJIBJBGf2DDf6Q6/OIPyx/ycYWJik3jYJ kjog4EFw4ez8zkPFVLF89J5KoaBwl4227t9DOwI+ACnyp/IuWimPewL5eAJlBNMVZKXj 4hX1IuJUzkpbZZWoQdXqL9sXOx4MVMabLZ3sWfP3USwdczJNX3oh6czOfQkRlJPpKPYt JXd0EtpUYnx+hh815yMC4xWx2wcraOtgnsJDWQkhqeiFdjj7Eu5u6sxJttAOF2MoZdbl Ctxf6tf3oIBT1up1kyFd0CAcI6CkJKQkYM184XDl0vMNP27rzx5WxBeJwFezpjgmyih6 oclQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=+kJRnH/bobkHHD8pbQwbBalV5RlXRs7lsi398MM0g98=; b=yzrQP1s0EfirHWo1ioEqkGXr0vJojadUst0DrCEFCZL6EmjIXh9EOS6PNDQJaICV9a ktVdbDe8z1AgKDTqMDEdI0AhPId4ryskJNXwD1tdT/v1WoCnT4Yo7n42LlJcvgo/uJcq 2At+xl8Esl5t2ZOtgFcxC+K9L7y9xwIgxez4cqEr+Em8RdonVpXE+xlwaMyYnGmzl78R QKo6n2dNdMJu3Q4ezC1r1dbBDebF/JQdkjSQ805sR2ho9XLT1Eny3dOg8rYd77tOFHz6 5YT7rs4pl88vWFenlyEHkN/l4IcB+ltsGn+2m3Sqr6LLENVK7fw0rOtafpn1hn5fWr8h AyNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@resnulli-us.20150623.gappssmtp.com header.s=20150623 header.b=hitoYH0q; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z2si4421347edp.306.2019.09.19.03.27.24; Thu, 19 Sep 2019 03:27:47 -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=@resnulli-us.20150623.gappssmtp.com header.s=20150623 header.b=hitoYH0q; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387579AbfISGLh (ORCPT + 99 others); Thu, 19 Sep 2019 02:11:37 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:37559 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726142AbfISGLg (ORCPT ); Thu, 19 Sep 2019 02:11:36 -0400 Received: by mail-wr1-f67.google.com with SMTP id i1so1704749wro.4 for ; Wed, 18 Sep 2019 23:11:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=resnulli-us.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=+kJRnH/bobkHHD8pbQwbBalV5RlXRs7lsi398MM0g98=; b=hitoYH0qrf7DoRJ7kw5xIyrIwuyKYlJi3HR62Ok2KWtUmi4lbhSrw7TfTdFUjH9G3n 25ECHYJKD/ybkvDAO7PIIxXI/aPTs+14edqpbMNlnppeXQKFLf3kEUYM+PsNmyZXgZm6 MxqTrCuKBJqKKawXRNQFX0dq9j7Iac0bZOV4BF8Y3oI+mZkg0S2IGolU2RWe9HcLFNJ2 /XKjdQxBBSm25hEVP5r2YwBourumDWz9wae4xxYw4Q/7shT+pr6IAWbx0wd413JIIYOQ qKk61FiVPfj26eJw9ZLpmp4avSiZ/C/nwRBeApiETDFOXvm5gIJZRzaaavltkbYXgG/g vpOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=+kJRnH/bobkHHD8pbQwbBalV5RlXRs7lsi398MM0g98=; b=dG92FTogBJ8JcsDq4aTkJX4juiQxVVrl4+zZvtlz0odXTyZlCUfRRiiQ+Hj/yDa4o/ OmzPZvJYE+S9owD/xLEd9gyxUTT/88rHii5TX3KpV0yVezbli4wDSzWxVi0Cwd73mSxY juYDhpGYCNj7eL8seE5nWdRRGEOGfUzVrz8MrEI31LkZNCTUr1ypawzVcQmb2WrI7PSO DpyE8KMJ6mtJK+j4Ig3SKTHWZliooSibumdH8N80Fn7Hiee/c1nze+59ZM62HNTPHK7L 8qohg4K1h9/5xainbJ9cln6V9l5uxTHYYr0GDkBmTFxByQxhoYRZ3tPB0dva6fTO0PU2 FjMQ== X-Gm-Message-State: APjAAAU5iJpzHrlFfwW8JH1FW3tn1cD5f1IG24J62jkTGFbfm43XeK30 s04JAjzCVt2HBr7S7Dhd0+tn3A== X-Received: by 2002:a5d:4803:: with SMTP id l3mr5750322wrq.301.1568873494305; Wed, 18 Sep 2019 23:11:34 -0700 (PDT) Received: from localhost (jirka.pirko.cz. [84.16.102.26]) by smtp.gmail.com with ESMTPSA id j26sm13832561wrd.2.2019.09.18.23.11.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Sep 2019 23:11:33 -0700 (PDT) Date: Thu, 19 Sep 2019 08:11:33 +0200 From: Jiri Pirko To: Sheetal Tigadoli Cc: Jiri Pirko , "David S. Miller" , Ray Jui , Vikram Prakash , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, BCM Kernel Feedback , Vikas Gupta Subject: Re: [PATCH] devlink: add devlink notification for recovery Message-ID: <20190919061133.GB2187@nanopsycho> References: <1568832741-20850-1-git-send-email-sheetal.tigadoli@broadcom.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1568832741-20850-1-git-send-email-sheetal.tigadoli@broadcom.com> User-Agent: Mutt/1.11.4 (2019-03-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Wed, Sep 18, 2019 at 08:52:21PM CEST, sheetal.tigadoli@broadcom.com wrote: >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; > } To follow the rest of the code The notification should be done upon any reported change, using devlink_nl_health_reporter_fill() to prepare the message. Also, this is net-next patch net-next is closed now. >