Printing nvme command at OpenSSD

Post Reply
kirankumarmatam
Posts: 2
Joined: Fri May 26, 2017 7:43 pm

Printing nvme command at OpenSSD

Post by kirankumarmatam » Thu Jul 06, 2017 7:11 am

Dear All,
I am trying to print the I/O nvme command requested by the host at OpenSSD controller. But I am not getting the expected output. Can you please help me?

Here is my code for printing the data
------In nvme_main.c file, added code before call to handle_nvme_io_cmd(&nvmeCmd) function------

xil_printf("qID = %d cmdSlotTag = %d cmdSeqNum = %d ",nvmeCmd.qID, nvmeCmd.cmdSlotTag, nvmeCmd.cmdSeqNum);
int i=0;
for(i=0;i<16;i++)
{
xil_printf("%d ",nvmeCmd.cmdDword);
}
xil_printf("\n");
handle_nvme_io_cmd(&nvmeCmd);
exeLlr = 0;
-----------------
Here is the output:

qID = 1 cmdSlotTag = 0 cmdSeqNum = 35 2 1 0 0 0 0 -913006592 0 0 0 0 0 0 0 0 0
qID = 1 cmdSlotTag = 1 cmdSeqNum = 36 513 1 0 0 0 0 -21368832 3 0 0 512 0 0 0 0 0
qID = 1 cmdSlotTag = 0 cmdSeqNum = 37 2 1 0 0 0 0 131239936 4 0 0 254096368

many more lines similar to above are printed.
----------------
Here is the the host command that I am using

io.opcode = nvme_cmd_write;
io.flags = 0;
io.control = 0;
io.metadata = (unsigned long)0;
io.addr = (unsigned long)data_wr;
io.slba = 0x200;
io.nblocks = 0;
io.dsmgmt = 0;
io.reftag = 0;
io.apptag = 0;
io.appmask = 0;

err = ioctl(fd, NVME_IOCTL_SUBMIT_IO, &io);
------------------

If you need more information then let me know, I can post.

Thanks,
Kiran.

kirankumarmatam
Posts: 2
Joined: Fri May 26, 2017 7:43 pm

Re: Printing nvme command at OpenSSD

Post by kirankumarmatam » Thu Jul 06, 2017 7:25 am

For the above code I am expecting one line in the output as I am calling the nvme command from the host once. However I am observing many lines of output and they don't represent the nvme command that I am calling.

Thanks,
Kiran.

SangjinLee
Posts: 4
Joined: Thu Mar 30, 2017 9:24 am

Re: Printing nvme command at OpenSSD

Post by SangjinLee » Thu Jul 06, 2017 3:04 pm

Hi,

You could refer 'struct _NVME_IO_COMMAND', 'struct _IO_WRITE_COMMAND_DW12', 'struct _IO_WRITE_COMMAND_DW13' and 'struct _IO_WRITE_COMMAND_DW15' on 'nvme.h'.

The second one, qID = 1 cmdSlotTag = 1 cmdSeqNum = 36 513 1 0 0 0 0 -21368832 3 0 0 512 0 0 0 0 0, could be candidate for the command that you sent. Because 512d is equal to 200h. But I have no idea with NSID 513.

Thanks,
Sangjin Lee

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest