* [PATCH 1/3] nvmet: parse dsm command's attr deallocate when tracing
2024-02-27 8:54 [PATCH 0/3] nvmet: add some commands tracing Guixin Liu
@ 2024-02-27 8:54 ` Guixin Liu
2024-02-27 8:54 ` [PATCH 2/3] nvmet: add tracing of zns commands Guixin Liu
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Guixin Liu @ 2024-02-27 8:54 UTC (permalink / raw)
To: hch, sagi, kch; +Cc: linux-nvme
Add parse of dsm command's attr deallocate to make the trace log
more consistent and human-readable.
Signed-off-by: Guixin Liu <kanie@linux.alibaba.com>
---
drivers/nvme/target/trace.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/nvme/target/trace.c b/drivers/nvme/target/trace.c
index 6ee1f3db81d0..657bd31841b2 100644
--- a/drivers/nvme/target/trace.c
+++ b/drivers/nvme/target/trace.c
@@ -83,10 +83,10 @@ static const char *nvmet_trace_read_write(struct trace_seq *p, u8 *cdw10)
static const char *nvmet_trace_dsm(struct trace_seq *p, u8 *cdw10)
{
const char *ret = trace_seq_buffer_ptr(p);
+ u8 nr = cdw10[0];
+ u8 ad = (cdw10[4] >> 2) & 0x1;
- trace_seq_printf(p, "nr=%u, attributes=%u",
- get_unaligned_le32(cdw10),
- get_unaligned_le32(cdw10 + 4));
+ trace_seq_printf(p, "nr=%u, ad=%u", nr, ad);
trace_seq_putc(p, 0);
return ret;
--
2.43.0
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH 2/3] nvmet: add tracing of zns commands
2024-02-27 8:54 [PATCH 0/3] nvmet: add some commands tracing Guixin Liu
2024-02-27 8:54 ` [PATCH 1/3] nvmet: parse dsm command's attr deallocate when tracing Guixin Liu
@ 2024-02-27 8:54 ` Guixin Liu
2024-02-27 8:54 ` [PATCH 3/3] nvmet: add tracing of authentication commands Guixin Liu
2024-02-27 16:37 ` [PATCH 0/3] nvmet: add some commands tracing Keith Busch
3 siblings, 0 replies; 6+ messages in thread
From: Guixin Liu @ 2024-02-27 8:54 UTC (permalink / raw)
To: hch, sagi, kch; +Cc: linux-nvme
Add nvme_cmd_zone_append, nvme_cmd_zone_mgmt_send and
nvme_cmd_zone_mgmt_recv parse to nvme target tracing.
Signed-off-by: Guixin Liu <kanie@linux.alibaba.com>
---
drivers/nvme/target/trace.c | 34 ++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)
diff --git a/drivers/nvme/target/trace.c b/drivers/nvme/target/trace.c
index 657bd31841b2..6604e5fe57d8 100644
--- a/drivers/nvme/target/trace.c
+++ b/drivers/nvme/target/trace.c
@@ -119,6 +119,35 @@ const char *nvmet_trace_parse_admin_cmd(struct trace_seq *p,
}
}
+static const char *nvmet_trace_zone_mgmt_send(struct trace_seq *p, u8 *cdw10)
+{
+ const char *ret = trace_seq_buffer_ptr(p);
+ u64 slba = get_unaligned_le64(cdw10);
+ u8 zsa = cdw10[12];
+ u8 all = cdw10[13];
+
+ trace_seq_printf(p, "slba=%llu, zsa=%u, all=%u", slba, zsa, all);
+ trace_seq_putc(p, 0);
+
+ return ret;
+}
+
+static const char *nvmet_trace_zone_mgmt_recv(struct trace_seq *p, u8 *cdw10)
+{
+ const char *ret = trace_seq_buffer_ptr(p);
+ u64 slba = get_unaligned_le64(cdw10);
+ u32 numd = get_unaligned_le32(cdw10 + 8);
+ u8 zra = cdw10[12];
+ u8 zrasf = cdw10[13];
+ u8 pr = cdw10[14];
+
+ trace_seq_printf(p, "slba=%llu, numd=%u, zra=%u, zrasf=%u, pr=%u",
+ slba, numd, zra, zrasf, pr);
+ trace_seq_putc(p, 0);
+
+ return ret;
+}
+
const char *nvmet_trace_parse_nvm_cmd(struct trace_seq *p,
u8 opcode, u8 *cdw10)
{
@@ -126,9 +155,14 @@ const char *nvmet_trace_parse_nvm_cmd(struct trace_seq *p,
case nvme_cmd_read:
case nvme_cmd_write:
case nvme_cmd_write_zeroes:
+ case nvme_cmd_zone_append:
return nvmet_trace_read_write(p, cdw10);
case nvme_cmd_dsm:
return nvmet_trace_dsm(p, cdw10);
+ case nvme_cmd_zone_mgmt_send:
+ return nvmet_trace_zone_mgmt_send(p, cdw10);
+ case nvme_cmd_zone_mgmt_recv:
+ return nvmet_trace_zone_mgmt_recv(p, cdw10);
default:
return nvmet_trace_common(p, cdw10);
}
--
2.43.0
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH 3/3] nvmet: add tracing of authentication commands
2024-02-27 8:54 [PATCH 0/3] nvmet: add some commands tracing Guixin Liu
2024-02-27 8:54 ` [PATCH 1/3] nvmet: parse dsm command's attr deallocate when tracing Guixin Liu
2024-02-27 8:54 ` [PATCH 2/3] nvmet: add tracing of zns commands Guixin Liu
@ 2024-02-27 8:54 ` Guixin Liu
2024-02-27 16:37 ` [PATCH 0/3] nvmet: add some commands tracing Keith Busch
3 siblings, 0 replies; 6+ messages in thread
From: Guixin Liu @ 2024-02-27 8:54 UTC (permalink / raw)
To: hch, sagi, kch; +Cc: linux-nvme
Add nvme_fabrics_type_auth_send and nvme_fabrics_type_auth_receive
to the nvme target's tracing facility.
Signed-off-by: Guixin Liu <kanie@linux.alibaba.com>
---
drivers/nvme/target/trace.c | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
diff --git a/drivers/nvme/target/trace.c b/drivers/nvme/target/trace.c
index 6604e5fe57d8..49e5f35b2723 100644
--- a/drivers/nvme/target/trace.c
+++ b/drivers/nvme/target/trace.c
@@ -210,6 +210,34 @@ static const char *nvmet_trace_fabrics_property_get(struct trace_seq *p,
return ret;
}
+static const char *nvmet_trace_fabrics_auth_send(struct trace_seq *p, u8 *spc)
+{
+ const char *ret = trace_seq_buffer_ptr(p);
+ u8 spsp0 = spc[1];
+ u8 spsp1 = spc[2];
+ u8 secp = spc[3];
+ u32 tl = get_unaligned_le32(spc + 4);
+
+ trace_seq_printf(p, "spsp0=%02x, spsp1=%02x, secp=%02x, tl=%u",
+ spsp0, spsp1, secp, tl);
+ trace_seq_putc(p, 0);
+ return ret;
+}
+
+static const char *nvmet_trace_fabrics_auth_receive(struct trace_seq *p, u8 *spc)
+{
+ const char *ret = trace_seq_buffer_ptr(p);
+ u8 spsp0 = spc[1];
+ u8 spsp1 = spc[2];
+ u8 secp = spc[3];
+ u32 al = get_unaligned_le32(spc + 4);
+
+ trace_seq_printf(p, "spsp0=%02x, spsp1=%02x, secp=%02x, al=%u",
+ spsp0, spsp1, secp, al);
+ trace_seq_putc(p, 0);
+ return ret;
+}
+
static const char *nvmet_trace_fabrics_common(struct trace_seq *p, u8 *spc)
{
const char *ret = trace_seq_buffer_ptr(p);
@@ -229,6 +257,10 @@ const char *nvmet_trace_parse_fabrics_cmd(struct trace_seq *p,
return nvmet_trace_fabrics_connect(p, spc);
case nvme_fabrics_type_property_get:
return nvmet_trace_fabrics_property_get(p, spc);
+ case nvme_fabrics_type_auth_send:
+ return nvmet_trace_fabrics_auth_send(p, spc);
+ case nvme_fabrics_type_auth_receive:
+ return nvmet_trace_fabrics_auth_receive(p, spc);
default:
return nvmet_trace_fabrics_common(p, spc);
}
--
2.43.0
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH 0/3] nvmet: add some commands tracing
2024-02-27 8:54 [PATCH 0/3] nvmet: add some commands tracing Guixin Liu
` (2 preceding siblings ...)
2024-02-27 8:54 ` [PATCH 3/3] nvmet: add tracing of authentication commands Guixin Liu
@ 2024-02-27 16:37 ` Keith Busch
2024-02-28 2:24 ` Guixin Liu
3 siblings, 1 reply; 6+ messages in thread
From: Keith Busch @ 2024-02-27 16:37 UTC (permalink / raw)
To: Guixin Liu; +Cc: hch, sagi, kch, linux-nvme
On Tue, Feb 27, 2024 at 04:54:05PM +0800, Guixin Liu wrote:
> Hi all,
> This series of patches adds tracing support for ZNS commands and
> authentication commands to the NVMe target module, as well as updates the
> tracing of DSM commands to be more readable.
Patches 2 and 3 seem fine. I don't care for patch 1 since that makes it
impossible to see if anyone is sending unusual attributes.
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH 0/3] nvmet: add some commands tracing
2024-02-27 16:37 ` [PATCH 0/3] nvmet: add some commands tracing Keith Busch
@ 2024-02-28 2:24 ` Guixin Liu
0 siblings, 0 replies; 6+ messages in thread
From: Guixin Liu @ 2024-02-28 2:24 UTC (permalink / raw)
To: Keith Busch; +Cc: hch, sagi, kch, linux-nvme
在 2024/2/28 00:37, Keith Busch 写道:
> On Tue, Feb 27, 2024 at 04:54:05PM +0800, Guixin Liu wrote:
>> Hi all,
>> This series of patches adds tracing support for ZNS commands and
>> authentication commands to the NVMe target module, as well as updates the
>> tracing of DSM commands to be more readable.
> Patches 2 and 3 seem fine. I don't care for patch 1 since that makes it
> impossible to see if anyone is sending unusual attributes.
The patch 1 will be removed in v2.
Best Regards,
Guixin Liu
^ permalink raw reply [flat|nested] 6+ messages in thread