From: daniel.verkamp@intel.com (Daniel Verkamp)
Subject: [PATCH v2] nvmet: fix KATO offset in Set Features
Date: Fri, 9 Dec 2016 12:59:46 -0700 [thread overview]
Message-ID: <20161209195946.119756-1-daniel.verkamp@intel.com> (raw)
In-Reply-To: <20161207183947.128897-1-daniel.verkamp@intel.com>
The Set Features implementation for Keep Alive Timer was using the wrong
structure when retrieving the KATO value; it was treating the Set
Features command as a Property Set command.
The NVMe spec defines the Keep Alive Timer feature as having one input
in CDW11 (4 bytes at offset 44 in the command) whereas the code was
reading 8 bytes at offset 48.
Since the Linux NVMe over Fabrics host never sets this feature, this
code has presumably never been tested.
Signed-off-by: Daniel Verkamp <daniel.verkamp at intel.com>
---
v2: remove unused val variable
drivers/nvme/target/admin-cmd.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/nvme/target/admin-cmd.c b/drivers/nvme/target/admin-cmd.c
index 6fe4c48..f791d46 100644
--- a/drivers/nvme/target/admin-cmd.c
+++ b/drivers/nvme/target/admin-cmd.c
@@ -381,7 +381,6 @@ static void nvmet_execute_set_features(struct nvmet_req *req)
{
struct nvmet_subsys *subsys = req->sq->ctrl->subsys;
u32 cdw10 = le32_to_cpu(req->cmd->common.cdw10[0]);
- u64 val;
u32 val32;
u16 status = 0;
@@ -391,8 +390,7 @@ static void nvmet_execute_set_features(struct nvmet_req *req)
(subsys->max_qid - 1) | ((subsys->max_qid - 1) << 16));
break;
case NVME_FEAT_KATO:
- val = le64_to_cpu(req->cmd->prop_set.value);
- val32 = val & 0xffff;
+ val32 = le32_to_cpu(req->cmd->common.cdw10[1]);
req->sq->ctrl->kato = DIV_ROUND_UP(val32, 1000);
nvmet_set_result(req, req->sq->ctrl->kato);
break;
--
2.9.3
prev parent reply other threads:[~2016-12-09 19:59 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-07 18:39 [PATCH] nvmet: fix KATO offset in Set Features Daniel Verkamp
2016-12-07 19:09 ` Daniel Verkamp
2016-12-09 18:28 ` Christoph Hellwig
2016-12-09 20:04 ` Daniel Verkamp
2016-12-21 10:27 ` Christoph Hellwig
[not found] ` <830460a5-ce31-b882-8f06-4a906763eb50@broadcom.com>
2016-12-22 6:41 ` Q: nvme_rdma and reconnect Christoph Hellwig
2016-12-22 12:08 ` Sagi Grimberg
2016-12-22 12:10 ` Christoph Hellwig
2016-12-22 12:52 ` Sagi Grimberg
2016-12-22 12:46 ` Hannes Reinecke
2016-12-22 12:50 ` Christoph Hellwig
2016-12-09 19:59 ` Daniel Verkamp [this message]
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=20161209195946.119756-1-daniel.verkamp@intel.com \
--to=daniel.verkamp@intel.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).