Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: minwoo.im.dev@gmail.com (Minwoo Im)
Subject: [PATCH 3/4] nvme: lightnvm: trace opcode name
Date: Sun, 28 Jul 2019 03:41:54 +0900	[thread overview]
Message-ID: <20190727184155.18014-4-minwoo.im.dev@gmail.com> (raw)
In-Reply-To: <20190727184155.18014-1-minwoo.im.dev@gmail.com>

This patch moved opcode enum values to nvme.h to make it support for
command trace with opcode name istead of raw opcode value.

Example of Vector Chunk Read:
	... cmd=(0xe2 cdw10=00 00 00 00 00 00 00 00 00 ...

It would be like:
	... cmd=(nvme_nvm_admin_identity cdw10=00 00 00 00 00 00 00 00 00 ...

Although OCSSD 1.2 has been deprecated, we have the codes for 1.2 so
that this kind of traces might be deprecated later time.

Cc: Keith Busch <kbusch at kernel.org>
Cc: Jens Axboe <axboe at fb.com>
Cc: Christoph Hellwig <hch at lst.de>
Cc: Sagi Grimberg <sagi at grimberg.me>
Cc: Matias Bj?rling <mb at lightnvm.io>
Cc: Javier Gonz?lez <javier at javigon.com>
Signed-off-by: Minwoo Im <minwoo.im.dev at gmail.com>
---
 drivers/nvme/host/lightnvm.c |  6 ------
 include/linux/nvme.h         | 10 +++++++++-
 2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/drivers/nvme/host/lightnvm.c b/drivers/nvme/host/lightnvm.c
index ba009d4c9dfa..d06d0919c139 100644
--- a/drivers/nvme/host/lightnvm.c
+++ b/drivers/nvme/host/lightnvm.c
@@ -15,12 +15,6 @@
 #include <linux/sched/sysctl.h>
 #include <uapi/linux/lightnvm.h>
 
-enum nvme_nvm_admin_opcode {
-	nvme_nvm_admin_identity		= 0xe2,
-	nvme_nvm_admin_get_bb_tbl	= 0xf2,
-	nvme_nvm_admin_set_bb_tbl	= 0xf1,
-};
-
 enum nvme_nvm_log_page {
 	NVME_NVM_LOG_REPORT_CHUNK	= 0xca,
 };
diff --git a/include/linux/nvme.h b/include/linux/nvme.h
index 01aa6a6c241d..fddf4c776788 100644
--- a/include/linux/nvme.h
+++ b/include/linux/nvme.h
@@ -814,6 +814,11 @@ enum nvme_admin_opcode {
 	nvme_admin_security_send	= 0x81,
 	nvme_admin_security_recv	= 0x82,
 	nvme_admin_sanitize_nvm		= 0x84,
+
+	/* OCSSD 1.2 */
+	nvme_nvm_admin_identity		= 0xe2,
+	nvme_nvm_admin_get_bb_tbl	= 0xf2,
+	nvme_nvm_admin_set_bb_tbl	= 0xf1,
 };
 
 #define nvme_admin_opcode_name(opcode)	{ opcode, #opcode }
@@ -840,7 +845,10 @@ enum nvme_admin_opcode {
 		nvme_admin_opcode_name(nvme_admin_format_nvm),		\
 		nvme_admin_opcode_name(nvme_admin_security_send),	\
 		nvme_admin_opcode_name(nvme_admin_security_recv),	\
-		nvme_admin_opcode_name(nvme_admin_sanitize_nvm))
+		nvme_admin_opcode_name(nvme_admin_sanitize_nvm),	\
+		nvme_admin_opcode_name(nvme_nvm_admin_identity),	\
+		nvme_admin_opcode_name(nvme_nvm_admin_get_bb_tbl),	\
+		nvme_admin_opcode_name(nvme_nvm_admin_set_bb_tbl))
 
 enum {
 	NVME_QUEUE_PHYS_CONTIG	= (1 << 0),
-- 
2.17.1

  parent reply	other threads:[~2019-07-27 18:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-27 18:41 [PATCH 0/4] nvme: update way to get qid in trace Minwoo Im
2019-07-27 18:41 ` [PATCH 1/4] nvme: simplify nvme_req_qid() Minwoo Im
2019-07-27 18:41 ` [PATCH 2/4] nvme: check admin queue with ctrl->admin_q, not rq_disk Minwoo Im
2019-07-27 18:41 ` Minwoo Im [this message]
2019-07-27 19:36   ` [PATCH 3/4] nvme: lightnvm: trace opcode name Matias Bjørling
2019-07-28  3:12     ` Minwoo Im
2019-07-27 18:41 ` [PATCH 4/4] nvme: lightnvm: trace opcode name of I/O commands for 2.0 Minwoo Im
2019-07-27 19:47   ` Matias Bjørling
2019-07-28  3:15     ` Minwoo Im

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=20190727184155.18014-4-minwoo.im.dev@gmail.com \
    --to=minwoo.im.dev@gmail.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