Re: [PATCH] nvme: implement support for nvme relaxed effects

Keith Busch
2024-02-06T16:06:12Z

On Tue, Feb 06, 2024 at 08:34:39AM +0000, Chaitanya Kulkarni wrote:
> >> + if (effects & NVME_CMD_EFFECTS_CSER_MASK)
> >> + effects &= ~NVME_CMD_EFFECTS_CSE_MASK;
> >> }
>
> looking at the code again we are not using NVME_CMD_EFFECTS_CSER_MASK
> anywhere in the code to guarantee the admin-cmd exclusive execution
> guarantee, is there a specific reason for that ?
>
> According to spec:-
> Figure 221: Command Supported and Effects data structure
>
> *Bits 15:14
> *Value :- 01b
> *Definition :-
> The command associated with this structure should only be submitted
> when there is no outstanding Admin command that affects any namespace
> and no Admin command should be submitted that affects any namespace
> until this command is complete.
>
> IOW, don't we need to freeze the admin queue when controller sets the CSER
> value to 01b until command is completed ? or it is not done/needed for
> a specific reason ?

The user is trying to submit an admin command, which wouldn't be
possible if we freeze the admin queue. We'd need another mechanism to
allow just the user's command, then a way to defeat it if that command
times out (we send admin commands as part of a reset sequence).

All that adds complications to the driver, and since there hasn't been
any communicated need to have the driver enforce this policy, we just
leave it up to user space to know what they're doing.