[PATCH] nvme-core: optimize process for error status NVME_SC_CMD_INTERRUPTED

Sagi Grimberg sagi at grimberg.me
Fri Jul 24 18:01:44 EDT 2020


> @@ -243,7 +242,7 @@ static blk_status_t nvme_error_status(u16 status)
>   
>   static inline bool nvme_req_needs_retry(struct request *req)
>   {
> -	if (blk_noretry_request(req))
> +	if (!nvme_req_local_retry(req) && blk_noretry_request(req))

Why is this needed?

>   		return false;
>   	if (nvme_req(req)->status & NVME_SC_DNR)
>   		return false;
> diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h
> index 1de3f9b827aa..3213aae8985c 100644
> --- a/drivers/nvme/host/nvme.h
> +++ b/drivers/nvme/host/nvme.h
> @@ -725,4 +725,10 @@ void nvme_hwmon_init(struct nvme_ctrl *ctrl);
>   static inline void nvme_hwmon_init(struct nvme_ctrl *ctrl) { }
>   #endif
>   
> +static inline bool nvme_req_local_retry(struct request *req)
> +{
> +	if (nvme_req(req)->status == NVME_SC_CMD_INTERRUPTED)
> +		return true;
> +	return false;
> +}
>   #endif /* _NVME_H */
> 



More information about the Linux-nvme mailing list