All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Hannes Reinecke <hare@suse.de>, Christoph Hellwig <hch@lst.de>
Cc: hare@kernel.org, Sagi Grimberg <sagi@grimberg.me>,
	Keith Busch <kbusch@kernel.org>,
	linux-nvme@lists.infradead.org,
	Martin George <marting@netapp.com>
Subject: Re: [PATCH] nvme: enable retries for authentication commands
Date: Thu, 25 Jan 2024 10:18:10 -0700	[thread overview]
Message-ID: <53d98444-16b1-48bb-a3f2-ecd897a29299@kernel.dk> (raw)
In-Reply-To: <d4a814f5-0dc9-46d9-8c5c-eaa31cd889f4@suse.de>

On 1/25/24 10:09 AM, Hannes Reinecke wrote:
> On 1/25/24 17:50, Jens Axboe wrote:
>> On 1/25/24 9:20 AM, Hannes Reinecke wrote:
>>> On 1/25/24 16:48, Christoph Hellwig wrote:
>>>> On Thu, Jan 25, 2024 at 08:42:10AM -0700, Jens Axboe wrote:
>>>>> On 1/25/24 6:09 AM, hare@kernel.org wrote:
>>>>>> From: Hannes Reinecke <hare@suse.de>
>>>>>>
>>>>>> Authentication commands are normal NVMe commands, and as such
>>>>>> can return a status where NVME_SC_DNR is not set, indicating
>>>>>> that the command should be retried.
>>>>>> Rather than checking NVME_SC_DNR manually for each command completion
>>>>>> this patch adds a flag 'retry' to __nvme_submit_sync_cmd(), causing
>>>>>> the REQ_FAILFAST_DRIVER option to be cleared and the command to
>>>>>> be retried via the normal mechanism.
>>>>>
>>>>> Can we please do this without adding Yet Another parameter to that
>>>>> function?
>>>>
>>>> Heh, I wrote about the same reply a few minutes ago.  I'll try to think
>>>> what we can do instead.
>>>
>>> We could do something like this:
>>
>> That won't really do much, and yeah wouldn't be the way even if
>> complete. How about just not setting the flag in the first place?
>> nvme_init_request() defaults to doing it, so either pass in the init
>> flags to that, or just clear it in there and have the callers decide if
>> they want to set it.
>>
> But that's the thing; the request is never visible to the caller.
> So moving things out of the nvme_init_request() doesn't really help.
> 
> And open-coding __nvme_submit_sync_cmd() also doesn't look very
> appealing.

__nvme_submit_sync_cmd() already takes another bool (at_head) and blk-mq
flags. You could have it take some nvme specific flags instead, and fold
those two parameters into a single flags. Once that is done, adding the
retry flag on top would be trivial.

And as a side benefit, it gets RID of a bool flag rather than add
another random one.

-- 
Jens Axboe



      reply	other threads:[~2024-01-25 17:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-25 13:09 [PATCH] nvme: enable retries for authentication commands hare
2024-01-25 15:42 ` Jens Axboe
2024-01-25 15:48   ` Christoph Hellwig
2024-01-25 16:20     ` Hannes Reinecke
2024-01-25 16:50       ` Jens Axboe
2024-01-25 17:09         ` Hannes Reinecke
2024-01-25 17:18           ` Jens Axboe [this message]

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=53d98444-16b1-48bb-a3f2-ecd897a29299@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=hare@kernel.org \
    --cc=hare@suse.de \
    --cc=hch@lst.de \
    --cc=kbusch@kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=marting@netapp.com \
    --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.