All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chaitanya Kulkarni <chaitanyak@nvidia.com>
To: Alan Adamson <alan.adamson@oracle.com>,
	Keith Busch <kbusch@kernel.org>, Christoph Hellwig <hch@lst.de>,
	Hannes Reinecke <hare@suse.de>, Sagi Grimberg <sagi@grimberg.me>
Cc: "linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>,
	"hch@lst.de" <hch@lst.de>
Subject: Re: [PATCH] nvme-core: mark passthru requests RQF_QUIET flag
Date: Wed, 6 Apr 2022 22:16:40 +0000	[thread overview]
Message-ID: <feec0fdf-2790-1f48-9a95-88bf208784ab@nvidia.com> (raw)
In-Reply-To: <92C8BCED-6845-46D4-BCD0-78E790A5F86E@oracle.com>

On 4/6/22 15:06, Alan Adamson wrote:
> 
> 
>> On Apr 6, 2022, at 10:21 AM, Keith Busch <kbusch@kernel.org> wrote:
>>
>> On Wed, Apr 06, 2022 at 05:01:46PM +0000, Chaitanya Kulkarni wrote:
>>> On 4/6/22 09:52, Keith Busch wrote:
>>>> On Wed, Apr 06, 2022 at 09:41:09AM -0700, Chaitanya Kulkarni wrote:
>>>>> @@ -370,7 +370,8 @@ 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 != NVME_SC_SUCCESS &&
>>>>> +		    !(req->rq_flags & RQF_QUIET)))
>>>>>   		nvme_log_error(req);
>>>>>   	nvme_end_req_zoned(req);
>>>>>   	nvme_trace_bio_complete(req);
>>>>> @@ -651,6 +652,7 @@ void nvme_init_request(struct request *req, struct nvme_command *cmd)
>>>>>   	cmd->common.flags &= ~NVME_CMD_SGL_ALL;
>>>>>
>>>>>   	req->cmd_flags |= REQ_FAILFAST_DRIVER;
>>>>> +	req->rq_flags |= RQF_QUIET;
>>>>
>>>> This defeats the admin error logging logic since every admin command comes
>>>> through here. If you're sure we should do this, then I suppose you can remove
>>>> that unreachable code.
>>>
>>> If you point out the unreachable code that will be great,
>>> I'll keep looking meanwhile...
>>
>> The second half of nvme_log_error(), plus nvme_get_admin_opcode_str() and the
>> array it defines are unreachable since all admin commands don't log errors with
>> this change.
>>
>> You could skip the RQF_QUIET setting and check blk_rq_is_passthrough() instead.
> 
> Using RQF_QUIET or blk_rq_is_passrhrough() will mean no nvme admin-passthru command will log an error.
> I ran into this using the blktests I’m coding up for verbose errors.  Is this the behavior we want?
> 
> Alan
> 

Sagi/Christoph/Hannes/Keith,

After debugging the issue following patch [1] makes errors disappear.

But I'm not sure if this behavior aligns with protocol or not.

I'll keep digging, meanwhile if anyone has an idea please provide a 
review on patch in [1] if make sense or not.

-ck

[1] mask invalid NVME_ID_CNS_CS_CTRL errors.

diff --git a/drivers/nvme/target/admin-cmd.c 
b/drivers/nvme/target/admin-cmd.c
index 397daaf51f1b..e5eea2f0ac9c 100644
--- a/drivers/nvme/target/admin-cmd.c
+++ b/drivers/nvme/target/admin-cmd.c
@@ -718,9 +718,16 @@ static void nvmet_execute_identify(struct nvmet_req 
*req)
                         switch (req->cmd->identify.csi) {
                         case NVME_CSI_ZNS:
                                 return 
nvmet_execute_identify_cns_cs_ctrl(req);
+                       case NVME_CSI_NVM:
+                               return nvmet_execute_identify_ctrl(req);
                         default:
                                 break;
                         }
+               } else {
+                       switch (req->cmd->identify.csi) {
+                       case NVME_CSI_NVM:
+                               return nvmet_execute_identify_ctrl(req);
+                       }
                 }
                 break;
         case NVME_ID_CNS_NS_ACTIVE_LIST:
diff --git a/drivers/nvme/target/discovery.c 
b/drivers/nvme/target/discovery.c
index c2162eef8ce1..34c7ed055674 100644
--- a/drivers/nvme/target/discovery.c
+++ b/drivers/nvme/target/discovery.c
@@ -254,7 +254,11 @@ static void nvmet_execute_disc_identify(struct 
nvmet_req *req)
         if (!nvmet_check_transfer_len(req, NVME_IDENTIFY_DATA_SIZE))
                 return;

-       if (req->cmd->identify.cns != NVME_ID_CNS_CTRL) {
+       switch (req->cmd->identify.cns) {
+       case NVME_ID_CNS_CTRL:
+       case NVME_ID_CNS_CS_CTRL:
+               break;
+       default:
                 req->error_loc = offsetof(struct nvme_identify, cns);
                 status = NVME_SC_INVALID_FIELD | NVME_SC_DNR;
                 goto out;


  reply	other threads:[~2022-04-06 22:17 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-06 16:41 [PATCH] nvme-core: mark passthru requests RQF_QUIET flag Chaitanya Kulkarni
2022-04-06 16:52 ` Keith Busch
2022-04-06 17:01   ` Chaitanya Kulkarni
2022-04-06 17:21     ` Keith Busch
2022-04-06 22:06       ` Alan Adamson
2022-04-06 22:16         ` Chaitanya Kulkarni [this message]
2022-04-06 23:29           ` Alan Adamson
2022-04-07 19:40             ` Chaitanya Kulkarni
2022-04-07  8:48           ` Christoph Hellwig
2022-04-07  8:51         ` hch
2022-04-07 11:52           ` Sagi Grimberg
2022-04-07 20:10             ` Chaitanya Kulkarni
2022-04-07 20:35               ` Alan Adamson
2022-04-07 21:00                 ` Chaitanya Kulkarni
2022-04-07 21:13                   ` Alan Adamson
2022-04-08  2:13                     ` Chaitanya Kulkarni
2022-04-08 16:24                       ` Alan Adamson
2022-04-09  0:10                         ` Chaitanya Kulkarni
2022-04-11 18:31                           ` Alan Adamson
2022-04-11 19:53                             ` Chaitanya Kulkarni
2022-04-11 21:39                               ` Alan Adamson
2022-04-07 16:15           ` Alan Adamson
2022-04-06 17:03   ` Chaitanya Kulkarni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=feec0fdf-2790-1f48-9a95-88bf208784ab@nvidia.com \
    --to=chaitanyak@nvidia.com \
    --cc=alan.adamson@oracle.com \
    --cc=hare@suse.de \
    --cc=hch@lst.de \
    --cc=kbusch@kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.