nvmet_set_error ignores error_loc NVMET_NO_ERROR_LOC

Chaitanya Kulkarni Chaitanya.Kulkarni at wdc.com
Tue Mar 16 18:26:27 GMT 2021


On 3/16/21 02:09, Engel, Amit wrote:
> Hello,
> A question regarding Get Log Page - Error Information lid 01h:
> According to nvme spec 1.4,  bytes 15:14 refer to 'Parameter Error Location'
> "If the error is not specific to a particular command, then this field shall be set to FFFFh"
>
> In the current implementation, nvmet_req_init initializes req->error_loc to NVMET_NO_ERROR_LOC (((u16)-1))
> Then nvmet_set_error has this condition:
>
> if (!ctrl || req->error_loc == NVMET_NO_ERROR_LOC)
> 	return;
>
> means that the error log will not contain errors that don't specify error_loc
> is that expected ? 
> don't we expect that param_error_location log page field will be set to FFFFh in case there is no other valid req->error_loc ?
>

Based on your email description I think this is what is needed,
please confirm I'll send out a patch:-

diff --git a/drivers/nvme/target/core.c b/drivers/nvme/target/core.c
index b15ed7ac34eb..29a6a1446cd8 100644
--- a/drivers/nvme/target/core.c
+++ b/drivers/nvme/target/core.c
@@ -914,6 +914,7 @@ bool nvmet_req_init(struct nvmet_req *req, struct
nvmet_cq *cq,
        req->cqe->sq_head = 0;
        req->ns = NULL;
        req->error_loc = NVMET_NO_ERROR_LOC;
+       req->param_error_location = 0xffff;
        req->error_slba = 0;
 
        /* no support for fused commands yet */




More information about the Linux-nvme mailing list