From: emilne@redhat.com (Ewan D. Milne)
Subject: [PATCH 5/5] nvme: ANA base support
Date: Wed, 09 May 2018 14:49:40 -0400 [thread overview]
Message-ID: <1525891780.30724.271.camel@localhost.localdomain> (raw)
In-Reply-To: <20180504112845.38820-6-hare@suse.de>
On Fri, 2018-05-04@13:28 +0200, Hannes Reinecke wrote:
> Add ANA support to the nvme host. If ANA is supported the state
> and the group id are displayed in new sysfs attributes 'ana_state' and
> 'ana_group'.
>
> Signed-off-by: Hannes Reinecke <hare at suse.com>
> ---
> drivers/nvme/host/core.c | 123 +++++++++++++++++++++++++++++++++++++++++-
> drivers/nvme/host/multipath.c | 12 ++++-
> drivers/nvme/host/nvme.h | 3 ++
> 3 files changed, 136 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
...
> +static void nvme_get_ana_log(struct nvme_ctrl *ctrl, struct nvme_ns *ns)
> +{
> + int i, j;
> + struct nvmf_ana_rsp_page_header *ana_log;
> + size_t ana_log_size = 4096;
> +
> + ana_log = kzalloc(ana_log_size, GFP_KERNEL);
> + if (!ana_log)
> + return;
> +
> + if (nvme_get_log(ctrl, NVME_LOG_ANA, ana_log, ana_log_size))
> + dev_warn(ctrl->device,
> + "Get ANA log error\n");
If nvme_get_log() above returns an error you don't want to use the data
in the ana_log buffer in the following section of code:
> + for (i = 0; i < ana_log->grpid_num; i++) {
> + struct nvmf_ana_group_descriptor *desc =
> + &ana_log->desc[i];
> + for (j = 0; j < desc->nsid_num; j++) {
> + if (desc->nsid[j] == ns->head->ns_id) {
> + ns->ana_state = desc->ana_state;
> + ns->ana_group = desc->groupid;
> + }
> + }
> + }
> + kfree(ana_log);
> +}
> +
next prev parent reply other threads:[~2018-05-09 18:49 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-04 11:28 [RFC PATCH 0/5] nvme: ANA support Hannes Reinecke
2018-05-04 11:28 ` [PATCH 1/5] nvmet: EUI64 support Hannes Reinecke
2018-05-07 7:17 ` Johannes Thumshirn
2018-05-09 7:08 ` Christoph Hellwig
2018-05-09 7:45 ` Hannes Reinecke
2018-05-09 7:52 ` Christoph Hellwig
2018-05-09 15:43 ` Ewan D. Milne
2018-05-04 11:28 ` [PATCH 2/5] nvme: Add ANA base definitions Hannes Reinecke
2018-05-04 16:17 ` Keith Busch
2018-05-04 17:03 ` Meneghini, John
2018-05-04 17:21 ` Knight, Frederick
2018-05-05 13:17 ` Hannes Reinecke
2018-05-04 21:12 ` Schremmer, Steven
2018-05-09 7:27 ` Christoph Hellwig
2018-05-04 11:28 ` [PATCH 3/5] nvmet: Add ANA base support Hannes Reinecke
2018-05-06 2:42 ` Guan Junxiong
2018-05-04 11:28 ` [PATCH 4/5] block: BLK_STS_NEXUS is a path failure Hannes Reinecke
2018-05-09 7:31 ` Christoph Hellwig
2018-05-04 11:28 ` [PATCH 5/5] nvme: ANA base support Hannes Reinecke
2018-05-04 22:11 ` Schremmer, Steven
2018-05-05 13:23 ` Hannes Reinecke
2018-05-06 3:23 ` Guan Junxiong
2018-05-07 7:21 ` Johannes Thumshirn
2018-05-09 18:49 ` Ewan D. Milne [this message]
2018-05-09 19:03 ` Ewan D. Milne
2018-05-10 9:16 ` Sriram Popuri
[not found] ` <CAGYjvj0Mk0MFAfUEApOOyQ9Prm3CvGcZH14PJzDQT2+Qc+w81w@mail.gmail.com>
2018-05-10 13:40 ` Hannes Reinecke
2018-05-11 7:50 ` Hannes Reinecke
2018-05-11 8:22 ` Popuri, Sriram
2018-05-11 8:36 ` Popuri, Sriram
2018-05-11 16:24 ` Knight, Frederick
2018-05-12 13:31 ` Christoph Hellwig
2018-05-13 10:33 ` Hannes Reinecke
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=1525891780.30724.271.camel@localhost.localdomain \
--to=emilne@redhat.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;
as well as URLs for NNTP newsgroup(s).