[PATCHv2] nvme: enable retries for authentication commands

Keith Busch kbusch at kernel.org
Fri Jan 26 08:21:19 PST 2024


On Fri, Jan 26, 2024 at 07:37:09AM +0100, hare at kernel.org wrote:
>  int __nvme_submit_sync_cmd(struct request_queue *q, struct nvme_command *cmd,
>  		union nvme_result *result, void *buffer, unsigned bufflen,
> -		int qid, int at_head, blk_mq_req_flags_t flags)
> +		int qid, nvme_submit_flags_t flags)
>  {
>  	struct request *req;
>  	int ret;
> +	blk_mq_req_flags_t blk_flags = 0;
>  
> +	if (flags & NVME_SUBMIT_NOWAIT)
> +		blk_flags |= BLK_MQ_REQ_NOWAIT;
> +	if (flags & NVME_SUBMIT_RESERVED)
> +		blk_flags |= BLK_MQ_REQ_RESERVED;
>  	if (qid == NVME_QID_ANY)
> -		req = blk_mq_alloc_request(q, nvme_req_op(cmd), flags);
> +		req = blk_mq_alloc_request(q, nvme_req_op(cmd), blk_flags);
>  	else
> -		req = blk_mq_alloc_request_hctx(q, nvme_req_op(cmd), flags,
> +		req = blk_mq_alloc_request_hctx(q, nvme_req_op(cmd), blk_flags,
>  						qid - 1);
>  
>  	if (IS_ERR(req))
>  		return PTR_ERR(req);
>  	nvme_init_request(req, cmd);
> +	if (flags & NVME_SUBMIT_RETRY)
> +		req->cmd_flags &= ~REQ_FAILFAST_DRIVER;

I think it'd be a bit easier to review if you do a prep patch to
introduce nvme_submit_flags without adding any new behavior first.



More information about the Linux-nvme mailing list