hw/block/nvme: fix create IO SQ/CQ status codes
authorGollu Appalanaidu <anaidu.gollu@samsung.com>
Thu, 22 Oct 2020 06:28:46 +0000 (11:58 +0530)
committerKlaus Jensen <k.jensen@samsung.com>
Tue, 27 Oct 2020 10:29:25 +0000 (11:29 +0100)
commit482e97fcfad6672d2849f2fe36bd460d70468b0a
treef464a0834f428367931af38e3c9e97d7bdb05a13
parent28fee5b5d02d59a2b039c71a0a72292b1bc7f75b
hw/block/nvme: fix create IO SQ/CQ status codes

Replace the Invalid Field in Command with the Invalid PRP Offset status
code in the nvme_create_{cq,sq} functions. Also, allow PRP1 to be
address 0x0.

Also replace the Completion Queue Invalid status code returned in
nvme_create_cq when the the queue identifier is invalid with the Invalid
Queue Identifier. The Completion Queue Invalid status code is
exclusively for indicating that the completion queue identifer given
when creating a submission queue is invalid.

See NVM Express v1.3d, Section 5.3 ("Create I/O Completion Queue
command") and 5.4("Create I/O Submission Queue command").

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
hw/block/nvme.c