Skip to content

Commit

Permalink
nvmet: set 'CNTRLTYPE' in the identify controller data
Browse files Browse the repository at this point in the history
Set the correct 'CNTRLTYPE' field in the identify controller data.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
  • Loading branch information
hreinecke authored and Christoph Hellwig committed Oct 20, 2021
1 parent a294711 commit d3aef70
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions drivers/nvme/target/admin-cmd.c
Expand Up @@ -374,6 +374,11 @@ static void nvmet_execute_identify_ctrl(struct nvmet_req *req)

id->rab = 6;

if (nvmet_is_disc_subsys(ctrl->subsys))
id->cntrltype = NVME_CTRL_DISC;
else
id->cntrltype = NVME_CTRL_IO;

/*
* XXX: figure out how we can assign a IEEE OUI, but until then
* the safest is to leave it as zeroes.
Expand Down
2 changes: 2 additions & 0 deletions drivers/nvme/target/discovery.c
Expand Up @@ -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);
Expand Down
3 changes: 2 additions & 1 deletion drivers/nvme/target/fabrics-cmd.c
Expand Up @@ -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);
Expand Down

0 comments on commit d3aef70

Please sign in to comment.