[PATCH 3/3] nvme-core: mark internal passthru req REQ_QUIET
Jonathan Derrick
jonathan.derrick at linux.dev
Wed Apr 13 09:48:45 PDT 2022
Hi
On 4/10/2022 9:12 PM, Chaitanya Kulkarni wrote:
> Mark internal passthru requests quiet in the submission path with
> RQF_QUIET flag added in the __nvme_submit_sync_cmd(). In the completion
> path, if nvme request is resulted in the error and request is marked
> RQF_QUIET then don't log the error with nvme_error_log().
>
> Signed-off-by: Chaitanya Kulkarni <kch at nvidia.com>
> ---
> drivers/nvme/host/core.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
> index 449378a96a9f..12302be83a6c 100644
> --- a/drivers/nvme/host/core.c
> +++ b/drivers/nvme/host/core.c
> @@ -370,7 +370,7 @@ static inline void nvme_end_req(struct request *req)
> {
> blk_status_t status = nvme_error_status(nvme_req(req)->status);
>
> - if (unlikely(nvme_req(req)->status != NVME_SC_SUCCESS))
> + if (unlikely(nvme_req(req)->status && !(req->rq_flags & RQF_QUIET)))
> nvme_log_error(req);
> nvme_end_req_zoned(req);
> nvme_trace_bio_complete(req);
> @@ -1100,6 +1100,7 @@ int __nvme_submit_sync_cmd(struct request_queue *q, struct nvme_command *cmd,
> goto out;
> }
>
> + req->rq_flags |= RQF_QUIET;
Any reason to not make it a part of flags in the argument list and let
the block layer build the req with it?
eg:
flags |= REQ_QUIET;
if (qid == NVME_QID_ANY)
req = blk_mq_alloc_request(q, nvme_req_op(cmd), flags);
else
req = blk_mq_alloc_request_hctx(q, nvme_req_op(cmd), flags,
qid ? qid - 1 : 0);
> ret = nvme_execute_rq(req, at_head);
> if (result && ret >= 0)
> *result = nvme_req(req)->result;
More information about the Linux-nvme
mailing list