From: John Meneghini <jmeneghi@redhat.com>
To: Martin Belanger <nitram_67@hotmail.com>, linux-nvme@lists.infradead.org
Cc: kbusch@kernel.org, hare@suse.de, axboe@fb.com, hch@lst.de,
sagi@grimberg.me, stuart_hayes@dell.com, charles_rose@dell.com,
Martin Belanger <martin.belanger@dell.com>,
Chaitanya Kulkarni <kch@nvidia.com>
Subject: Re: [PATCHv3 1/2] nvme: send uevent on connection up
Date: Tue, 15 Feb 2022 10:41:33 -0500 [thread overview]
Message-ID: <b2b4556c-5d6f-9dcd-5a45-9dd160e7b1c0@redhat.com> (raw)
In-Reply-To: <BL0PR13MB4291421C8BC621EEA559A88D9C2D9@BL0PR13MB4291.namprd13.prod.outlook.com>
On 2/8/22 14:33, Martin Belanger wrote:
> From: Martin Belanger <martin.belanger@dell.com>
>
> When connectivity with a controller is lost, the driver will keep
> trying to reconnect once every 10 sec. When connection is restored,
> user-space apps need to be informed so that they can take proper
> action. For example, TP8010 introduces the DIM PDU, which is used to
> register with a discovery controller (DC). The DIM PDU is sent from
> user-space. The DIM PDU must be sent every time a connection is
> established with a DC. Therefore, the kernel must tell user-space apps
> when connection is restored so that registration can happen.
>
> The uevent sent is a "change" uevent with environmental data
> set to: "NVME_EVENT=connected".
>
> Signed-off-by: Martin Belanger <martin.belanger@dell.com>
> Reviewed-by: Hannes Reinecke <hare@suse.de>
> Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
> Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
> ---
> drivers/nvme/host/core.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
> index dd18861f77c0..b5e452aa3c0e 100644
> --- a/drivers/nvme/host/core.c
> +++ b/drivers/nvme/host/core.c
> @@ -4229,6 +4229,13 @@ static int nvme_class_uevent(struct device *dev, struct kobj_uevent_env *env)
> return ret;
> }
>
> +static void nvme_change_uevent(struct nvme_ctrl *ctrl, char *envdata)
> +{
> + char *envp[2] = { envdata, NULL };
> +
> + kobject_uevent_env(&ctrl->device->kobj, KOBJ_CHANGE, envp);
> +}
> +
> static void nvme_aen_uevent(struct nvme_ctrl *ctrl)
> {
> char *envp[2] = { NULL, NULL };
> @@ -4396,6 +4403,8 @@ void nvme_start_ctrl(struct nvme_ctrl *ctrl)
> nvme_queue_scan(ctrl);
> nvme_start_queues(ctrl);
> }
> +
> + nvme_change_uevent(ctrl, "NVME_EVENT=connected");
> }
> EXPORT_SYMBOL_GPL(nvme_start_ctrl);
>
Reviewed-by: John Meneghini <jmeneghi@redhat.com>
next prev parent reply other threads:[~2022-02-15 16:02 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20220208193346.22580-1-nitram_67@hotmail.com>
2022-02-08 19:33 ` [PATCHv3 1/2] nvme: send uevent on connection up Martin Belanger
2022-02-15 15:41 ` John Meneghini [this message]
2022-02-16 8:01 ` Christoph Hellwig
2022-02-08 19:33 ` [PATCHv3 2/2] nvme: Expose cntrltype and dctype through sysfs Martin Belanger
2022-02-08 23:18 ` Chaitanya Kulkarni
2022-02-08 23:21 ` Chaitanya Kulkarni
2022-02-08 23:53 ` Belanger, Martin
2022-02-08 23:57 ` Chaitanya Kulkarni
2022-02-09 6:40 ` Hannes Reinecke
2022-02-15 15:06 ` Hannes Reinecke
2022-02-15 15:44 ` John Meneghini
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=b2b4556c-5d6f-9dcd-5a45-9dd160e7b1c0@redhat.com \
--to=jmeneghi@redhat.com \
--cc=axboe@fb.com \
--cc=charles_rose@dell.com \
--cc=hare@suse.de \
--cc=hch@lst.de \
--cc=kbusch@kernel.org \
--cc=kch@nvidia.com \
--cc=linux-nvme@lists.infradead.org \
--cc=martin.belanger@dell.com \
--cc=nitram_67@hotmail.com \
--cc=sagi@grimberg.me \
--cc=stuart_hayes@dell.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