@@ -119,16 +119,82 @@ const char *nvmet_trace_parse_admin_cmd(struct trace_seq *p,
119119 }
120120}
121121
122+ static const char * nvmet_trace_zone_mgmt_send (struct trace_seq * p , u8 * cdw10 )
123+ {
124+ static const char * const zsa_strs [] = {
125+ [0x01 ] = "close zone" ,
126+ [0x02 ] = "finish zone" ,
127+ [0x03 ] = "open zone" ,
128+ [0x04 ] = "reset zone" ,
129+ [0x05 ] = "offline zone" ,
130+ [0x10 ] = "set zone descriptor extension"
131+ };
132+ const char * ret = trace_seq_buffer_ptr (p );
133+ u64 slba = get_unaligned_le64 (cdw10 );
134+ const char * zsa_str ;
135+ u8 zsa = cdw10 [12 ];
136+ u8 all = cdw10 [13 ];
137+
138+ if (zsa < ARRAY_SIZE (zsa_strs ) && zsa_strs [zsa ])
139+ zsa_str = zsa_strs [zsa ];
140+ else
141+ zsa_str = "reserved" ;
142+
143+ trace_seq_printf (p , "slba=%llu, zsa=%u:%s, all=%u" ,
144+ slba , zsa , zsa_str , all );
145+ trace_seq_putc (p , 0 );
146+
147+ return ret ;
148+ }
149+
150+ static const char * nvmet_trace_zone_mgmt_recv (struct trace_seq * p , u8 * cdw10 )
151+ {
152+ static const char * const zrasf_strs [] = {
153+ [0x00 ] = "list all zones" ,
154+ [0x01 ] = "list the zones in the ZSE: Empty state" ,
155+ [0x02 ] = "list the zones in the ZSIO: Implicitly Opened state" ,
156+ [0x03 ] = "list the zones in the ZSEO: Explicitly Opened state" ,
157+ [0x04 ] = "list the zones in the ZSC: Closed state" ,
158+ [0x05 ] = "list the zones in the ZSF: Full state" ,
159+ [0x06 ] = "list the zones in the ZSRO: Read Only state" ,
160+ [0x07 ] = "list the zones in the ZSO: Offline state" ,
161+ [0x09 ] = "list the zones that have the zone attribute"
162+ };
163+ const char * ret = trace_seq_buffer_ptr (p );
164+ u64 slba = get_unaligned_le64 (cdw10 );
165+ u32 numd = get_unaligned_le32 (& cdw10 [8 ]);
166+ u8 zra = cdw10 [12 ];
167+ u8 zrasf = cdw10 [13 ];
168+ const char * zrasf_str ;
169+ u8 pr = cdw10 [14 ];
170+
171+ if (zrasf < ARRAY_SIZE (zrasf_strs ) && zrasf_strs [zrasf ])
172+ zrasf_str = zrasf_strs [zrasf ];
173+ else
174+ zrasf_str = "reserved" ;
175+
176+ trace_seq_printf (p , "slba=%llu, numd=%u, zra=%u, zrasf=%u:%s, pr=%u" ,
177+ slba , numd , zra , zrasf , zrasf_str , pr );
178+ trace_seq_putc (p , 0 );
179+
180+ return ret ;
181+ }
182+
122183const char * nvmet_trace_parse_nvm_cmd (struct trace_seq * p ,
123184 u8 opcode , u8 * cdw10 )
124185{
125186 switch (opcode ) {
126187 case nvme_cmd_read :
127188 case nvme_cmd_write :
128189 case nvme_cmd_write_zeroes :
190+ case nvme_cmd_zone_append :
129191 return nvmet_trace_read_write (p , cdw10 );
130192 case nvme_cmd_dsm :
131193 return nvmet_trace_dsm (p , cdw10 );
194+ case nvme_cmd_zone_mgmt_send :
195+ return nvmet_trace_zone_mgmt_send (p , cdw10 );
196+ case nvme_cmd_zone_mgmt_recv :
197+ return nvmet_trace_zone_mgmt_recv (p , cdw10 );
132198 default :
133199 return nvmet_trace_common (p , cdw10 );
134200 }
0 commit comments