public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Jiri Pirko <jiri@resnulli.us>
To: Sheetal Tigadoli <sheetal.tigadoli@broadcom.com>
Cc: Jiri Pirko <jiri@mellanox.com>,
	"David S. Miller" <davem@davemloft.net>,
	Ray Jui <ray.jui@broadcom.com>,
	Vikram Prakash <vikram.prakash@broadcom.com>,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	BCM Kernel Feedback <bcm-kernel-feedback-list@broadcom.com>,
	Vikas Gupta <vikas.gupta@broadcom.com>
Subject: Re: [PATCH] devlink: add devlink notification for recovery
Date: Thu, 19 Sep 2019 08:11:33 +0200	[thread overview]
Message-ID: <20190919061133.GB2187@nanopsycho> (raw)
In-Reply-To: <1568832741-20850-1-git-send-email-sheetal.tigadoli@broadcom.com>

Wed, Sep 18, 2019 at 08:52:21PM CEST, sheetal.tigadoli@broadcom.com wrote:
>From: Vikas Gupta <vikas.gupta@broadcom.com>
>
>Add a devlink notification for reporter recovery
>
>Signed-off-by: Vikas Gupta <vikas.gupta@broadcom.com>
>Signed-off-by: Sheetal Tigadoli <sheetal.tigadoli@broadcom.com>
>---
> 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.
>

      reply	other threads:[~2019-09-19  6:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-18 18:52 [PATCH] devlink: add devlink notification for recovery Sheetal Tigadoli
2019-09-19  6:11 ` Jiri Pirko [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190919061133.GB2187@nanopsycho \
    --to=jiri@resnulli.us \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=davem@davemloft.net \
    --cc=jiri@mellanox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=ray.jui@broadcom.com \
    --cc=sheetal.tigadoli@broadcom.com \
    --cc=vikas.gupta@broadcom.com \
    --cc=vikram.prakash@broadcom.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox