Skip to contentSkip to conversation

nvme-core: use macro for identify size

PATCH New Chaitanya Kulkarni 4 participants 5 messages Mar 24, 2018 – Mar 28, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 nvme-core: use macro for identify size

Use identifier macro for identify data structure size.

Signed-off-by Chaitanya Kulkarni <chaitanya.kulkarni at wdc.com>
---
 drivers/nvme/host/core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/nvme/host/core.c +2 -1
index 7aeca5d..3ef1129 100644
@@ -948,7 +948,8 @@ static int nvme_identify_ns_list(struct nvme_ctrl *dev, unsigned nsid, __le32 *n
 	c.identify.opcode = nvme_admin_identify;
 	c.identify.cns = NVME_ID_CNS_NS_ACTIVE_LIST;
 	c.identify.nsid = cpu_to_le32(nsid);
-	return nvme_submit_sync_cmd(dev->admin_q, &c, ns_list, 0x1000);
+	return nvme_submit_sync_cmd(dev->admin_q, &c, ns_list,
+			NVME_IDENTIFY_DATA_SIZE);
 }
 
 static struct nvme_id_ns *nvme_identify_ns(struct nvme_ctrl *ctrl,
Signature · 1 line
2.9.5
#1 lore raw

PATCH 2/2 nvmet: make the error message more generic

nvmet_check_ctrl_status() is called from admin-cmd.c along with io-cmd.c, make the error message more generic.

---
 drivers/nvme/target/core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/nvme/target/core.c +2 -2
index a78029e..841e55a 100644
@@ -710,13 +710,13 @@ u16 nvmet_ctrl_find_get(const char *subsysnqn, const char *hostnqn, u16 cntlid,
 u16 nvmet_check_ctrl_status(struct nvmet_req *req, struct nvme_command *cmd)
 {
 	if (unlikely(!(req->sq->ctrl->cc & NVME_CC_ENABLE))) {
-		pr_err("got io cmd %d while CC.EN == 0 on qid = %d\n",
+		pr_err("got cmd %d while CC.EN == 0 on qid = %d\n",
 		       cmd->common.opcode, req->sq->qid);
 		return NVME_SC_CMD_SEQ_ERROR | NVME_SC_DNR;
 	}
 
 	if (unlikely(!(req->sq->ctrl->csts & NVME_CSTS_RDY))) {
-		pr_err("got io cmd %d while CSTS.RDY == 0 on qid = %d\n",
+		pr_err("got cmd %d while CSTS.RDY == 0 on qid = %d\n",
 		       cmd->common.opcode, req->sq->qid);
 		req->ns = NULL;
 		return NVME_SC_CMD_SEQ_ERROR | NVME_SC_DNR;
Signature · 1 line
2.9.5
#2 lore raw

PATCH 2/2 nvmet: make the error message more generic

Oops, missing sign-off will resend this patch.

Quoted 34 lines · Chaitanya Kulkarni

nvmet_check_ctrl_status() is called from admin-cmd.c along with io-cmd.c, make the error message more generic.

---
 drivers/nvme/target/core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/nvme/target/core.c +2 -3
index a78029e..841e55a 100644
@@ -710,13 +710,13 @@ u16 nvmet_ctrl_find_get(const char *subsysnqn, const char *hostnqn, u16 cntlid,
 u16 nvmet_check_ctrl_status(struct nvmet_req *req, struct nvme_command *cmd)
 {
        if (unlikely(!(req->sq->ctrl->cc & NVME_CC_ENABLE))) {
-               pr_err("got io cmd %d while CC.EN == 0 on qid = %d\n",
+               pr_err("got cmd %d while CC.EN == 0 on qid = %d\n",
                       cmd->common.opcode, req->sq->qid);
                return NVME_SC_CMD_SEQ_ERROR | NVME_SC_DNR;
        }
 
        if (unlikely(!(req->sq->ctrl->csts & NVME_CSTS_RDY))) {
-               pr_err("got io cmd %d while CSTS.RDY == 0 on qid = %d\n",
+               pr_err("got cmd %d while CSTS.RDY == 0 on qid = %d\n",
                       cmd->common.opcode, req->sq->qid);
                req->ns = NULL;
                return NVME_SC_CMD_SEQ_ERROR | NVME_SC_DNR;
--

2.9.5

_______________________________________________
Linux-nvme mailing list
Linux-nvme at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

#3 lore raw

PATCH 1/2 nvme-core: use macro for identify size

In reply to Chaitanya Kulkarni
Quoted 3 lines · Chaitanya Kulkarni

Use identifier macro for identify data structure size.

Signed-off-by Chaitanya Kulkarni <chaitanya.kulkarni at wdc.com>

Looks good,

Reviewed-by Christoph Hellwig <hch at lst.de>