[PATCH] nvme-core: mark passthru requests RQF_QUIET flag

Alan Adamson alan.adamson at oracle.com
Fri Apr 8 09:24:26 PDT 2022



> On Apr 7, 2022, at 7:13 PM, Chaitanya Kulkarni <chaitanyak at nvidia.com> wrote:
> 
> 
>>> nvme (nvme-5.18) # git diff
>>> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
>>> index f204c6f78b5b..a1ea2f736d42 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);
>>> @@ -1086,9 +1086,11 @@ int __nvme_submit_sync_cmd(struct request_queue
>>> *q, struct nvme_command *cmd,
>>>         else
>>>                 req = blk_mq_alloc_request_hctx(q, nvme_req_op(cmd), flags,
>>>                                                 qid ? qid - 1 : 0);
>>> -
>>>         if (IS_ERR(req))
>>>                 return PTR_ERR(req);
>>> +
>>> +       req->rq_flags |= RQF_QUIET;
>>> +
>>>         nvme_init_request(req, cmd);
>>> 
>>>         if (timeout)
>>> 
>>> 
>>> if not then I'll keep digging..
>>> 
>>> -ck
>> 
>> I just tried the patch on my config, it properly suppresses the bootup message, but it also supresses messages from "nvme admin-passthru”.
>> 
>> Alan
>> 
> 
> Can you please share a command line for "nvme admin-passthru"
> where this patch supresses messages ?

I have the NVME Fault Injector configured:

echo 0x286 > /sys/kernel/debug/${ctrl_dev}/fault_inject/status
echo 1000 > /sys/kernel/debug/${ctrl_dev}/fault_inject/times
echo 100 > /sys/kernel/debug/${ctrl_dev}/fault_inject/probability

nvme admin-passthru /dev/${ctrl_dev} --opcode=06 --data-len=4096 --cdw10=1 -r

echo 0 >  /sys/kernel/debug/${ctrl_dev}/fault_inject/probability

> 
> -ck
> 
> 



More information about the Linux-nvme mailing list