From: Hannes Reinecke <hare@suse.de>
To: Christoph Hellwig <hch@lst.de>
Cc: Sagi Grimberg <sagi@grimberg.me>,
Keith Busch <keith.busch@wdc.com>,
Chaitanya Kulkarni <chaitanyak@nvidia.com>,
linux-nvme@lists.infradead.org, Hannes Reinecke <hare@suse.de>
Subject: [PATCH 4/7] nvmet: set 'CNTRLTYPE' in the identify controller data
Date: Wed, 22 Sep 2021 08:35:22 +0200 [thread overview]
Message-ID: <20210922063525.143045-5-hare@suse.de> (raw)
In-Reply-To: <20210922063525.143045-1-hare@suse.de>
Set the correct 'CNTRLTYPE' field in the identify controller data.
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
drivers/nvme/target/admin-cmd.c | 3 +++
drivers/nvme/target/discovery.c | 2 ++
drivers/nvme/target/fabrics-cmd.c | 3 ++-
3 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/nvme/target/admin-cmd.c b/drivers/nvme/target/admin-cmd.c
index b653ea4244fe..0428bf203fa5 100644
--- a/drivers/nvme/target/admin-cmd.c
+++ b/drivers/nvme/target/admin-cmd.c
@@ -374,6 +374,9 @@ static void nvmet_execute_identify_ctrl(struct nvmet_req *req)
id->rab = 6;
+ id->cntrltype = nvmet_is_disc_subsys(ctrl->subsys) ?
+ NVME_CTRL_DISC : NVME_CTRL_IO;
+
/*
* XXX: figure out how we can assign a IEEE OUI, but until then
* the safest is to leave it as zeroes.
diff --git a/drivers/nvme/target/discovery.c b/drivers/nvme/target/discovery.c
index 7aa62bc6ae84..7b360f8d07e9 100644
--- a/drivers/nvme/target/discovery.c
+++ b/drivers/nvme/target/discovery.c
@@ -268,6 +268,8 @@ static void nvmet_execute_disc_identify(struct nvmet_req *req)
memcpy_and_pad(id->fr, sizeof(id->fr),
UTS_RELEASE, strlen(UTS_RELEASE), ' ');
+ id->cntrltype = NVME_CTRL_DISC;
+
/* no limit on data transfer sizes for now */
id->mdts = 0;
id->cntlid = cpu_to_le16(ctrl->cntlid);
diff --git a/drivers/nvme/target/fabrics-cmd.c b/drivers/nvme/target/fabrics-cmd.c
index 7d0454cee920..70fb587e9413 100644
--- a/drivers/nvme/target/fabrics-cmd.c
+++ b/drivers/nvme/target/fabrics-cmd.c
@@ -221,7 +221,8 @@ static void nvmet_execute_admin_connect(struct nvmet_req *req)
goto out;
}
- pr_info("creating controller %d for subsystem %s for NQN %s%s.\n",
+ pr_info("creating %s controller %d for subsystem %s for NQN %s%s.\n",
+ nvmet_is_disc_subsys(ctrl->subsys) ? "discovery" : "nvm",
ctrl->cntlid, ctrl->subsys->subsysnqn, ctrl->hostnqn,
ctrl->pi_support ? " T10-PI is enabled" : "");
req->cqe->result.u16 = cpu_to_le16(ctrl->cntlid);
--
2.29.2
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
next prev parent reply other threads:[~2021-09-22 6:35 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-22 6:35 [PATCHv3 0/7] nvme: support unique discovery controller NQN Hannes Reinecke
2021-09-22 6:35 ` [PATCH 1/7] nvmet: make discovery NQN configurable Hannes Reinecke
2021-09-22 7:07 ` Chaitanya Kulkarni
2021-09-22 13:36 ` Himanshu Madhani
2021-09-22 6:35 ` [PATCH 2/7] nvme: add CNTRLTYPE definitions for 'identify controller' Hannes Reinecke
2021-09-22 13:37 ` Himanshu Madhani
2021-09-22 6:35 ` [PATCH 3/7] nvmet: add nvmet_is_disc_subsys() helper Hannes Reinecke
2021-09-22 7:06 ` Chaitanya Kulkarni
2021-09-22 13:36 ` Himanshu Madhani
2021-09-22 6:35 ` Hannes Reinecke [this message]
2021-09-22 7:08 ` [PATCH 4/7] nvmet: set 'CNTRLTYPE' in the identify controller data Chaitanya Kulkarni
2021-09-22 6:35 ` [PATCH 5/7] nvme: expose subsystem type in sysfs attribute 'subtype' Hannes Reinecke
2021-09-22 8:02 ` Daniel Wagner
2021-10-12 13:10 ` Christoph Hellwig
2021-10-12 13:43 ` Hannes Reinecke
2021-10-12 13:44 ` Christoph Hellwig
2021-09-22 6:35 ` [PATCH 6/7] nvme: Add connect option 'discovery' Hannes Reinecke
2021-09-22 16:59 ` James Smart
2021-09-23 6:11 ` Hannes Reinecke
2021-09-22 6:35 ` [PATCH 7/7] nvme: display correct subsystem NQN Hannes Reinecke
2021-10-12 13:10 ` [PATCHv3 0/7] nvme: support unique discovery controller NQN Christoph Hellwig
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=20210922063525.143045-5-hare@suse.de \
--to=hare@suse.de \
--cc=chaitanyak@nvidia.com \
--cc=hch@lst.de \
--cc=keith.busch@wdc.com \
--cc=linux-nvme@lists.infradead.org \
--cc=sagi@grimberg.me \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.